[Mlir-commits] [mlir] [mlir][reducer] Make mlir-reduce don't delete terminator and use ub.poison to repalce op's results (PR #185445)

lonely eagle llvmlistbot at llvm.org
Mon Mar 9 08:57:10 PDT 2026


================
@@ -11,3 +15,11 @@ func.func @simple1(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
 ^bb3(%1: memref<2xf32>):
   return
 }
+// CHECK:   cf.cond_br %[[ARG0]], ^bb1, ^bb2
+// CHECK: ^bb1:
+// CHECK:   cf.br ^bb3(%[[ARG1]] : memref<2xf32>)
+// CHECK: ^bb2:
+// CHECK:   %[[POISON_0:.*]] = ub.poison : memref<2xf32>
+// CHECK:   cf.br ^bb3(%[[POISON_0]] : memref<2xf32>)
+// CHECK: ^bb3(%[[VAL_0:.*]]: memref<2xf32>):
+// CHECK:   return
----------------
linuxlonelyeagle wrote:

Note: The script(test.sh) used in simple-test.mlir always returns 'interesting'. Consequently, the reducer will attempt to remove as much IR as possible, eventually leaving only the most essential data structures.

https://github.com/llvm/llvm-project/pull/185445


More information about the Mlir-commits mailing list