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

Jakub Kuderski llvmlistbot at llvm.org
Tue Jun 17 07:52:14 PDT 2025


kuhar wrote:

> Is it possible to build an analysis based on `memref.assume_alignment` instead of adding an alignment attribute to every load/store operation?

> Alignment is a property of the memref SSA value. But we don't encode it in the memref type.

I don't think this is the case. You can have a memref of `?xi8` that doesn't have any inherent static alignment and the alignment is really a property at each load/store op. You may end up with a memref of bytes as you lower and merge allocations etc. This is also the case with lower level IRs like llvm or spirv, e.g.: https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Memory_Operands.

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


More information about the Mlir-commits mailing list