1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[mlgo] fix build rules

This was prompted by D95727, which had the side-effect to break the
'release' mode build bot for ML-driven policies. The problem is that now
the pre-compiled object files don't get transitively carried through as
'source' anymore; that being said, the previous way of consuming them
was problematic, because it was only working for static builds; in
dynamic builds, the whole tf_xla_runtime was linked, which is
undesirable.

The alternative is to treat tf_xla_runtime as an archive, which then
leads to the desired effect.

Differential Revision: https://reviews.llvm.org/D99829
This commit is contained in:
Mircea Trofin 2021-04-02 23:45:35 -07:00
parent f08c9be588
commit f5b32d9a38
2 changed files with 7 additions and 2 deletions

View File

@ -794,6 +794,9 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
include_directories(${TENSORFLOW_AOT_PATH}/include)
add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
install(TARGETS tf_xla_runtime EXPORT LLVMExports
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime)
endif()
# Keep the legacy CMake flag ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER for

View File

@ -6,9 +6,10 @@ if (DEFINED LLVM_HAVE_TF_AOT OR DEFINED LLVM_HAVE_TF_API)
include(TensorFlowCompile)
tfcompile(${LLVM_INLINER_MODEL_PATH} serve action InlinerSizeModel llvm::InlinerSizeModel)
list(APPEND GeneratedMLSources
$<TARGET_OBJECTS:tf_xla_runtime_objects>
${GENERATED_OBJS}
${GENERATED_HEADERS}
)
LIST(APPEND MLDeps tf_xla_runtime)
LIST(APPEND MLLinkDeps tf_xla_runtime ${GENERATED_OBJS})
endif()
if (DEFINED LLVM_HAVE_TF_API)
@ -137,6 +138,7 @@ add_llvm_component_library(LLVMAnalysis
DEPENDS
intrinsics_gen
${MLDeps}
LINK_LIBS
${MLLinkDeps}