[Mlir-commits] [mlir] 768a251 - [mlir] Tunnel LLVM_USE_LINKER through to the standalone example build.

Stella Laurenzo llvmlistbot at llvm.org
Sun Jun 5 12:35:59 PDT 2022


Author: Stella Laurenzo
Date: 2022-06-05T12:31:41-07:00
New Revision: 768a251587e41e9298658b2bbcc5846e46580d77

URL: https://github.com/llvm/llvm-project/commit/768a251587e41e9298658b2bbcc5846e46580d77
DIFF: https://github.com/llvm/llvm-project/commit/768a251587e41e9298658b2bbcc5846e46580d77.diff

LOG: [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

Added: 
    

Modified: 
    mlir/test/Examples/standalone/lit.local.cfg
    mlir/test/Examples/standalone/test.toy
    mlir/test/lit.site.cfg.py.in

Removed: 
    


################################################################################
diff  --git a/mlir/test/Examples/standalone/lit.local.cfg b/mlir/test/Examples/standalone/lit.local.cfg
index 4331d0d3c82ef..cf7c8ff4d54f7 100644
--- a/mlir/test/Examples/standalone/lit.local.cfg
+++ b/mlir/test/Examples/standalone/lit.local.cfg
@@ -10,3 +10,4 @@ config.substitutions.append(("%host_cc", config.host_cc))
 config.substitutions.append(("%enable_libcxx", config.enable_libcxx))
 config.substitutions.append(
     ("%mlir_cmake_dir", config.mlir_cmake_dir))
+config.substitutions.append(("%llvm_use_linker", config.llvm_use_linker))

diff  --git a/mlir/test/Examples/standalone/test.toy b/mlir/test/Examples/standalone/test.toy
index 58a9400ed1548..0e2c16de27881 100644
--- a/mlir/test/Examples/standalone/test.toy
+++ b/mlir/test/Examples/standalone/test.toy
@@ -1,4 +1,8 @@
-# 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
+# RUN: %cmake_exe %mlir_src_root/examples/standalone -G "%cmake_generator" \
+# RUN: -DCMAKE_CXX_COMPILER=%host_cxx -DCMAKE_C_COMPILER=%host_cc \
+# RUN: -DLLVM_ENABLE_LIBCXX=%enable_libcxx -DMLIR_DIR=%mlir_cmake_dir \
+# RUN: -DLLVM_USE_LINKER=%llvm_use_linker
+# RUN: %cmake_exe --build . --target check-standalone | tee %t | FileCheck %s
 
 # Note: The number of checked tests is not important. The command will fail
 # if any fail.

diff  --git a/mlir/test/lit.site.cfg.py.in b/mlir/test/lit.site.cfg.py.in
index dbf457753be30..e4dea3b3c73d4 100644
--- a/mlir/test/lit.site.cfg.py.in
+++ b/mlir/test/lit.site.cfg.py.in
@@ -28,6 +28,7 @@ config.host_cmake = "@CMAKE_COMMAND@"
 config.host_cmake_generator = "@CMAKE_GENERATOR@"
 # Note: ldflags can contain double-quoted paths, so must use single quotes here.
 config.host_ldflags = '@HOST_LDFLAGS@'
+config.llvm_use_linker = "@LLVM_USE_LINKER@"
 config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
 config.llvm_host_triple = '@LLVM_HOST_TRIPLE@'
 config.host_arch = "@HOST_ARCH@"


        


More information about the Mlir-commits mailing list