@@ -2917,27 +2917,32 @@ static bool haveCompatibleStrides(MemRefType t1, MemRefType t2,
29172917}
29182918
29192919static LogicalResult produceSubViewErrorMsg (SliceVerificationResult result,
2920- Operation * op, Type expectedType) {
2920+ SubViewOp op, Type expectedType) {
29212921 auto memrefType = llvm::cast<ShapedType>(expectedType);
29222922 switch (result) {
29232923 case SliceVerificationResult::Success:
29242924 return success ();
29252925 case SliceVerificationResult::RankTooLarge:
29262926 return op->emitError (" expected result rank to be smaller or equal to " )
2927- << " the source rank. " ;
2927+ << " the source rank, but got: " << op. getType () ;
29282928 case SliceVerificationResult::SizeMismatch:
29292929 return op->emitError (" expected result type to be " )
29302930 << expectedType
2931- << " or a rank-reduced version. (mismatch of result sizes) " ;
2931+ << " or a rank-reduced version. (mismatch of result sizes), but got:"
2932+ << op.getType ();
29322933 case SliceVerificationResult::ElemTypeMismatch:
29332934 return op->emitError (" expected result element type to be " )
2934- << memrefType.getElementType ();
2935+ << memrefType.getElementType () << " , but got: " << op. getType () ;
29352936 case SliceVerificationResult::MemSpaceMismatch:
2936- return op->emitError (" expected result and source memory spaces to match." );
2937+ return op->emitError (
2938+ " expected result and source memory spaces to match, but got:" )
2939+ << op.getType ();
29372940 case SliceVerificationResult::LayoutMismatch:
29382941 return op->emitError (" expected result type to be " )
29392942 << expectedType
2940- << " or a rank-reduced version. (mismatch of result layout) " ;
2943+ << " or a rank-reduced version. (mismatch of result layout), but "
2944+ " got:"
2945+ << op.getType ();
29412946 }
29422947 llvm_unreachable (" unexpected subview verification result" );
29432948}
0 commit comments