[Mlir-commits] [mlir] [MLIR] [Vector] Linearization patterns for vector.load and vector.store (PR #145115)
James Newling
llvmlistbot at llvm.org
Mon Jun 23 11:47:11 PDT 2025
================
@@ -464,3 +464,26 @@ func.func @linearize_scalable_create_mask(%arg0 : index, %arg1 : index) -> vecto
%0 = vector.create_mask %arg0, %arg1 : vector<1x[16]xi1>
return %0 : vector<1x[16]xi1>
}
+
+// CHECK-LABEL: linearize_vector_load
+// CHECK-SAME: (%[[ARG0:.*]]: memref<1x4xf32>) -> vector<1x4xf32>
+func.func @linearize_vector_load(%arg0: memref<1x4xf32>) -> vector<1x4xf32> {
----------------
newling wrote:
```suggestion
func.func @linearize_vector_load(%arg0: memref<2x8xf32>) -> vector<1x4xf32> {
```
IMO it's good practice to not duplicate numbers which aren't explicitly tied, just to provide better coverage (for example someone in the future might use the shape from memref instead of the vector and this test would still pass...)
https://github.com/llvm/llvm-project/pull/145115
More information about the Mlir-commits
mailing list