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

Robert Konicar llvmlistbot at llvm.org
Fri Jul 11 06:15:37 PDT 2025


================
@@ -1601,6 +1605,42 @@ def LLVM_AliasOp : LLVM_Op<"mlir.alias",
   let hasRegionVerifier = 1;
 }
 
+def LLVM_IFuncOp : LLVM_Op<"mlir.ifunc",
+    [IsolatedFromAbove, Symbol, DeclareOpInterfaceMethods<SymbolUserOpInterface>]> {
+  let arguments = (ins
+    SymbolNameAttr:$sym_name,
+    TypeAttr:$i_func_type,
+    FlatSymbolRefAttr:$resolver,
+    TypeAttr:$resolver_type,
+    UnitAttr:$dso_local,
+    DefaultValuedAttr<ConfinedAttr<I32Attr, [IntNonNegative]>, "0">:$address_space,
+    DefaultValuedAttr<Linkage, "mlir::LLVM::Linkage::External">:$linkage,
----------------
Jezurko wrote:

Hm, I think I was mainly following what FuncOp and also what LLVM IR does.
I must have missed that Alias/Global Ops print it. I was looking at their parser and that allows for the missing linkage. I will change it so that the behaviour is the same as for Aliases/Globals.

I will also reorder the arguments to match the other operations.

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


More information about the Mlir-commits mailing list