[Mlir-commits] [mlir] [mlir][vector] Add alignment attribute to `maskedload` and `maskedstore` (PR #151690)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Tue Aug 5 10:42:46 PDT 2025
banach-space wrote:
> One question I had was about making the tests identical between memref.{store,load} and vector.{store,load,maskedstore,maskedload}. They looked already as close as possible, so I am not sure what concretely was asked. I swapped the error at +1 to error at below and made the types more consistent. Please let me know more concretely what you had in mind and I would be happy to make the changes.
I should've been clearer, sorry. Note this "invalid" test for `vector.load`:
https://github.com/llvm/llvm-project/blob/23bcc239ac5730ef43815364ded12f2177502567/mlir/test/Dialect/Vector/invalid.mlir#L1913-L1920
vs what's added here for `vector.masked_load`:
```mlir
func.func @maskedload_negative_alignment(%base: memref<4xi32>, %mask: vector<32xi1>, %pass: vector<1xi32>, %index: index) {
// expected-error at below {{'vector.maskedload' op attribute 'alignment' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive and whose value is a power of two > 0}}
%val = vector.maskedload %base[%index], %mask, %pass { alignment = -1 } : memref<4xi32>, vector<32xi1>, vector<1xi32> into vector<1xi32>
return
}
// -----
func.func @maskedload_negative_alignment(%base: memref<4xi32>, %mask: vector<32xi1>, %pass: vector<1xi32>, %index: index) {
// expected-error at below {{'vector.maskedload' op attribute 'alignment' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive and whose value is a power of two > 0}}
%val = vector.maskedload %base[%index], %mask, %pass { alignment = 3 } : memref<4xi32>, vector<32xi1>, vector<1xi32> into vector<1xi32>
return
}
```
That's 1 case vs 2 :) It's not a big deal, so approving as is. Thanks for addressing my comments!
https://github.com/llvm/llvm-project/pull/151690
More information about the Mlir-commits
mailing list