[Mlir-commits] [mlir] [mlir][vector] Add alignment attribute to `maskedload` and `maskedstore` (PR #151690)

Erick Ochoa Lopez llvmlistbot at llvm.org
Thu Aug 7 11:58:02 PDT 2025


================
@@ -1729,18 +1729,18 @@ def Vector_LoadOp : Vector_Op<"load", [
                    "Value":$base,
                    "ValueRange":$indices,
                    CArg<"bool", "false">:$nontemporal,
-                   CArg<"llvm::Align", "llvm::Align()">:$alignment), [{
+                   CArg<"llvm::MaybeAlign", "llvm::MaybeAlign()">:$alignment), [{
       return build($_builder, $_state, resultType, base, indices, nontemporal,
-                   alignment != llvm::Align() ? $_builder.getI64IntegerAttr(alignment.value()) :
+                   alignment != llvm::MaybeAlign() ? $_builder.getI64IntegerAttr(alignment.valueOrOne().value()) :
----------------
amd-eochoalo wrote:

Thanks @kuhar ! Using `has_value` is definitely better. I changed to adapt it to the following since `*alignment` will result in an instance of `llvm::Align` and not an an integer (which is required by `getI64IntegerAttr`).

```suggestion
                   alignment.has_value() ? $_builder.getI64IntegerAttr((*alignment).value()) :
```

https://github.com/llvm/llvm-project/pull/151690/commits/8b3a0fde6339bdf588cf797c6519051accb68dd4


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


More information about the Mlir-commits mailing list