Skip to content

Commit 272f375

Browse files
committed
Review fixups
1 parent 2a46627 commit 272f375

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,26 +68,28 @@ LogicalResult resolveAllTrueCreateMaskOp(IRRewriter &rewriter,
6868
for (auto [i, dimSize] : unknownDims) {
6969
// Compute the lower bound for the unknown dimension (i.e. the smallest
7070
// value it could be).
71-
auto lowerBound =
71+
FailureOr<ConstantOrScalableBound> dimLowerBound =
7272
vector::ScalableValueBoundsConstraintSet::computeScalableBound(
7373
dimSize, {}, vscaleRange.vscaleMin, vscaleRange.vscaleMax,
7474
presburger::BoundType::LB);
75-
if (failed(lowerBound))
75+
if (failed(dimLowerBound))
7676
return failure();
77-
auto boundSize = lowerBound->getSize();
78-
if (failed(boundSize))
77+
auto dimLowerBoundSize = dimLowerBound->getSize();
78+
if (failed(dimLowerBoundSize))
7979
return failure();
80-
if (boundSize->scalable) {
81-
// If the lower bound is scalable and >= to the mask dim size then this
82-
// dim is all-true.
83-
if (boundSize->baseSize < maskTypeDimSizes[i])
80+
if (dimLowerBoundSize->scalable) {
81+
// If the lower bound is scalable and < the mask dim size then this dim is
82+
// not all-true.
83+
if (dimLowerBoundSize->baseSize < maskTypeDimSizes[i])
8484
return failure();
8585
} else {
86-
// If the lower bound is a constant and >= to the _fixed-size_ mask dim
87-
// size then this dim is all-true.
86+
// If the lower bound is a constant:
87+
// - If the mask dim size is scalable then this dim is not all-true.
8888
if (maskTypeDimScalableFlags[i])
8989
return failure();
90-
if (boundSize->baseSize < maskTypeDimSizes[i])
90+
// - If the lower bound is < the _fixed-size_ mask dim size then this dim
91+
// is not all-true.
92+
if (dimLowerBoundSize->baseSize < maskTypeDimSizes[i])
9193
return failure();
9294
}
9395
}

0 commit comments

Comments
 (0)