[Mlir-commits] [mlir] [mlir][vector][memref] Add `alignment` attribute to memory access ops (PR #144344)
Krzysztof Drewniak
llvmlistbot at llvm.org
Wed Jun 18 09:27:05 PDT 2025
krzysz00 wrote:
Two notes:
1. Currently, the lowerings of `vector.load` and `vector.store` to LLVM always assume that the pointer is aligned to the natural alignment of the vector _element_, not the vector. This is behavior users often want to override, either in general or on a case-by-case basis, and having an `alignment` attribute lets people do that
2. I think this'll be a good moment to clarify what `alignment` means for sub-byte types, since we have EmulateNarrowTypes. I'd argue that if the type in the memref has width < 8 bits, then `alignment` should be in units of the number of elements, not the number of bytes. That'll allow the narrow type emulator to use faster lowerings when you, for example, do a `vector.store %v, %m[[...], {alignment = 2 : index} : vector<2xi4>, memref<...xi4>`
https://github.com/llvm/llvm-project/pull/144344
More information about the Mlir-commits
mailing list