Skip to content

Commit

Permalink
Revert "[llvm] Native size estimator for training -Oz inliner"
Browse files Browse the repository at this point in the history
This reverts commit 83080a2 as
it breaks the macOS modules build.
  • Loading branch information
Davide Italiano committed Jul 13, 2020
1 parent 341ec56 commit 9908a3b
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 11,464 deletions.
12 changes: 0 additions & 12 deletions llvm/CMakeLists.txt
Expand Up @@ -981,18 +981,6 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
endif()

set(TENSORFLOW_C_LIB_PATH "" CACHE PATH "Path to TensorFlow C library install")
find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib)

# Similar to the above Tensorflow dependency, please refer to the same script.
# In this case, the latest C API library is available for download from
# https://www.tensorflow.org/install/lang_c
if (tensorflow_c_api)
set(LLVM_HAVE_TF_API "ON" CACHE BOOL "Full Tensorflow API available")
add_definitions("-DLLVM_HAVE_TF_API")
include_directories(${TENSORFLOW_C_LIB_PATH}/include)
endif()

# Put this before tblgen. Else we have a circular dependence.
add_subdirectory(lib/Demangle)
add_subdirectory(lib/Support)
Expand Down
35 changes: 0 additions & 35 deletions llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h

This file was deleted.

136 changes: 0 additions & 136 deletions llvm/include/llvm/Analysis/Utils/TFUtils.h

This file was deleted.

40 changes: 9 additions & 31 deletions llvm/lib/Analysis/CMakeLists.txt
@@ -1,35 +1,17 @@
set(CommonMLSources MLInlineAdvisor.cpp)
set(ReleaseModeMLSources ReleaseModeModelRunner.cpp)
set(DevelopmentModeMLSources TFUtils.cpp)

if (DEFINED LLVM_HAVE_TF_AOT OR DEFINED LLVM_HAVE_TF_API)
set(MLPolicySources ${CommonMLSources})
if (DEFINED LLVM_HAVE_TF_AOT)
include(TensorFlowCompile)
tfcompile(models/inliner serve action InlinerSizeModel llvm::InlinerSizeModel)
list(APPEND ReleaseModeMLSources
$<TARGET_OBJECTS:tf_xla_runtime_objects>
${GENERATED_OBJS}
)
LIST(APPEND MLPolicySources ${ReleaseModeMLSources})
else()
LIST(APPEND LLVM_OPTIONAL_SOURCES ${ReleaseModeMLSources})
endif()

if (DEFINED LLVM_HAVE_TF_API)
LIST(APPEND MLPolicySources ${DevelopmentModeMLSources})
LIST(APPEND MLLinkDeps ${tensorflow_c_api})
else()
LIST(APPEND LLVM_OPTIONAL_SOURCES ${DevelopmentModeMLSources})
endif()
if (DEFINED LLVM_HAVE_TF_AOT)
include(TensorFlowCompile)
tfcompile(models/inliner serve action InlinerSizeModel llvm::InlinerSizeModel)
list(APPEND ReleaseModeMLSources
$<TARGET_OBJECTS:tf_xla_runtime_objects>
${GENERATED_OBJS}
)
set(MLPolicySources ${CommonMLSources} ${ReleaseModeMLSources})
else()
LIST(APPEND LLVM_OPTIONAL_SOURCES
${CommonMLSources}
${DevelopmentModeMLSources}
${ReleaseModeMLSources}
)
set(LLVM_OPTIONAL_SOURCES ${CommonMLSources} ${ReleaseModeMLSources})
endif()


add_llvm_component_library(LLVMAnalysis
AliasAnalysis.cpp
Expand Down Expand Up @@ -75,7 +57,6 @@ add_llvm_component_library(LLVMAnalysis
InlineCost.cpp
InlineAdvisor.cpp
InlineFeaturesAnalysis.cpp
InlineSizeEstimatorAnalysis.cpp
InstCount.cpp
InstructionPrecedenceTracking.cpp
InstructionSimplify.cpp
Expand Down Expand Up @@ -143,7 +124,4 @@ add_llvm_component_library(LLVMAnalysis

DEPENDS
intrinsics_gen

LINK_LIBS
${MLLinkDeps}
)

0 comments on commit 9908a3b

Please sign in to comment.