@@ -68,26 +68,28 @@ LogicalResult resolveAllTrueCreateMaskOp(IRRewriter &rewriter,
68
68
for (auto [i, dimSize] : unknownDims) {
69
69
// Compute the lower bound for the unknown dimension (i.e. the smallest
70
70
// value it could be).
71
- auto lowerBound =
71
+ FailureOr<ConstantOrScalableBound> dimLowerBound =
72
72
vector::ScalableValueBoundsConstraintSet::computeScalableBound (
73
73
dimSize, {}, vscaleRange.vscaleMin , vscaleRange.vscaleMax ,
74
74
presburger::BoundType::LB);
75
- if (failed (lowerBound ))
75
+ if (failed (dimLowerBound ))
76
76
return failure ();
77
- auto boundSize = lowerBound ->getSize ();
78
- if (failed (boundSize ))
77
+ auto dimLowerBoundSize = dimLowerBound ->getSize ();
78
+ if (failed (dimLowerBoundSize ))
79
79
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])
84
84
return failure ();
85
85
} 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.
88
88
if (maskTypeDimScalableFlags[i])
89
89
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])
91
93
return failure ();
92
94
}
93
95
}
0 commit comments