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

Tobias Gysi llvmlistbot at llvm.org
Fri Jul 11 12:13:03 PDT 2025


================
@@ -1868,6 +1870,33 @@ LogicalResult ModuleTranslation::convertFunctions() {
   return success();
 }
 
+LogicalResult ModuleTranslation::convertIFuncs() {
+  for (auto op : getModuleBody(mlirModule).getOps<IFuncOp>()) {
+    llvm::Type *type = convertType(op.getIFuncType());
+    llvm::GlobalValue::LinkageTypes linkage =
+        convertLinkageToLLVM(op.getLinkage());
+    llvm::Constant *resolver;
+    if (auto *resolverFn = lookupFunction(op.getResolver())) {
+      resolver = dyn_cast<llvm::Constant>(resolverFn);
----------------
gysit wrote:

```suggestion
      resolver = cast<llvm::Constant>(resolverFn);
```
nit: I assume this could be a cast.

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


More information about the Mlir-commits mailing list