[Mlir-commits] [mlir] [mlir][LLVMIR] Add IFuncOp to LLVM dialect (PR #147697)

Robert Konicar llvmlistbot at llvm.org
Fri Jul 11 06:28:03 PDT 2025


================
@@ -422,9 +422,18 @@ convertOperationImpl(Operation &opInst, llvm::IRBuilderBase &builder,
     ArrayRef<llvm::Value *> operandsRef(operands);
     llvm::CallInst *call;
     if (auto attr = callOp.getCalleeAttr()) {
-      call =
-          builder.CreateCall(moduleTranslation.lookupFunction(attr.getValue()),
-                             operandsRef, opBundles);
+      if (llvm::Function *function =
+              moduleTranslation.lookupFunction(attr.getValue())) {
+        call = builder.CreateCall(function, operandsRef, opBundles);
+      } else {
+        Operation *module = parentLLVMModule(&opInst);
----------------
Jezurko wrote:

I don't think even the AddressOfOp versions are used anywhere else, so based on that precedent it would make sense to add it to the CallOp.
I also just noticed that dsoLocalEquivalentOp also has similar helpers, so adding it for consistency makes sense.
Not 100 % sure if I should introduce the change in this PR though?

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


More information about the Mlir-commits mailing list