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

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Jul 7 00:59:24 PDT 2025


================
@@ -1218,3 +1218,13 @@ func.func @step() {
   %1 = vector.step : vector<[4]xindex>
   return
 }
+
+// CHECK-LABEL: func @test_load_store_alignment
+func.func @test_load_store_alignment(%memref: memref<4xi32>) {
+  %c0 = arith.constant 0 : index
+  // CHECK: vector.load {{.*}} {alignment = 16 : i64}
+  %val = vector.load %memref[%c0] { alignment = 16 } : memref<4xi32>, vector<4xi32>
+  // CHECK: vector.store {{.*}} {alignment = 16 : i64}
+  vector.store %val, %memref[%c0] { alignment = 16 } : memref<4xi32>, vector<4xi32>
+  return
+}
----------------
banach-space wrote:

Please move this near other tests for `vector.store` + `vector.load`: https://github.com/llvm/llvm-project/blob/541f33e0751d60b33e75efe0cd436396f27b91ca/mlir/test/Dialect/Vector/ops.mlir#L757-L854

Thanks!

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


More information about the Mlir-commits mailing list