Skip to content

Commit

Permalink
[mlgo] Retire LLVM_HAVE_TF_API
Browse files Browse the repository at this point in the history
I've eliminated all uses of LLVM_HAVE_TF_API except a couple of them
being removed in llvm/lib/CodeGen/CMakeLists.txt.  This patch removes
remaining definitions and uses of LLVM_HAVE_TF_API.

Differential Revision: https://reviews.llvm.org/D140169
  • Loading branch information
kazutakahirata committed Dec 15, 2022
1 parent d459be4 commit ee0c631
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion llvm/CMakeLists.txt
Expand Up @@ -975,7 +975,6 @@ set(LLVM_HAVE_TFLITE "" CACHE BOOL "Use tflite")
if (LLVM_HAVE_TFLITE)
find_package(protobuf REQUIRED)
find_package(tensorflow-lite REQUIRED)
set(LLVM_HAVE_TF_API "ON" CACHE BOOL "Full Tensorflow API available")
set(LLVM_PROTOBUF_OUT_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/protobuf_gen)
include_directories(${LLVM_PROTOBUF_OUT_DIR})
endif()
Expand Down
3 changes: 0 additions & 3 deletions llvm/include/llvm/Config/llvm-config.h.cmake
Expand Up @@ -98,9 +98,6 @@
/* Define if zstd compression is available */
#cmakedefine01 LLVM_ENABLE_ZSTD

/* Define if LLVM was built with a dependency to the libtensorflow dynamic library */
#cmakedefine LLVM_HAVE_TF_API

/* Define if LLVM is using tflite instead of libtensorflow */
#cmakedefine LLVM_HAVE_TFLITE

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/CMakeLists.txt
@@ -1,4 +1,4 @@
if (DEFINED LLVM_HAVE_TF_AOT OR DEFINED LLVM_HAVE_TF_API)
if (DEFINED LLVM_HAVE_TF_AOT OR LLVM_HAVE_TFLITE)
include(TensorFlowCompile)
set(LLVM_RAEVICT_MODEL_PATH_DEFAULT "models/regalloc-eviction")

Expand All @@ -17,7 +17,7 @@ if (DEFINED LLVM_HAVE_TF_AOT OR DEFINED LLVM_HAVE_TF_API)
)
endif()

if (DEFINED LLVM_HAVE_TF_API)
if (LLVM_HAVE_TFLITE)
list(APPEND MLLinkDeps ${tensorflow_c_api} ${tensorflow_fx})
endif()
endif()
Expand Down
1 change: 0 additions & 1 deletion llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
Expand Up @@ -326,7 +326,6 @@ write_cmake_config("llvm-config") {
"LLVM_FORCE_ENABLE_STATS=",
"LLVM_FORCE_USE_OLD_TOOLCHAIN=",
"LLVM_HAS_ATOMICS=1",
"LLVM_HAVE_TF_API=",
"LLVM_HAVE_TFLITE=",
"LLVM_HOST_TRIPLE=$llvm_current_triple",
"LLVM_NATIVE_ARCH=$native_target",
Expand Down
1 change: 0 additions & 1 deletion llvm/utils/gn/secondary/llvm/test/BUILD.gn
Expand Up @@ -88,7 +88,6 @@ write_lit_config("lit_site_cfg") {
"OCAMLFLAGS=",
"LLVM_BUILD_EXAMPLES=0",
"LLVM_HAVE_TF_AOT=0",
"LLVM_HAVE_TF_API=0",
"LLVM_INLINER_MODEL_AUTOGENERATED=0",
"LLVM_RAEVICT_MODEL_AUTOGENERATED=0",
"PTXAS_EXECUTABLE=",
Expand Down
Expand Up @@ -99,9 +99,6 @@
/* Define if we have cpp-httplib and want to use it */
/* #undef LLVM_ENABLE_HTTPLIB */

/* Define if LLVM was built with a dependency to the libtensorflow dynamic library */
/* #undef LLVM_HAVE_TF_API */

/* Define if LLVM was built with a dependency to the tensorflow compiler */
/* #undef LLVM_HAVE_TF_AOT */

Expand Down
5 changes: 1 addition & 4 deletions utils/bazel/llvm_configs/llvm-config.h.cmake
Expand Up @@ -98,10 +98,7 @@
/* Define if zstd compression is available */
#cmakedefine01 LLVM_ENABLE_ZSTD

/* Define if LLVM was built with a dependency to the libtensorflow dynamic library */
#cmakedefine LLVM_HAVE_TF_API

/* Define if LLVM is using tflite instead of libtensorflow */
/* Define if LLVM is using tflite */
#cmakedefine LLVM_HAVE_TFLITE

/* Define to 1 if you have the <sysexits.h> header file. */
Expand Down

0 comments on commit ee0c631

Please sign in to comment.