[Mlir-commits] [mlir] [mlir][Transforms] Dialect conversion: Context-aware type conversions (PR #140434)
Matthias Springer
llvmlistbot at llvm.org
Tue May 20 01:54:25 PDT 2025
matthias-springer wrote:
> when a region-bearing op is converted today, the block is unlinked and "analyzing the defining op of an SSA value" crashes when the value is a block argument of the old block. To get around this I had to ensure the block arguments were remapped properly,
So at the point of time when the type converter is called, the block is already detached? I thought this happens after type conversion and after the replacement block has been added... How did you work around the issue exactly?
> In particular, if the pattern that processes arith.addi requires a precondition ensured by the pattern that processes affine.for (e.g., the attribute must be copied over), then this would be useful information to document.
Document where? This sounds to me not like a problem of the type converter, but the usual problem of discardable attributes getting dropped.
> we had to ensure all our patterns copied over the context attribute
Have you thought about turning your context attribute into a non-discardable attribute? Or wrapping SSA values in an `assume` op instead of attaching discardable attributes?
https://github.com/llvm/llvm-project/pull/140434
More information about the Mlir-commits
mailing list