[Mlir-commits] [mlir] 3d7b22e - [mlir][reducer] Refactor reduction-tree test (#184974)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Mar 6 20:32:52 PST 2026
Author: lonely eagle
Date: 2026-03-07T12:32:48+08:00
New Revision: 3d7b22e00d95ea66e61b5acbe9be6b1e1e57d6b7
URL: https://github.com/llvm/llvm-project/commit/3d7b22e00d95ea66e61b5acbe9be6b1e1e57d6b7
DIFF: https://github.com/llvm/llvm-project/commit/3d7b22e00d95ea66e61b5acbe9be6b1e1e57d6b7.diff
LOG: [mlir][reducer] Refactor reduction-tree test (#184974)
Consolidate reduction-tree pass tests into a single file using
mlir-reduce's -split-input-file feature. See
https://github.com/llvm/llvm-project/pull/184970.
Added:
mlir/test/mlir-reduce/reduction-tree.mlir
Modified:
Removed:
mlir/test/mlir-reduce/crashop-reduction.mlir
mlir/test/mlir-reduce/multiple-function.mlir
################################################################################
diff --git a/mlir/test/mlir-reduce/crashop-reduction.mlir b/mlir/test/mlir-reduce/crashop-reduction.mlir
deleted file mode 100644
index b7b2b4e6897a0..0000000000000
--- a/mlir/test/mlir-reduce/crashop-reduction.mlir
+++ /dev/null
@@ -1,20 +0,0 @@
-// UNSUPPORTED: system-windows
-// RUN: mlir-reduce %s -reduction-tree='traversal-mode=0 test=%S/failure-test.sh' | FileCheck %s
-// "test.op_crash_long" should be replaced with a shorter form "test.op_crash_short".
-
-// CHECK-NOT: func @simple1() {
-func.func @simple1() {
- return
-}
-
-// CHECK-LABEL: func @simple2(%arg0: i32, %arg1: i32, %arg2: i32) {
-func.func @simple2(%arg0: i32, %arg1: i32, %arg2: i32) {
- // CHECK-LABEL: %0 = "test.op_crash_short"() : () -> i32
- %0 = "test.op_crash_long" (%arg0, %arg1, %arg2) : (i32, i32, i32) -> i32
- return
-}
-
-// CHECK-NOT: func @simple5() {
-func.func @simple5() {
- return
-}
diff --git a/mlir/test/mlir-reduce/multiple-function.mlir b/mlir/test/mlir-reduce/reduction-tree.mlir
similarity index 58%
rename from mlir/test/mlir-reduce/multiple-function.mlir
rename to mlir/test/mlir-reduce/reduction-tree.mlir
index 7c7b505146995..2aee89741b42b 100644
--- a/mlir/test/mlir-reduce/multiple-function.mlir
+++ b/mlir/test/mlir-reduce/reduction-tree.mlir
@@ -1,5 +1,26 @@
// UNSUPPORTED: system-windows
-// RUN: mlir-reduce %s -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/failure-test.sh' | FileCheck %s
+// "test.op_crash_long" should be replaced with a shorter form "test.op_crash_short".
+
+// CHECK-NOT: func @simple1() {
+func.func @simple1() {
+ return
+}
+
+// CHECK-LABEL: func @simple2(%arg0: i32, %arg1: i32, %arg2: i32) {
+func.func @simple2(%arg0: i32, %arg1: i32, %arg2: i32) {
+ // CHECK-LABEL: %0 = "test.op_crash_short"() : () -> i32
+ %0 = "test.op_crash_long" (%arg0, %arg1, %arg2) : (i32, i32, i32) -> i32
+ return
+}
+
+// CHECK-NOT: func @simple5() {
+func.func @simple5() {
+ return
+}
+
+// -----
+
// This input should be reduced by the pass pipeline so that only
// the @simple5 function remains as this is the shortest function
// containing the interesting behavior.
More information about the Mlir-commits
mailing list