diff --git a/mlir/lib/Parser/Parser.cpp b/mlir/lib/Parser/Parser.cpp index e274012160b7..deec877fae53 100644 --- a/mlir/lib/Parser/Parser.cpp +++ b/mlir/lib/Parser/Parser.cpp @@ -2638,7 +2638,9 @@ Value *OperationParser::resolveSSAUse(SSAUseInfo useInfo, Type type) { return result; emitError(useInfo.loc, "use of value '") - .append(useInfo.name, "' expects different type than prior uses") + .append(useInfo.name, + "' expects different type than prior uses: ", type, " vs ", + result->getType()) .attachNote(getEncodedSourceLocation(entries[useInfo.number].second)) .append("prior use here"); return nullptr; diff --git a/mlir/test/IR/invalid.mlir b/mlir/test/IR/invalid.mlir index 770f2da281fd..66ba6c51d572 100644 --- a/mlir/test/IR/invalid.mlir +++ b/mlir/test/IR/invalid.mlir @@ -366,7 +366,7 @@ func @vectors(vector<1 x vector<1xi32>>, vector<2x4xf32>) func @condbr_notbool() { ^bb0: %a = "foo"() : () -> i32 // expected-note {{prior use here}} - cond_br %a, ^bb0, ^bb0 // expected-error {{use of value '%a' expects different type than prior uses}} + cond_br %a, ^bb0, ^bb0 // expected-error {{use of value '%a' expects different type than prior uses: 'i1' vs 'i32'}} // expected-error@-1 {{expected condition type was boolean (i1)}} }