Skip to content

Commit

Permalink
[mlir][vector] Restore assert and fix typos (#68581)
Browse files Browse the repository at this point in the history
Follow-up for #68400 - restoring an assert that was accidentally removed
and fixed a typo in a diagnostic.
  • Loading branch information
banach-space authored Oct 9, 2023
1 parent 9050b27 commit e01c867
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ struct UnrolledOuterProductGenerator
return failure();

int reductionSize = lhsType.getDimSize(reductionDim);
assert(reductionSize > 0 &&
"Reduction dim must be a known static size to allow unrolling");

// Incremental support for masking.
if (mask && !maybeMask.has_value())
return failure();
Expand Down Expand Up @@ -997,15 +1000,15 @@ FailureOr<Value> ContractionOpLowering::lowerParallel(PatternRewriter &rewriter,
});
if (lhsType.getScalableDims()[lhsIndex])
return rewriter.notifyMatchFailure(op, [&](Diagnostic &diag) {
diag << "Unrolloing scalable dimension (lhsIndex=" << lhsIndex
diag << "Unrolling scalable dimension (lhsIndex=" << lhsIndex
<< ") is not supported yet";
});
dimSize = lhsType.getDimSize(lhsIndex);
} else if (rhsIndex >= 0) {
iterIndex = iMap[1].getDimPosition(rhsIndex);
if (rhsType.getScalableDims()[rhsIndex])
return rewriter.notifyMatchFailure(op, [&](Diagnostic &diag) {
diag << "Unrolloing scalable dimension (lhsIndex=" << lhsIndex
diag << "Unrolling scalable dimension (rhsIndex=" << rhsIndex
<< ") is not supported yet";
});
dimSize = rhsType.getDimSize(rhsIndex);
Expand Down

0 comments on commit e01c867

Please sign in to comment.