[Mlir-commits] [mlir] [mlir][vector] Add alignment attribute to vector operations. (PR #152507)

Erick Ochoa Lopez llvmlistbot at llvm.org
Fri Aug 15 05:19:21 PDT 2025


================
@@ -1919,7 +1922,6 @@ def Vector_MaskedLoadOp :
     load operation. It must be a positive power of 2. The operation must access
     memory at an address aligned to this boundary. Violations may lead to
     architecture-specific faults or performance penalties.
-    A value of 0 indicates no specific alignment requirement.
----------------
amd-eochoalo wrote:

Oh, you are right. `alignment = 0` was not supported in the Attribute due to the constraint.

Regarding next steps:

> Docs, i.e. this is no longer correct: "A value of 0 indicates no specific alignment requirement." 

This is fine, I'll remove this line.

> Tests (in invalid.mlir, lets check alignemt = 0).

I think just updating the ones that are `-1` to `0` would be enough.

> Predicates - can we update [this](https://github.com/llvm/llvm-project/blob/1945753700dc9e1ba526cc2078296518b7c93e8c/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td#L1724-L1725) with some alignment-specific predicate? ([VectorOfNonZeroRankOf](https://github.com/llvm/llvm-project/blob/1945753700dc9e1ba526cc2078296518b7c93e8c/mlir/include/mlir/IR/CommonTypeConstraints.td#L436-L438) is a nice example of a self-descriptive constraint).

Sure.

Sounds good! Thanks @banach-space 

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


More information about the Mlir-commits mailing list