[Mlir-commits] [mlir] [mlir][vector] Always print the in_bounds attribute (PR #96031)

Diego Caballero llvmlistbot at llvm.org
Mon Jun 24 10:06:29 PDT 2024


dcaballe wrote:

> I am afraid that both would be more intrusive with various implications.

I think this is a case where implementation "convenience" made its way to the representation itself: IIRC, xfer ops are created without any `in_bounds` attribute and there is a later step in which this attribute is inferred for all the dimensions. 

> right now the default is "no attribute", which is treated as "in bounds"

Really? Wow, that's really wrong! We can't assume that accesses are in-bounds by default. That would lead to correctness issues... Do you have a pointer to code where this assumption is made?

>  I think always displaying it when it presents is an improvement.

I'm not sure since that's making the issue even more explicit. I don't see a way to make this better that by making the attribute mandatory. With the printing change we might be able to test something a bit better but the underlying situation is concerning. Perhaps a good course of action would be to: 1) fix no-attribute == in-bounds assumption (this would let you test what you want without making the default printing explicit) and, 2) make the attribute mandatory, with default value set to `false`. Hopefully # 1 is easy to achieve and unblocks the testing. Then we can take more time to address # 2.

Would that work?



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


More information about the Mlir-commits mailing list