File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
lib/Conversion/StructuredToMemref Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -852,7 +852,8 @@ struct LoadConverter : public OpConversionPattern<tts::LoadOp> {
852
852
// gatherMaskDim to guard the load.
853
853
if (auto gatherMaskDimIndex = getIntAttr (gatherMaskDim)) {
854
854
// If the gather mask dimension is a constant, we can use it directly.
855
- offsetSize = gatherMaskDimIndex.value ();
855
+ unsigned gatherMaskDimValue = gatherMaskDimIndex.value ();
856
+ offsetSize = std::min (offsetSize, gatherMaskDimValue);
856
857
}
857
858
}
858
859
auto upperBound = rewriter.create <arith::ConstantIndexOp>(loc, offsetSize);
@@ -1006,7 +1007,8 @@ struct StoreConverter : public OpConversionPattern<tts::StoreOp> {
1006
1007
// gatherMaskDim to guard the load.
1007
1008
if (auto gatherMaskDimIndex = getIntAttr (gatherMaskDim)) {
1008
1009
// If the gather mask dimension is a constant, we can use it directly.
1009
- offsetSize = gatherMaskDimIndex.value ();
1010
+ unsigned gatherMaskDimValue = gatherMaskDimIndex.value ();
1011
+ offsetSize = std::min (offsetSize, gatherMaskDimValue);
1010
1012
}
1011
1013
}
1012
1014
auto upperBound = rewriter.create <arith::ConstantIndexOp>(loc, offsetSize);
You can’t perform that action at this time.
0 commit comments