[Mlir-commits] [mlir] [mlir][func] Avoid to create duplicate symbol during conversion (PR #192342)
Matthias Springer
llvmlistbot at llvm.org
Thu Apr 16 03:20:35 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
----------------
matthias-springer wrote:
There's already `auto func = lookupFuncOp(name, moduleOp, symbolTables);` in line 72. What additional checks are done here? Can this check be incorporated in the check above?
https://github.com/llvm/llvm-project/pull/192342
More information about the Mlir-commits
mailing list