Skip to content

Commit e01c867

Browse files
authored
[mlir][vector] Restore assert and fix typos (#68581)
Follow-up for #68400 - restoring an assert that was accidentally removed and fixed a typo in a diagnostic.
1 parent 9050b27 commit e01c867

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,9 @@ struct UnrolledOuterProductGenerator
432432
return failure();
433433

434434
int reductionSize = lhsType.getDimSize(reductionDim);
435+
assert(reductionSize > 0 &&
436+
"Reduction dim must be a known static size to allow unrolling");
437+
435438
// Incremental support for masking.
436439
if (mask && !maybeMask.has_value())
437440
return failure();
@@ -997,15 +1000,15 @@ FailureOr<Value> ContractionOpLowering::lowerParallel(PatternRewriter &rewriter,
9971000
});
9981001
if (lhsType.getScalableDims()[lhsIndex])
9991002
return rewriter.notifyMatchFailure(op, [&](Diagnostic &diag) {
1000-
diag << "Unrolloing scalable dimension (lhsIndex=" << lhsIndex
1003+
diag << "Unrolling scalable dimension (lhsIndex=" << lhsIndex
10011004
<< ") is not supported yet";
10021005
});
10031006
dimSize = lhsType.getDimSize(lhsIndex);
10041007
} else if (rhsIndex >= 0) {
10051008
iterIndex = iMap[1].getDimPosition(rhsIndex);
10061009
if (rhsType.getScalableDims()[rhsIndex])
10071010
return rewriter.notifyMatchFailure(op, [&](Diagnostic &diag) {
1008-
diag << "Unrolloing scalable dimension (lhsIndex=" << lhsIndex
1011+
diag << "Unrolling scalable dimension (rhsIndex=" << rhsIndex
10091012
<< ") is not supported yet";
10101013
});
10111014
dimSize = rhsType.getDimSize(rhsIndex);

0 commit comments

Comments
 (0)