[Mlir-commits] [mlir] [mlir] [scf] fix crash when conversion from scf to control flow (PR #107221)

Matthias Springer llvmlistbot at llvm.org
Thu Sep 5 03:23:09 PDT 2024


matthias-springer wrote:

`getBody()->getTerminator()` is fine in a RewritePattern. Generally speaking, looking at the IR is fine in a RewritePattern because all IR change materialize immediately.

Using a RewritePattern in a dialect conversion (e.g., partial conversion) or using `getBody()->getTerminator()` in a `ConversionPattern` is dangerous because what you see may be outdated IR.

The `SCFToCF` patterns are RewritePatterns but they are used in a dialect conversion. That's the problem that I'm seeing.


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


More information about the Mlir-commits mailing list