[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:25 PDT 2026


================
@@ -1070,18 +1090,24 @@ struct UnrollCreateMaskPattern : public OpRewritePattern<vector::CreateMaskOp> {
 
     VectorType resultType = createMaskOp.getVectorType();
     SmallVector<int64_t> originalSize = *createMaskOp.getShapeForUnroll();
+    // The logic below assumes a 1-1 correspondence between the unroll shape and
+    // the op's mask operands, so pad the target shape with leading unit
+    // dimensions when it has a smaller rank than the op (as is done in
+    // `UnrollElementwisePattern`).
----------------
amanyagami wrote:

Applied in `c521ec4b`.

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


More information about the Mlir-commits mailing list