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

Matthias Springer llvmlistbot at llvm.org
Wed Aug 6 03:03:25 PDT 2025


matthias-springer wrote:

> this is valid, we never access any out of bounds memory and there is no undefined behavior here.

That's why I asked [above](https://github.com/llvm/llvm-project/pull/152164#discussion_r2255087098) what your use case is.

The reason why I'm feeling uneasy about memrefs take run out-of-bounds is because we have operations such as `vector.transfer_read` that take a look at the size of a memref to determine if masking is needed. That will no longer work if `memref.subview` is allowed to produce a memref that runs out-of-bounds. What does it even mean for a memref to have a certain size if part of the memref points to invalid/unallocated memory? (In other words: why does the memref have a size?)


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


More information about the Mlir-commits mailing list