[Mlir-commits] [mlir] [mlir][vector][memref] Add `alignment` attribute to memory access ops (PR #144344)

Lily Orth-Smith llvmlistbot at llvm.org
Tue Jun 24 10:46:02 PDT 2025


electriclilies wrote:

Hi! Author of https://github.com/llvm/llvm-project/pull/137389 here :)

Yes, it was a workaround-- we were getting perf issues from vectors being aligned to scalar alignments. I think an `alignment` attribute is a better long term solution, and I'm all for getting rid of the `--convert-vector-to-llvm='use-vector-alignment=1` as long as we're still able to set vector alignments properly. Also, we do have use cases for setting the alignment higher up in the stack, for example during memory planning.

One concern I have with using memref ops for this is that they exist in so many different places in the stack. I could see this becoming messy-- let's say I have a memory planner which tries to pick some alignments, then everything gets lowered into LLVMIR, and then LLVM passes also try to set alignment. It's not clear to me if we should let lower level passes "override" alignment set by higher level passes, or vice versa. And this gets complicated as we interleave default llvm passes with custom ones. It might be worthwhile to expose an interface to let users override how default passes set alignment without making an upstream change. Just something to think about as you start implementing logic to set the alignments.


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


More information about the Mlir-commits mailing list