[Mlir-commits] [mlir] [MLIR] Fix import of calls with mismatched variadic types (PR #124286)

Christian Ulmann llvmlistbot at llvm.org
Fri Jan 24 07:54:58 PST 2025


================
@@ -1593,23 +1600,21 @@ LogicalResult ModuleImport::convertInstruction(llvm::Instruction *inst) {
     return success();
   }
   if (inst->getOpcode() == llvm::Instruction::Call) {
-    auto *callInst = cast<llvm::CallInst>(inst);
+    auto callInst = cast<llvm::CallInst>(inst);
+    auto calledOperand = callInst->getCalledOperand();
 
     SmallVector<Type> types;
     SmallVector<Value> operands;
     if (failed(convertCallTypeAndOperands(callInst, types, operands,
                                           /*allowInlineAsm=*/true)))
       return failure();
 
-    auto funcTy =
-        dyn_cast<LLVMFunctionType>(convertType(callInst->getFunctionType()));
-    if (!funcTy)
-      return failure();
-
-    if (auto asmI = dyn_cast<llvm::InlineAsm>(callInst->getCalledOperand())) {
+    if (auto asmI = dyn_cast<llvm::InlineAsm>(calledOperand)) {
+      auto resultTy = convertType(callInst->getType());
----------------
Dinistro wrote:

```suggestion
      Type resultTy = convertType(callInst->getType());
```

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


More information about the Mlir-commits mailing list