Skip to content

Commit 768a251

Browse files
stellaraccidentStella Laurenzo
authored andcommitted
[mlir] Tunnel LLVM_USE_LINKER through to the standalone example build.
When building in debug mode, the link time of the standalone sample is excessive, taking upwards of a minute if using BFD. This at least allows lld to be used if the main invocation was configured that way. On my machine, this gets a standalone test that requires a relink to run in ~13s for Debug mode. This is still a lot, but better than it was. I think we may want to do something about this test: it adds a lot of latency to a normal compile/test cycle and requires a bunch of arg fiddling to exclude. I think we may end up wanting a `check-mlir-heavy` target that can be used just prior to submit, and then make `check-mlir` just run unit/lite tests. More just thoughts for the future (none of that is done here). Reviewed By: bondhugula, mehdi_amini Differential Revision: https://reviews.llvm.org/D126585
1 parent 3b9707d commit 768a251

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

mlir/test/Examples/standalone/lit.local.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ config.substitutions.append(("%host_cc", config.host_cc))
1010
config.substitutions.append(("%enable_libcxx", config.enable_libcxx))
1111
config.substitutions.append(
1212
("%mlir_cmake_dir", config.mlir_cmake_dir))
13+
config.substitutions.append(("%llvm_use_linker", config.llvm_use_linker))

mlir/test/Examples/standalone/test.toy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# RUN: %cmake_exe %mlir_src_root/examples/standalone -G "%cmake_generator" -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc -DLLVM_ENABLE_LIBCXX=%enable_libcxx -DMLIR_DIR=%mlir_cmake_dir ; %cmake_exe --build . --target check-standalone | tee %t | FileCheck %s
1+
# RUN: %cmake_exe %mlir_src_root/examples/standalone -G "%cmake_generator" \
2+
# RUN: -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc \
3+
# RUN: -DLLVM_ENABLE_LIBCXX=%enable_libcxx -DMLIR_DIR=%mlir_cmake_dir \
4+
# RUN: -DLLVM_USE_LINKER=%llvm_use_linker
5+
# RUN: %cmake_exe --build . --target check-standalone | tee %t | FileCheck %s
26

37
# Note: The number of checked tests is not important. The command will fail
48
# if any fail.

mlir/test/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ config.host_cmake = "@CMAKE_COMMAND@"
2828
config.host_cmake_generator = "@CMAKE_GENERATOR@"
2929
# Note: ldflags can contain double-quoted paths, so must use single quotes here.
3030
config.host_ldflags = '@HOST_LDFLAGS@'
31+
config.llvm_use_linker = "@LLVM_USE_LINKER@"
3132
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
3233
config.llvm_host_triple = '@LLVM_HOST_TRIPLE@'
3334
config.host_arch = "@HOST_ARCH@"

0 commit comments

Comments
 (0)