@@ -1499,11 +1499,11 @@ vectorizeAsTensorPackOp(RewriterBase &rewriter, tensor::PackOp packOp,
1499
1499
// If the input vector sizes are not provided, then the vector sizes are
1500
1500
// determined by the result tensor shape. In case the vector sizes aren't
1501
1501
// provided, we update the inBounds attribute instead of masking.
1502
- bool useInBoundsInsteadOfMasking = true ;
1502
+ bool useInBoundsInsteadOfMasking = false ;
1503
1503
if (inputVectorSizes.empty ()) {
1504
1504
ArrayRef<int64_t > resultTensorShape = packOp.getDestType ().getShape ();
1505
1505
inputVectorSizes = resultTensorShape.take_front (packOp.getSourceRank ());
1506
- useInBoundsInsteadOfMasking = false ;
1506
+ useInBoundsInsteadOfMasking = true ;
1507
1507
}
1508
1508
1509
1509
// Create masked TransferReadOp.
@@ -1612,7 +1612,8 @@ vectorizeAsTensorUnpackOp(RewriterBase &rewriter, tensor::UnPackOp unpackOp,
1612
1612
// to shape of source, then a mask is necessary.
1613
1613
Value readResult = vector::createReadOrMaskedRead (
1614
1614
rewriter, loc, unpackOp.getSource (),
1615
- ArrayRef<int64_t >(readMaskShape.begin (), readMaskShape.end ()), padValue);
1615
+ ArrayRef<int64_t >(readMaskShape.begin (), readMaskShape.end ()), padValue,
1616
+ /* useInBoundsInsteadOfMasking=*/ false );
1616
1617
1617
1618
PackingMetadata packMetadata;
1618
1619
SmallVector<int64_t > lastDimToInsertPosPerm =
@@ -1669,7 +1670,8 @@ vectorizeAsTensorPadOp(RewriterBase &rewriter, tensor::PadOp padOp,
1669
1670
(void )status; // prevent unused variable warning on non-assert builds
1670
1671
assert (succeeded (status) && " failed to reify result shapes" );
1671
1672
auto maskedRead = vector::createReadOrMaskedRead (
1672
- rewriter, loc, padOp.getSource (), inputVectorSizes, padValue);
1673
+ rewriter, loc, padOp.getSource (), inputVectorSizes, padValue,
1674
+ /* useInBoundsInsteadOfMasking=*/ false );
1673
1675
Operation *write = createWriteOrMaskedWrite (
1674
1676
rewriter, loc, maskedRead, reifiedReturnShapes[0 ], inputVectorSizes);
1675
1677
newResults.push_back (write->getResult (0 ));
0 commit comments