[Mlir-commits] [mlir] [mlir][vector] Add a check to ensure input vector rank equals target shape rank (PR #149239)
Longsheng Mou
llvmlistbot at llvm.org
Wed Jul 23 18:30:47 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.
----------------
CoTinker wrote:
The target shape in `test-vector-transfer-unrolling-patterns` is always [2, 2].
https://github.com/llvm/llvm-project/blob/2238365a6589fcdb196c850520585a8ec466e09c/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp#L263
https://github.com/llvm/llvm-project/pull/149239
More information about the Mlir-commits
mailing list