Skip to content

Commit 4b18617

Browse files
committed
Switch MLIR to use the internal LIT shell by default
This provides better error messages. See https://discourse.llvm.org/t/rfc-improving-lits-debug-output/72839/
1 parent a4a72bc commit 4b18617

File tree

11 files changed

+48
-41
lines changed

11 files changed

+48
-41
lines changed

mlir/test/Integration/Dialect/SparseTensor/CPU/dense_output.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
//--------------------------------------------------------------------------------------------------
1919

2020
// REDEFINE: %{env} = TENSOR0="%mlir_src_dir/test/Integration/data/test.mtx"
21-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
21+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2222
//
2323
// Do the same run, but now with direct IR generation.
2424
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false
25-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
25+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2626
//
2727
// Do the same run, but now with direct IR generation and vectorization.
2828
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true
29-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
29+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3030
//
3131
// Do the same run, but now with direct IR generation and VLA vectorization.
32-
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{env} %{run_sve} | FileCheck %s %}
32+
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | env %{env} %{run_sve} | FileCheck %s %}
3333

3434
!Filename = !llvm.ptr<i8>
3535

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_flatten.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
//--------------------------------------------------------------------------------------------------
1919

2020
// REDEFINE: %{env} = TENSOR0="%mlir_src_dir/test/Integration/data/test.tns"
21-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
21+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2222
//
2323
// Do the same run, but now with direct IR generation.
2424
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false
25-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
25+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2626
//
2727
// Do the same run, but now with direct IR generation and vectorization.
2828
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true
29-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
29+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3030
//
3131
// Do the same run, but now with direct IR generation and VLA vectorization.
32-
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{env} %{run_sve} | FileCheck %s %}
32+
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | env %{env} %{run_sve} | FileCheck %s %}
3333

3434
!Filename = !llvm.ptr<i8>
3535

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_matvec.mlir

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@
1818
//--------------------------------------------------------------------------------------------------
1919

2020
// REDEFINE: %{env} = TENSOR0="%mlir_src_dir/test/Integration/data/wide.mtx"
21-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
21+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2222
//
2323
// Do the same run, but now with direct IR generation.
2424
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false
25-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
25+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2626
//
2727
// Do the same run, but now with parallelization strategy.
2828
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=true parallelization-strategy=any-storage-any-loop
29-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
29+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3030
//
3131
// Do the same run, but now with direct IR generation and parallelization strategy.
3232
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false parallelization-strategy=any-storage-any-loop
33-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
33+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3434
//
3535
// Do the same run, but now with direct IR generation and vectorization.
3636
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true
37-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
37+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3838
//
3939
// Do the same run, but now with direct IR generation and, if available, VLA
4040
// vectorization.

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_mttkrp.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
//--------------------------------------------------------------------------------------------------
1919

2020
// REDEFINE: %{env} = TENSOR0=%mlir_src_dir/test/Integration/data/mttkrp_b.tns
21-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
21+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2222
//
2323
// Do the same run, but now with direct IR generation.
2424
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false
25-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
25+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2626
//
2727
// Do the same run, but now with direct IR generation and vectorization.
2828
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true
29-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
29+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3030
//
3131
// Do the same run, but now with direct IR generation and, if available, VLA
3232
// vectorization.
33-
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{env} %{run_sve} | FileCheck %s %}
33+
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | env %{env} %{run_sve} | FileCheck %s %}
3434

3535
!Filename = !llvm.ptr<i8>
3636

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_out_simple.mlir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
//--------------------------------------------------------------------------------------------------
1919

2020
// REDEFINE: %{env} = TENSOR0="%mlir_src_dir/test/Integration/data/test.mtx"
21-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
21+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2222
//
2323
// Do the same run, but now with direct IR generation and vectorization.
2424
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true
25-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
25+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2626
//
2727
// Do the same run, but now with direct IR generation and, if available, VLA
2828
// vectorization.
29-
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{env} %{run_sve} | FileCheck %s %}
29+
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | env %{env} %{run_sve} | FileCheck %s %}
3030

3131
!Filename = !llvm.ptr<i8>
3232

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sampled_matmul.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
//--------------------------------------------------------------------------------------------------
1919

