[Mlir-commits] [mlir] [mlir][vector] Don't fold in_bounds for negative constant indices (PR #219681)
Dhairyashil R G
llvmlistbot at llvm.org
Mon Aug 31 09:22:08 PDT 2026
dhairyashilRG wrote:
@alepot55 Thanks, all of this checks out. The `kDynamic` point is worth having in the code and not just here: the comment I added explains why the subtraction is written this way rather than as `index + vectorSize <= sourceSize`, but it does not say that the operand is safe only because of the `isDynamicDim` return fifteen lines up. I will add that.
I would rather not share the guards. This PR and #215340 are deliberately independent, and a helper would have to cross from the dialect library into transforms, which forces a merge order on two patches that currently have none. It also costs #215340 the purely-additive shape that answered the compile-time objection there.
The comments pointing at each other I do want, but `VectorInferInBounds.cpp` does not exist upstream and #215340 is not approved, so that reference would dangle today. Whichever of the two lands second adds both.
On `maxStart < 0`: in the pass that bail is a cost guard rather than a correctness one, since it skips a `ValueBoundsConstraintSet` query that cannot succeed. Here the check is two integer tests, so there is nothing to skip. I will say that there rather than make the two match.
The comment-only changes will go in with the next revision.
https://github.com/llvm/llvm-project/pull/219681
More information about the Mlir-commits
mailing list