Skip to content

[mlir][reduce] Separate scripts and tests into distinct directories#196005

Merged
linuxlonelyeagle merged 1 commit into
llvm:mainfrom
linuxlonelyeagle:separate-scripts-and-tests
May 7, 2026
Merged

[mlir][reduce] Separate scripts and tests into distinct directories#196005
linuxlonelyeagle merged 1 commit into
llvm:mainfrom
linuxlonelyeagle:separate-scripts-and-tests

Conversation

@linuxlonelyeagle
Copy link
Copy Markdown
Member

This PR reorganizes the mlir-reduce component by separating reduction scripts and their corresponding test cases into dedicated directories. Part of #195997.

@llvmorg-github-actions
Copy link
Copy Markdown

@llvm/pr-subscribers-mlir

Author: lonely eagle (linuxlonelyeagle)

Changes

This PR reorganizes the mlir-reduce component by separating reduction scripts and their corresponding test cases into dedicated directories. Part of #195997.


Full diff: https://github.com/llvm/llvm-project/pull/196005.diff

9 Files Affected:

  • (modified) mlir/test/mlir-reduce/opt-reduction/cse-test.mlir (+1-1)
  • (modified) mlir/test/mlir-reduce/opt-reduction/dce-test.mlir (+2-2)
  • (renamed) mlir/test/mlir-reduce/reduction-tree/invalid.mlir (+1-1)
  • (renamed) mlir/test/mlir-reduce/reduction-tree/reduction-tree.mlir (+1-1)
  • (renamed) mlir/test/mlir-reduce/reduction-tree/simple-test.mlir (+1-1)
  • (renamed) mlir/test/mlir-reduce/reduction-tree/single-function.mlir ()
  • (renamed) mlir/test/mlir-reduce/script/failure-test.sh ()
  • (renamed) mlir/test/mlir-reduce/script/false.sh ()
  • (renamed) mlir/test/mlir-reduce/script/true.sh ()
diff --git a/mlir/test/mlir-reduce/opt-reduction/cse-test.mlir b/mlir/test/mlir-reduce/opt-reduction/cse-test.mlir
index 33a3bd10637e0..e212f7e1022a5 100644
--- a/mlir/test/mlir-reduce/opt-reduction/cse-test.mlir
+++ b/mlir/test/mlir-reduce/opt-reduction/cse-test.mlir
@@ -1,5 +1,5 @@
 // UNSUPPORTED: system-windows
-// RUN: mlir-reduce %s --no-implicit-module -opt-reduction-pass='opt-pass=cse test=%S/../failure-test.sh' | FileCheck %s
+// RUN: mlir-reduce %s --no-implicit-module -opt-reduction-pass='opt-pass=cse test=%S/../script/failure-test.sh' | FileCheck %s
 
 // CHECK-LABEL: func @cse_on_func
 //  CHECK-SAME:   %[[ARG0:.*]]: i32,
diff --git a/mlir/test/mlir-reduce/opt-reduction/dce-test.mlir b/mlir/test/mlir-reduce/opt-reduction/dce-test.mlir
index c9f81fe8b1f20..93ce10ba651ad 100644
--- a/mlir/test/mlir-reduce/opt-reduction/dce-test.mlir
+++ b/mlir/test/mlir-reduce/opt-reduction/dce-test.mlir
@@ -1,6 +1,6 @@
 // UNSUPPORTED: system-windows
-// RUN: mlir-reduce %s -opt-reduction-pass='opt-pass=symbol-dce test=%S/../failure-test.sh' | FileCheck %s
-// RUN: mlir-reduce %s -opt-reduction-pass='opt-pass-file=%S/dce-pipeline test=%S/../failure-test.sh' | FileCheck %s  --check-prefix=CHECK-OPT-FILE
+// RUN: mlir-reduce %s -opt-reduction-pass='opt-pass=symbol-dce test=%S/../script/failure-test.sh' | FileCheck %s
+// RUN: mlir-reduce %s -opt-reduction-pass='opt-pass-file=%S/dce-pipeline test=%S/../script/failure-test.sh' | FileCheck %s  --check-prefix=CHECK-OPT-FILE
 // This input should be reduced by the pass pipeline so that only
 // the @simple1 function remains as the other functions should be
 // removed by the dead code elimination pass.
diff --git a/mlir/test/mlir-reduce/invalid.mlir b/mlir/test/mlir-reduce/reduction-tree/invalid.mlir
similarity index 84%
rename from mlir/test/mlir-reduce/invalid.mlir
rename to mlir/test/mlir-reduce/reduction-tree/invalid.mlir
index 43bcb68a32112..7e973520a657a 100644
--- a/mlir/test/mlir-reduce/invalid.mlir
+++ b/mlir/test/mlir-reduce/reduction-tree/invalid.mlir
@@ -1,6 +1,6 @@
 // UNSUPPORTED: system-windows
 // RUN: not mlir-reduce -reduction-tree --no-implicit-module %s 2>&1 | FileCheck %s --check-prefix=CHECK-TREE
