@@ -2929,27 +2929,32 @@ static bool haveCompatibleStrides(MemRefType t1, MemRefType t2,
2929
2929
}
2930
2930
2931
2931
static LogicalResult produceSubViewErrorMsg (SliceVerificationResult result,
2932
- Operation * op, Type expectedType) {
2932
+ SubViewOp op, Type expectedType) {
2933
2933
auto memrefType = llvm::cast<ShapedType>(expectedType);
2934
2934
switch (result) {
2935
2935
case SliceVerificationResult::Success:
2936
2936
return success ();
2937
2937
case SliceVerificationResult::RankTooLarge:
2938
2938
return op->emitError (" expected result rank to be smaller or equal to " )
2939
- << " the source rank. " ;
2939
+ << " the source rank, but got " << op. getType () ;
2940
2940
case SliceVerificationResult::SizeMismatch:
2941
2941
return op->emitError (" expected result type to be " )
2942
2942
<< 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 ();
2944
2945
case SliceVerificationResult::ElemTypeMismatch:
2945
2946
return op->emitError (" expected result element type to be " )
2946
- << memrefType.getElementType ();
2947
+ << memrefType.getElementType () << " , but got " << op. getType () ;
2947
2948
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 ();
2949
2952
case SliceVerificationResult::LayoutMismatch:
2950
2953
return op->emitError (" expected result type to be " )
2951
2954
<< 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 ();
2953
2958
}
2954
2959
llvm_unreachable (" unexpected subview verification result" );
2955
2960
}
0 commit comments