[Mlir-commits] [mlir] [mlir][vector] Add a check to ensure input vector rank equals target shape rank (PR #149239)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Wed Jul 23 08:57:56 PDT 2025
================
@@ -365,3 +365,19 @@ func.func @vector_gather_unroll(%mem : memref<?x?x?xf32>,
%res = vector.gather %mem[%c0, %c0, %c0] [%indices], %mask, %pass_thru : memref<?x?x?xf32>, vector<6x4xindex>, vector<6x4xi1>, vector<6x4xf32> into vector<6x4xf32>
return %res : vector<6x4xf32>
}
+
+// -----
+
+// Ensure that cases with mismatched target and source
+// shape ranks do not lead to a crash.
+
+// CHECK-LABEL: func @negative_vector_transfer_write
+// CHECK-NOT: vector.extract_strided_slice
+// CHECK: vector.transfer_write
+// CHECK: return
+func.func @negative_vector_transfer_write(%arg0: vector<6x34x62xi8>) {
----------------
banach-space wrote:
Please use more descriptive var names. Also, perhaps move this closer to other tests for `vector.transfer_write`?
```suggestion
func.func @negative_vector_transfer_write(%vec: vector<6x34x62xi8>) {
```
https://github.com/llvm/llvm-project/pull/149239
More information about the Mlir-commits
mailing list