[Mlir-commits] [mlir] [mlir][vector] Fold `in_bounds` for transfers with loop-derived indices (PR #215340)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Aug 17 09:40:42 PDT 2026


banach-space wrote:

Thank you for working on this!

> One alternative I'd rather have your read on than guess: doing this at creation, in createReadOrMaskedRead/createWriteOrMaskedWrite, the FIXMEs there say the computation "ignores the read/write indices", which is exactly this gap. That's once per created op instead of repeatedly under canonicalize, and it has in-tree consumers in both the Linalg vectorizer and -affine-super-vectorize. Better home than an opt-in pass, or worse?

In either case, I would make it an opt-in. Given the cost, a dedicated pass makes more sense to me. Would that allow us to address the FIXME?

Let me suggest something extremely different. We have effectively been walking away from `in_bounds` in favour of masking. Given SVE's solid HW support for predication, that's what we've been using instead. But even more broadly, I am not aware of `in_bounds` providing anything that masking wouldn't. So, instead of making the logic around `in_bounds` more complex, I'd rather see `in_bounds` completely removed and instead rely on masks. Would that work for you? Is this something you'd be available to look into?

In general, I have no objections for this PR. I am just not too fond on maintaining a rather niche thing for which we have a solid substitute. 

WDYT?

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


More information about the Mlir-commits mailing list