[llvm] [MergeFunctions] Preserve import GUIDs when folding functions (PR #207003)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 14:46:30 PDT 2026


================
@@ -880,19 +881,35 @@ static bool isODR(const Function *F) {
   return F->hasWeakODRLinkage() || F->hasLinkOnceODRLinkage();
 }
 
-static void mergeEntryCountsInto(Function *F, std::optional<uint64_t> FC,
-                                 std::optional<uint64_t> GC) {
-  if (!FC && !GC)
+static DenseSet<GlobalValue::GUID> unionImportGUIDs(const Function *F,
----------------
mtrofin wrote:

if `F` and `G` aren't expected to be `nullptr`, pass them as const reference, as it better hints that contract

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


More information about the llvm-commits mailing list