@@ -2929,27 +2929,32 @@ static bool haveCompatibleStrides(MemRefType t1, MemRefType t2,
29292929}
29302930
29312931static LogicalResult produceSubViewErrorMsg (SliceVerificationResult result,
2932- Operation * op, Type expectedType) {
2932+ SubViewOp op, Type expectedType) {
29332933 auto memrefType = llvm::cast<ShapedType>(expectedType);
29342934 switch (result) {
29352935 case SliceVerificationResult::Success:
29362936 return success ();
29372937 case SliceVerificationResult::RankTooLarge:
29382938 return op->emitError (" expected result rank to be smaller or equal to " )
2939- << " the source rank. " ;
2939+ << " the source rank, but got " << op. getType () ;
29402940 case SliceVerificationResult::SizeMismatch:
29412941 return op->emitError (" expected result type to be " )
29422942 << expectedType
2943- << " or a rank-reduced version. (mismatch of result sizes) " ;
2943+ << " or a rank-reduced version. (mismatch of result sizes), but got "
2944+ << op.getType ();
29442945 case SliceVerificationResult::ElemTypeMismatch:
29452946 return op->emitError (" expected result element type to be " )
2946- << memrefType.getElementType ();
2947+ << memrefType.getElementType () << " , but got " << op. getType () ;
29472948 case SliceVerificationResult::MemSpaceMismatch:
2948- return op->emitError (" expected result and source memory spaces to match." );
2949+ return op->emitError (
2950+ " expected result and source memory spaces to match, but got " )
2951+ << op.getType ();
29492952 case SliceVerificationResult::LayoutMismatch:
29502953 return op->emitError (" expected result type to be " )
29512954 << expectedType
2952- << " or a rank-reduced version. (mismatch of result layout) " ;
2955+ << " or a rank-reduced version. (mismatch of result layout), but "
2956+ " got "
2957+ << op.getType ();
29532958 }
29542959 llvm_unreachable (" unexpected subview verification result" );
29552960}
0 commit comments