[mlir][reduce] Separate scripts and tests into distinct directories#196005
Merged
linuxlonelyeagle merged 1 commit intoMay 7, 2026
Merged
Conversation
|
@llvm/pr-subscribers-mlir Author: lonely eagle (linuxlonelyeagle) ChangesThis 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:
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
|
j2kun
approved these changes
May 6, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR reorganizes the mlir-reduce component by separating reduction scripts and their corresponding test cases into dedicated directories. Part of #195997.