[Mlir-commits] [mlir] [mlir][linalg] Document and diagnose pack/unpack memref limits (PR #225773)

Federico Bruzzone llvmlistbot at llvm.org
Fri Sep 25 03:21:33 PDT 2026


================

----------------
FedericoBruzzone wrote:

The difficulty is that many of the existing `pack`/`unpack` transformations rely on tensor-specific rewrites and transformations, such as `unpack(pack(x)) -> x`:
1. With tensors, these are straightforward because values are immutable. 
2. With memrefs, the equivalent transformations need to preserve buffer semantics, including aliasing, new reads/writes, and allocation/lifetime of temporaries.

So the issue is meant to document the current implementation invariant, rather than argue that memref support is fundamentally impossible. However, in the absence of a very _strong_ reason, I believe we should discourage this support.

---

That said, thank you for your POV @adam-smnk. Do you have any ideas on how the message could be improved? I'd be more than happy to edit it.


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


More information about the Mlir-commits mailing list