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

donald chen llvmlistbot at llvm.org
Wed Sep 4 18:38:01 PDT 2024


cxy-1993 wrote:

> `scf.parallel` should always have a terminator. Are you running the pass with invalid IR?
> 
> This is what the documentation says: `The body region must contain exactly one block that terminates with a scf.reduce operation. If an scf.parallel op has no reductions, the terminator has no operands and no regions.`

This is generally true, but core dumps can occur during the conversion process. For example, consider a scenario where we mix affine.parallel -> scf.parallel patterns with descending scf.parallel patterns and use partial conversion for dialect conversion: When descending from affine.parallel to scf.parallel, the deletion of affine.yield has not yet been committed, leading to a situation where the body terminator of scf.parallel is not an scf.reduce. In this case, we avoid such core dumps.

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


More information about the Mlir-commits mailing list