[Mlir-commits] [mlir] [mlir][func] Avoid to create duplicate symbol during conversion (PR #192342)

Krzysztof Drewniak llvmlistbot at llvm.org
Tue Apr 21 09:09:22 PDT 2026


================
@@ -87,6 +87,17 @@ mlir::LLVM::lookupOrCreateFn(OpBuilder &b, Operation *moduleOp, StringRef name,
     return func;
   }
 
+  // A symbol with this name may already exist as a non-LLVM function (e.g.,
+  // func::FuncOp from user code that hasn't been converted to LLVM dialect
+  // yet). Creating a new LLVMFuncOp with the same name would cause a symbol
+  // redefinition error. Return failure so the calling pattern can retry after
+  // the existing symbol is converted.
+  if (symbolTables
----------------
krzysz00 wrote:

I can see the argument for making that generalization, but I also think this in fine short-term.

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


More information about the Mlir-commits mailing list