@@ -1499,11 +1499,11 @@ vectorizeAsTensorPackOp(RewriterBase &rewriter, tensor::PackOp packOp,
14991499 // If the input vector sizes are not provided, then the vector sizes are
15001500 // determined by the result tensor shape. In case the vector sizes aren't
15011501 // provided, we update the inBounds attribute instead of masking.
1502- bool useInBoundsInsteadOfMasking = true ;
1502+ bool useInBoundsInsteadOfMasking = false ;
15031503 if (inputVectorSizes.empty ()) {
15041504 ArrayRef<int64_t > resultTensorShape = packOp.getDestType ().getShape ();
15051505 inputVectorSizes = resultTensorShape.take_front (packOp.getSourceRank ());
1506- useInBoundsInsteadOfMasking = false ;
1506+ useInBoundsInsteadOfMasking = true ;
15071507 }
15081508
15091509 // Create masked TransferReadOp.
@@ -1612,7 +1612,8 @@ vectorizeAsTensorUnpackOp(RewriterBase &rewriter, tensor::UnPackOp unpackOp,
16121612 // to shape of source, then a mask is necessary.
16131613 Value readResult = vector::createReadOrMaskedRead (
16141614 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 );
16161617
16171618 PackingMetadata packMetadata;
16181619 SmallVector<int64_t > lastDimToInsertPosPerm =
@@ -1669,7 +1670,8 @@ vectorizeAsTensorPadOp(RewriterBase &rewriter, tensor::PadOp padOp,
16691670 (void )status; // prevent unused variable warning on non-assert builds
16701671 assert (succeeded (status) && " failed to reify result shapes" );
16711672 auto maskedRead = vector::createReadOrMaskedRead (
1672- rewriter, loc, padOp.getSource (), inputVectorSizes, padValue);
1673+ rewriter, loc, padOp.getSource (), inputVectorSizes, padValue,
1674+ /* useInBoundsInsteadOfMasking=*/ false );
16731675 Operation *write = createWriteOrMaskedWrite (
16741676 rewriter, loc, maskedRead, reifiedReturnShapes[0 ], inputVectorSizes);
16751677 newResults.push_back (write->getResult (0 ));
0 commit comments