diff --git a/mlir/lib/Target/LLVMIR/ModuleImport.cpp b/mlir/lib/Target/LLVMIR/ModuleImport.cpp --- a/mlir/lib/Target/LLVMIR/ModuleImport.cpp +++ b/mlir/lib/Target/LLVMIR/ModuleImport.cpp @@ -1118,12 +1118,11 @@ return root; } - if (isa(constant)) { - return emitError(loc) - << "blockaddress is not implemented in the LLVM dialect"; - } + StringRef error = ""; + if (isa(constant)) + error = " since blockaddress(...) is unsupported"; - return emitError(loc) << "unhandled constant: " << diag(*constant); + return emitError(loc) << "unhandled constant: " << diag(*constant) << error; } FailureOr ModuleImport::convertConstantExpr(llvm::Constant *constant) { diff --git a/mlir/test/Target/LLVMIR/Import/import-failure.ll b/mlir/test/Target/LLVMIR/Import/import-failure.ll --- a/mlir/test/Target/LLVMIR/Import/import-failure.ll +++ b/mlir/test/Target/LLVMIR/Import/import-failure.ll @@ -22,7 +22,7 @@ ; // ----- ; CHECK: import-failure.ll -; CHECK-SAME: error: blockaddress is not implemented in the LLVM dialect +; CHECK-SAME: unhandled constant: ptr blockaddress(@unhandled_constant, %bb1) since blockaddress(...) is unsupported ; CHECK: import-failure.ll ; CHECK-SAME: error: unhandled instruction: ret ptr blockaddress(@unhandled_constant, %bb1) define ptr @unhandled_constant() { @@ -34,7 +34,7 @@ ; // ----- ; CHECK: import-failure.ll -; CHECK-SAME: error: blockaddress is not implemented in the LLVM dialect +; CHECK-SAME: unhandled constant: ptr blockaddress(@unhandled_global, %bb1) since blockaddress(...) is unsupported ; CHECK: import-failure.ll ; CHECK-SAME: error: unhandled global variable: @private = private global ptr blockaddress(@unhandled_global, %bb1) @private = private global ptr blockaddress(@unhandled_global, %bb1)