[Mlir-commits] [mlir] [mlir][vector] `LoadOp`/`StoreOp`: Allow 0-D vectors (PR #76134)

Cullen Rhodes llvmlistbot at llvm.org
Thu Dec 21 00:57:37 PST 2023


================
@@ -714,6 +714,16 @@ func.func @flat_transpose_int(%arg0: vector<16xi32>) -> vector<16xi32> {
   return %0 : vector<16xi32>
 }
 
+// CHECK-LABEL: @vector_load_and_store_0d_scalar_memref
+func.func @vector_load_and_store_0d_scalar_memref(%memref : memref<200x100xf32>,
+                                                  %i : index, %j : index) {
+  // CHECK: %[[ld:.*]] = vector.load %{{.*}}[%{{.*}}] : memref<200x100xf32>, vector<f32>
+  %0 = vector.load %memref[%i, %j] : memref<200x100xf32>, vector<f32>
+  // CHECK: vector.store %[[ld]], %{{.*}}[%{{.*}}] : memref<200x100xf32>, vector<f32>
+  vector.store %0, %memref[%i, %j] : memref<200x100xf32>, vector<f32>
----------------
c-rhodes wrote:

unrelated to this change, but this reminded me the types are the wrong way round for `vector.store`

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


More information about the Mlir-commits mailing list