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

Erick Ochoa Lopez llvmlistbot at llvm.org
Thu Aug 7 08:47:34 PDT 2025


================
@@ -1336,6 +1356,26 @@ func.func @maskedload_memref_mismatch(%base: memref<?xf32>, %mask: vector<16xi1>
 
 // -----
 
+//===----------------------------------------------------------------------===//
+// vector.maskedstore
+//===----------------------------------------------------------------------===//
+
+func.func @maskedstore_negative_alignment(%base: memref<4xi32>, %mask: vector<32xi1>, %value: vector<1xi32>, %index: index) {
+  // expected-error at below {{'vector.maskedstore' 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}}
+  vector.maskedstore %base[%index], %mask, %value { alignment = -1 } : memref<4xi32>, vector<32xi1>, vector<1xi32> into vector<1xi32>
+  return
+}
+
+// -----
+
+func.func @maskedstore_negative_alignment(%base: memref<4xi32>, %mask: vector<32xi1>, %value: vector<1xi32>, %index: index) {
----------------
amd-eochoalo wrote:

[Here](https://github.com/llvm/llvm-project/pull/151690/commits/577e6125e49e3dfb2aa7a9b269cf4778d87b3fc3) I changed the test's name to better reflect what is being tested. Thanks for pointing this out. I somehow missed it during the first round of reviews. I do see some value in having one test for negative and one test for the power of two, but I can definitely delete one if you insist.

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


More information about the Mlir-commits mailing list