[Mlir-commits] [mlir] [mlir][memref] Allow out-of-bounds semantics for memref.subview (PR #152164)

Matthias Springer llvmlistbot at llvm.org
Wed Aug 6 02:22:08 PDT 2025


matthias-springer wrote:

> My question is what do we mean by "compile-time"? Is it at any point in the pipeline (and therefore the behaviour recently added is "ok")? Or at egress (and then terms like canonicalization make more sense)?

I think I wrote that sentence. By "compile-time information" I meant "looking at the attributes + type of the memref.subview operation".

> What would be the case we'd want to have an out-of-bounds all constant indexing into a static shape to be valid?

I have asked myself the same question.

In the current design, whether an op is considered valid is different depending on whether it can be detected based on (a) looking at attributes and types or (b) looking at attributes, types, values and other operations. That situation being a bit odd is [one argument](https://discourse.llvm.org/t/out-of-bounds-semantics-of-memref-subview/85293/10). I didn't buy it at first because I was used to it (we have many MLIR ops that work like that), but I'm starting to warm up to the idea... Canonicalizers + folders will require fewer special cases.


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


More information about the Mlir-commits mailing list