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

donald chen llvmlistbot at llvm.org
Thu Sep 5 19:02:03 PDT 2024


cxy-1993 wrote:

> `getBody()->getTerminator()` is fine in a RewritePattern. Generally speaking, looking at the IR is fine in a RewritePattern because all IR changes 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.

Thanks for your explaination!

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


More information about the Mlir-commits mailing list