[Mlir-commits] [mlir] [MLIR][LLVMIR] Import calls with mismatching signature as indirect call (PR #135895)
Bruno Cardoso Lopes
llvmlistbot at llvm.org
Fri May 2 12:35:15 PDT 2025
================
@@ -1771,11 +1773,17 @@ ModuleImport::convertFunctionType(llvm::CallBase *callInst) {
if (failed(calleeType))
return failure();
- // Compare the types to avoid constructing illegal call/invoke operations.
- if (failed(verifyFunctionTypeCompatibility(*callType, *calleeType))) {
+ // Compare the types, if they are not compatible, avoid illegal call/invoke
+ // operations by issuing an indirect call. Note that LLVM IR currently
+ // supports this usage.
+ if (failed(checkFunctionTypeCompatibility(*callType, *calleeType))) {
Location loc = translateLoc(callInst->getDebugLoc());
- return emitError(loc) << "incompatible call and callee types: " << *callType
----------------
bcardosolopes wrote:
There is, the CHECK lines do not specifically check for `error`, so we got them for free. Let me add the `warning` part to make it more obvious.
https://github.com/llvm/llvm-project/pull/135895
More information about the Mlir-commits
mailing list