[Mlir-commits] [mlir] [mlir][reducer] Refactor reduction-tree test (PR #184974)

lonely eagle llvmlistbot at llvm.org
Fri Mar 6 12:47:46 PST 2026


https://github.com/linuxlonelyeagle updated https://github.com/llvm/llvm-project/pull/184974

>From eeed77d786063a791efbd5c56e90e126bd243bb2 Mon Sep 17 00:00:00 2001
From: linuxlonelyeagle <2020382038 at qq.com>
Date: Fri, 6 Mar 2026 09:40:24 +0000
Subject: [PATCH] add reduction-tree.mlir file.

---
 mlir/test/mlir-reduce/crashop-reduction.mlir  | 20 ----------------
 ...iple-function.mlir => reduction-tree.mlir} | 23 ++++++++++++++++++-
 2 files changed, 22 insertions(+), 21 deletions(-)
 delete mode 100644 mlir/test/mlir-reduce/crashop-reduction.mlir
 rename mlir/test/mlir-reduce/{multiple-function.mlir => reduction-tree.mlir} (58%)

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