2020
// REDEFINE: %{env} = TENSOR0="%mlir_src_dir/test/Integration/data/test.mtx"
21-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
21+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2222
//
2323
// Do the same run, but now with direct IR generation.
2424
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false
25-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
25+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2626
//
2727
// Do the same run, but now with direct IR generation and vectorization.
2828
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true
29-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
29+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3030
//
3131
// Do the same run, but now with direct IR generation and, if available, VLA
3232
// vectorization.
33-
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{env} %{run_sve} | FileCheck %s %}
33+
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | env %{env} %{run_sve} | FileCheck %s %}
3434

3535
!Filename = !llvm.ptr<i8>
3636

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sorted_coo.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919

2020
// REDEFINE: %{env} = TENSOR0="%mlir_src_dir/test/Integration/data/wide.mtx" \
2121
// REDEFINE: TENSOR1="%mlir_src_dir/test/Integration/data/mttkrp_b.tns"
22-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
22+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2323
//
2424
// Do the same run, but now with direct IR generation.
2525
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false enable-buffer-initialization=true
26-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
26+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2727
//
2828
// Do the same run, but now with vectorization.
2929
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false vl=4 enable-buffer-initialization=true
30-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
30+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3131
//
3232
// Do the same run, but now with VLA vectorization.
33-
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{env} %{run_sve} | FileCheck %s %}
33+
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | env %{env} %{run_sve} | FileCheck %s %}
3434

3535
!Filename = !llvm.ptr<i8>
3636

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_spmm.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
//--------------------------------------------------------------------------------------------------
1919

2020
// REDEFINE: %{env} = TENSOR0="%mlir_src_dir/test/Integration/data/wide.mtx"
21-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
21+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2222
//
2323
// Do the same run, but now with direct IR generation.
2424
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false
25-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
25+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2626
//
2727
// Do the same run, but now with vectorization.
2828
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true
29-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
29+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3030
//
3131
// Do the same run, but now with VLA vectorization.
32-
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{env} %{run_sve} | FileCheck %s %}
32+
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | env %{env} %{run_sve} | FileCheck %s %}
3333

3434
!Filename = !llvm.ptr<i8>
3535

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sum.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
//--------------------------------------------------------------------------------------------------
1919

2020
// REDEFINE: %{env} = TENSOR0=%mlir_src_dir/test/Integration/data/test_symmetric.mtx
21-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
21+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2222
//
2323
// Do the same run, but now with direct IR generation.
2424
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false
25-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
25+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2626
//
2727
// Do the same run, but now with vectorization.
2828
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true
29-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
29+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3030
//
3131
// Do the same run, but now with VLA vectorization.
32-
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{env} %{run_sve} | FileCheck %s %}
32+
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | env %{env} %{run_sve} | FileCheck %s %}
3333

3434
// TODO: The test currently only operates on the triangular part of the
3535
// symmetric matrix.

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sum_c32.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
//--------------------------------------------------------------------------------------------------
1919

2020
// REDEFINE: %{env} = TENSOR0="%mlir_src_dir/test/Integration/data/test_symmetric_complex.mtx"
21-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
21+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2222
//
2323
// Do the same run, but now with direct IR generation.
2424
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false
25-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
25+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
2626
//
2727
// Do the same run, but now with vectorization.
2828
// REDEFINE: %{sparse_compiler_opts} = enable-runtime-library=false vl=2 reassociate-fp-reductions=true enable-index-optimizations=true
29-
// RUN: %{compile} | %{env} %{run} | FileCheck %s
29+
// RUN: %{compile} | env %{env} %{run} | FileCheck %s
3030
//
3131
// Do the same run, but now with VLA vectorization.
32-
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | %{env} %{run_sve} | FileCheck %s %}
32+
// RUN: %if mlir_arm_sve_tests %{ %{compile_sve} | env %{env} %{run_sve} | FileCheck %s %}
3333

3434
// TODO: The test currently only operates on the triangular part of the
3535
// symmetric matrix.

mlir/test/lit.cfg.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@
1818
# name: The name of this test suite.
1919
config.name = "MLIR"
2020

21-
config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
21+
# We prefer the lit internal shell which provide a better user experience on failures
22+
# Unless the user explicitly disable it with LIT_USE_INTERNAL_SHELL=0 env var.
23+
use_lit_shell = True
24+
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
25+
if lit_shell_env:
26+
use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)
27+
28+
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
2229

2330
# suffixes: A list of file extensions to treat as test files.
2431
config.suffixes = [

0 commit comments

Comments
 (0)