-// RUN: not mlir-reduce -reduction-tree='traversal-mode=0 test=%S/false.sh' %s 2>&1 | FileCheck %s --check-prefix=CHECK-INTERESTING
+// RUN: not mlir-reduce -reduction-tree='traversal-mode=0 test=%S/../script/false.sh' %s 2>&1 | FileCheck %s --check-prefix=CHECK-INTERESTING
 
 // The reduction passes are currently restricted to 'builtin.module'.
 //        CHECK-TREE: error: top-level op must be 'builtin.module'
diff --git a/mlir/test/mlir-reduce/reduction-tree.mlir b/mlir/test/mlir-reduce/reduction-tree/reduction-tree.mlir
similarity index 95%
rename from mlir/test/mlir-reduce/reduction-tree.mlir
rename to mlir/test/mlir-reduce/reduction-tree/reduction-tree.mlir
index 2aee89741b42b..b235ca14d693a 100644
--- a/mlir/test/mlir-reduce/reduction-tree.mlir
+++ b/mlir/test/mlir-reduce/reduction-tree/reduction-tree.mlir
@@ -1,5 +1,5 @@
 // UNSUPPORTED: system-windows
-// RUN: mlir-reduce %s -split-input-file -reduction-tree='traversal-mode=0 test=%S/failure-test.sh' | FileCheck %s
+// RUN: mlir-reduce %s -split-input-file -reduction-tree='traversal-mode=0 test=%S/../script/failure-test.sh' | FileCheck %s
 // "test.op_crash_long" should be replaced with a shorter form "test.op_crash_short".
 
 // CHECK-NOT: func @simple1() {
diff --git a/mlir/test/mlir-reduce/simple-test.mlir b/mlir/test/mlir-reduce/reduction-tree/simple-test.mlir
similarity index 93%
rename from mlir/test/mlir-reduce/simple-test.mlir
rename to mlir/test/mlir-reduce/reduction-tree/simple-test.mlir
index 7d189db6a206a..c9c62fec28234 100644
--- a/mlir/test/mlir-reduce/simple-test.mlir
+++ b/mlir/test/mlir-reduce/reduction-tree/simple-test.mlir
@@ -1,5 +1,5 @@
 // UNSUPPORTED: system-windows
-// RUN: mlir-reduce %s -reduction-tree='traversal-mode=0 test=%S/true.sh' | FileCheck %s
+// RUN: mlir-reduce %s -reduction-tree='traversal-mode=0 test=%S/../script/true.sh' | FileCheck %s
 
 // Since the test.sh always returns 1 (interesting), 
 // all operations within the ModuleOp should be erased.
diff --git a/mlir/test/mlir-reduce/single-function.mlir b/mlir/test/mlir-reduce/reduction-tree/single-function.mlir
similarity index 100%
rename from mlir/test/mlir-reduce/single-function.mlir
rename to mlir/test/mlir-reduce/reduction-tree/single-function.mlir
diff --git a/mlir/test/mlir-reduce/failure-test.sh b/mlir/test/mlir-reduce/script/failure-test.sh
similarity index 100%
rename from mlir/test/mlir-reduce/failure-test.sh
rename to mlir/test/mlir-reduce/script/failure-test.sh
diff --git a/mlir/test/mlir-reduce/false.sh b/mlir/test/mlir-reduce/script/false.sh
similarity index 100%
rename from mlir/test/mlir-reduce/false.sh
rename to mlir/test/mlir-reduce/script/false.sh
diff --git a/mlir/test/mlir-reduce/true.sh b/mlir/test/mlir-reduce/script/true.sh
similarity index 100%
rename from mlir/test/mlir-reduce/true.sh
rename to mlir/test/mlir-reduce/script/true.sh

@linuxlonelyeagle linuxlonelyeagle merged commit 38bda74 into llvm:main May 7, 2026
12 checks passed
yebinchon pushed a commit to yebinchon/llvm-project that referenced this pull request May 7, 2026
…lvm#196005)

This PR reorganizes the mlir-reduce component by separating reduction
scripts and their corresponding test cases into dedicated directories.
Part of llvm#195997.
moar55 pushed a commit to moar55/llvm-project that referenced this pull request May 12, 2026
…lvm#196005)

This PR reorganizes the mlir-reduce component by separating reduction
scripts and their corresponding test cases into dedicated directories.
Part of llvm#195997.
pedroMVicente pushed a commit to pedroMVicente/llvm-project that referenced this pull request May 19, 2026
…lvm#196005)

This PR reorganizes the mlir-reduce component by separating reduction
scripts and their corresponding test cases into dedicated directories.
Part of llvm#195997.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants