[Mlir-commits] [mlir] [MLIR][Interface]: Verify index map ranks before composing loop bounds (PR #173434)
Stefan Weigl-Bosker
llvmlistbot at llvm.org
Fri Dec 26 18:17:44 PST 2025
sweiglbosker wrote:
> According to #173374, it crashed during the affineMap.compose operation. Perhaps you could take a look at why it crashed
>
> https://github.com/llvm/llvm-project/blob/42ea774aa6232926b07d27b3a1b6ac9f1f0e06a0/mlir/include/mlir/Interfaces/IndexingMapOpInterface.td#L141
This is what the pr fixes. we now check all the invariants before composing the loop, instead of after.
If you want an explanation for the crash there, it is because there is a rank 0 tensor, so there are non shape dims. Then when you compose the inverted map, which does reference a dim (`d0`) with this empty list of shape dims, none of the symbols are removed. Then `cast<AffineConstantExpr>` will fail because nothing has been substituted for `d0`, leading to the assertion failure.
https://github.com/llvm/llvm-project/pull/173434
More information about the Mlir-commits
mailing list