[Mlir-commits] [mlir] [mlir][Vector] Fix out-of-bounds crash unrolling create_mask/constant_mask with rank-mismatched native shape (PR #217514)
Aman Singh
llvmlistbot at llvm.org
Sat Sep 5 02:05:24 PDT 2026
================
@@ -127,6 +127,26 @@ getTargetShape(const vector::UnrollVectorOptions &options, Operation *op) {
return targetShape;
}
+/// Returns `targetShape` left-padded with unit dimensions so that it has the
+/// same rank as `originalShape`.
+///
+/// The native/target shape returned by `getTargetShape` is only required to
+/// divide the *trailing* dimensions of the op being unrolled (see
+/// `computeShapeRatio`), so it may have a smaller rank than the op itself.
+/// Tiling with the padded shape is equivalent - the leading dimensions are
+/// simply unrolled one element at a time - and keeps the offsets, sizes and
+/// strides rank-aligned with the op's vector type.
----------------
amanyagami wrote:
Applied in `c521ec4b` (trailing whitespace stripped from the suggestion).
https://github.com/llvm/llvm-project/pull/217514
More information about the Mlir-commits
mailing list