[llvm-branch-commits] [mlir] [MLIR] Stop visiting unreachable blocks in the walkAndApplyPatterns driver (PR #154038)

Jakub Kuderski via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Aug 17 17:17:42 PDT 2025


================
@@ -119,3 +119,18 @@ func.func @erase_nested_block() -> i32 {
   }): () -> (i32)
   return %a : i32
 }
+
+
+// CHECK-LABEL: func.func @unreachable_replace_with_new_op
+// CHECK: "test.new_op"
+// CHECK: "test.replace_with_new_op"
+func.func @unreachable_replace_with_new_op() {
+  "test.br"()[^bb1] : () -> ()
+^bb1:
+  %a = "test.replace_with_new_op"() : () -> (i32)
+  return
+^unreachable:
----------------
kuhar wrote:

Can you add a test case where we have to advance past an unreachable block?

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


More information about the llvm-branch-commits mailing list