[Mlir-commits] [mlir] [MLIR][LLVMIR] Import calls with mismatching signature as indirect call (PR #135895)

Bruno Cardoso Lopes llvmlistbot at llvm.org
Thu May 1 17:47:47 PDT 2025


================
@@ -362,9 +362,12 @@ class ModuleImport {
   /// Converts the callee's function type. For direct calls, it converts the
   /// actual function type, which may differ from the called operand type in
   /// variadic functions. For indirect calls, it converts the function type
-  /// associated with the call instruction. Returns failure when the call and
-  /// the callee are not compatible or when nested type conversions failed.
-  FailureOr<LLVMFunctionType> convertFunctionType(llvm::CallBase *callInst);
+  /// associated with the call instruction. When the call and the callee are not
+  /// compatible (or when nested type conversions failed), emit a warning but
+  /// attempt translation using a bitcast and an indirect call (in order
+  /// represent valid and verified LLVM IR).
+  FailureOr<LLVMFunctionType> convertFunctionType(llvm::CallBase *callInst,
+                                                  Value &castResult);
----------------
bcardosolopes wrote:

Good point, rewrote a good part of the comments and renamed it to `indirectCallVal`.

https://github.com/llvm/llvm-project/pull/135895


More information about the Mlir-commits mailing list