Skip to content

Commit 06d4ab2

Browse files
committed
Add check to ensure input vector rank equals target shape rank
1 parent 60f3fdd commit 06d4ab2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,8 @@ struct UnrollElementwisePattern : public RewritePattern {
437437
auto dstVecType = cast<VectorType>(op->getResult(0).getType());
438438
SmallVector<int64_t> originalSize =
439439
*cast<VectorUnrollOpInterface>(op).getShapeForUnroll();
440+
if (originalSize.size() != targetShape->size())
441+
return failure();
440442
Location loc = op->getLoc();
441443
// Prepare the result vector.
442444
Value result = rewriter.create<arith::ConstantOp>(

0 commit comments

Comments
 (0)