File tree Expand file tree Collapse file tree 7 files changed +16
-8
lines changed Expand file tree Collapse file tree 7 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -850,6 +850,13 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
850
850
install (TARGETS tf_xla_runtime EXPORT LLVMExports
851
851
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime )
852
852
set_property (GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime )
853
+ # Once we add more modules, we should handle this more automatically.
854
+ if (NOT DEFINED LLVM_INLINER_MODEL_PATH
855
+ OR "${LLVM_INLINER_MODEL_PATH} " STREQUAL ""
856
+ OR "${LLVM_INLINER_MODEL_PATH} " STREQUAL "autogenerate" )
857
+ set (LLVM_INLINER_MODEL_PATH "autogenerate" )
858
+ set (LLVM_INLINER_MODEL_AUTOGENERATED 1 )
859
+ endif ()
853
860
endif ()
854
861
855
862
# Configure the three LLVM configuration header files.
Original file line number Diff line number Diff line change @@ -8,12 +8,6 @@ if (DEFINED LLVM_HAVE_TF_AOT OR DEFINED LLVM_HAVE_TF_API)
8
8
set (LLVM_INLINER_MODEL_CURRENT_URL "https://github.com/google/ml-compiler-opt/releases/download/inlining-Oz-v1.1/inlining-Oz-99f0063-v1.1.tar.gz" )
9
9
10
10
if (DEFINED LLVM_HAVE_TF_AOT )
11
- # If the path is empty, autogenerate the model
12
- if (NOT DEFINED LLVM_INLINER_MODEL_PATH OR "${LLVM_INLINER_MODEL_PATH} " STREQUAL "" )
13
- set (LLVM_INLINER_MODEL_PATH "autogenerate" )
14
- message (WARNING "LLVM_INLINER_MODEL_PATH was not set: autogenerating a model to finish the build." )
15
- endif ()
16
-
17
11
tf_find_and_compile (
18
12
${LLVM_INLINER_MODEL_PATH}
19
13
${LLVM_INLINER_MODEL_CURRENT_URL}
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ llvm_canonicalize_cmake_booleans(
17
17
LLVM_BYE_LINK_INTO_TOOLS
18
18
LLVM_HAVE_TF_AOT
19
19
LLVM_HAVE_TF_API
20
+ LLVM_INLINER_MODEL_AUTOGENERATED
20
21
LLVM_ENABLE_EXPENSIVE_CHECKS
21
22
)
22
23
Original file line number Diff line number Diff line change 1
1
; Test behavior when inlining policy grows size out of control.
2
2
; In all cases, the end result is the same: mandatory inlinings must happen.
3
- ; However, when we discover we 'trip' over the artificially-low size increase
3
+ ; However, when we discover we 'trip' over the artificially-low size increase
4
4
; factor, we don't inline anymore.
5
5
; REQUIRES: have_tf_aot
6
+ ; REQUIRES: llvm_inliner_model_autogenerated
6
7
; RUN: opt -passes=scc-oz-module-inliner -enable-ml-inliner=release -ml-advisor-size-increase-threshold=10.0 -S < %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=NOBOUNDS
7
8
; RUN: opt -passes=scc-oz-module-inliner -enable-ml-inliner=release -ml-advisor-size-increase-threshold=1.0 -S < %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=BOUNDS
8
9
@@ -38,4 +39,4 @@ attributes #0 = { alwaysinline }
38
39
; @some-function isn't mandatory, and when we set the increase threshold too low,
39
40
; it won't be inlined.
40
41
; NOBOUNDS-NOT: @some_function
41
- ; BOUNDS: call i64 @some_function
42
+ ; BOUNDS: call i64 @some_function
Original file line number Diff line number Diff line change 6
6
; for the 'development' mode.
7
7
;
8
8
; REQUIRES: have_tf_aot
9
+ ; REQUIRES: llvm_inliner_model_autogenerated
9
10
; RUN: opt -passes=scc-oz-module-inliner -enable-ml-inliner=release -S < %S/Inputs/test-module.ll 2>&1 | FileCheck %S/Inputs/test-module.ll --check-prefix=CHECK
10
11
; RUN: opt -passes=scc-oz-module-inliner -enable-ml-inliner=default -S < %S/Inputs/test-module.ll 2>&1 | FileCheck %S/Inputs/test-module.ll --check-prefix=DEFAULT
Original file line number Diff line number Diff line change @@ -254,6 +254,9 @@ def get_asan_rtlib():
254
254
if config .have_tf_api :
255
255
config .available_features .add ("have_tf_api" )
256
256
257
+ if config .llvm_inliner_model_autogenerated :
258
+ config .available_features .add ("llvm_inliner_model_autogenerated" )
259
+
257
260
def have_cxx_shared_library ():
258
261
readobj_exe = lit .util .which ('llvm-readobj' , config .llvm_tools_dir )
259
262
if not readobj_exe :
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ config.has_plugins = @LLVM_ENABLE_PLUGINS@
54
54
config.linked_bye_extension = @LLVM_BYE_LINK_INTO_TOOLS@
55
55
config.have_tf_aot = @LLVM_HAVE_TF_AOT@
56
56
config.have_tf_api = @LLVM_HAVE_TF_API@
57
+ config.llvm_inliner_model_autogenerated = @LLVM_INLINER_MODEL_AUTOGENERATED@
57
58
config.expensive_checks = @LLVM_ENABLE_EXPENSIVE_CHECKS@
58
59
59
60
# Support substitution of the tools_dir with user parameters. This is
You can’t perform that action at this time.
0 commit comments