@@ -549,22 +549,25 @@ struct Strategy<TransferWriteOp> {
549
549
};
550
550
551
551
template <typename OpTy>
552
- LogicalResult checkPrepareXferOp (OpTy xferOp,
553
- VectorTransferToSCFOptions options) {
552
+ static LogicalResult checkPrepareXferOp (OpTy xferOp, PatternRewriter &rewriter ,
553
+ VectorTransferToSCFOptions options) {
554
554
if (xferOp->hasAttr (kPassLabel ))
555
- return failure ( );
555
+ return rewriter. notifyMatchFailure (xferOp, " kPassLabel is present! " );
556
556
if (xferOp.getVectorType ().getRank () <= options.targetRank )
557
- return failure ();
558
- // Currently the unpacking of the leading dimension into the memref is not
559
- // supported for scalable dimensions.
557
+ return rewriter.notifyMatchFailure (
558
+ xferOp, " xferOp vector rank <= transformation target rank" );
560
559
if (xferOp.getVectorType ().getScalableDims ().front ())
561
- return failure ();
560
+ return rewriter.notifyMatchFailure (
561
+ xferOp, " Unpacking of the leading dimension into the memref is not yet "
562
+ " supported for scalable dims" );
562
563
if (isTensorOp (xferOp) && !options.lowerTensors )
563
- return failure ();
564
- // Transfer ops that modify the element type are not supported atm.
564
+ return rewriter. notifyMatchFailure (
565
+ xferOp, " Unpacking for tensors has been disabled. " );
565
566
if (xferOp.getVectorType ().getElementType () !=
566
567
xferOp.getShapedType ().getElementType ())
567
- return failure ();
568
+ return rewriter.notifyMatchFailure (
569
+ xferOp, " Mismatching source and destination element types." );
570
+
568
571
return success ();
569
572
}
570
573
@@ -597,8 +600,9 @@ struct PrepareTransferReadConversion
597
600
598
601
LogicalResult matchAndRewrite (TransferReadOp xferOp,
599
602
PatternRewriter &rewriter) const override {
600
- if (checkPrepareXferOp (xferOp, options).failed ())
601
- return failure ();
603
+ if (checkPrepareXferOp (xferOp, rewriter, options).failed ())
604
+ return rewriter.notifyMatchFailure (
605
+ xferOp, " checkPrepareXferOp conditions not met!" );
602
606
603
607
auto buffers = allocBuffers (rewriter, xferOp);
604
608
auto *newXfer = rewriter.clone (*xferOp.getOperation ());
@@ -646,8 +650,9 @@ struct PrepareTransferWriteConversion
646
650
647
651
LogicalResult matchAndRewrite (TransferWriteOp xferOp,
648
652
PatternRewriter &rewriter) const override {
649
- if (checkPrepareXferOp (xferOp, options).failed ())
650
- return failure ();
653
+ if (checkPrepareXferOp (xferOp, rewriter, options).failed ())
654
+ return rewriter.notifyMatchFailure (
655
+ xferOp, " checkPrepareXferOp conditions not met!" );
651
656
652
657
Location loc = xferOp.getLoc ();
653
658
auto buffers = allocBuffers (rewriter, xferOp);
@@ -1294,16 +1299,14 @@ struct UnrollTransferReadConversion
1294
1299
xferOp, " vector rank is less or equal to target rank" );
1295
1300
if (failed (checkLowerTensors (xferOp, rewriter)))
1296
1301
return failure ();
1297
- // Transfer ops that modify the element type are not supported atm.
1298
1302
if (xferOp.getVectorType ().getElementType () !=
1299
1303
xferOp.getShapedType ().getElementType ())
1300
1304
return rewriter.notifyMatchFailure (
1301
1305
xferOp, " not yet supported: element type mismatch" );
1302
1306
auto xferVecType = xferOp.getVectorType ();
1303
1307
if (xferVecType.getScalableDims ()[0 ]) {
1304
- // Cannot unroll a scalable dimension at compile time.
1305
1308
return rewriter.notifyMatchFailure (
1306
- xferOp, " scalable dimensions cannot be unrolled" );
1309
+ xferOp, " scalable dimensions cannot be unrolled at compile time " );
1307
1310
}
1308
1311
1309
1312
auto insertOp = getInsertOp (xferOp);
0 commit comments