[Mlir-commits] [mlir] [mlir] Fix non-termination when a block becomes unreachable during rewriting (PR #221152)

Matthias Springer llvmlistbot at llvm.org
Sat Sep 5 08:32:04 PDT 2026


https://github.com/matthias-springer commented:

This does not look a problem with a greedy pattern driver to me.

There is a problem in `simplifyBrToBlockWithSinglePred`. It produces self-referencing IR:
```
%0 = arith.addi %0, %c1_i32 : i32
```

Such IR is invalid outside of a graph region, so the canonicalization should not apply.

After producing the invalid IR, the `AddIAddConstant` canonicalization pattern gets into an infinite loop, which is yet another problem.

I would try to fix `simplifyBrToBlockWithSinglePred`.


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


More information about the Mlir-commits mailing list