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

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 07:47:38 PDT 2026


================
@@ -975,14 +1010,13 @@ void MergeFunctions::mergeTwoFunctions(Function *F, Function *G) {
     // stop here and delete G. There's no need for a thunk. (See note on
     // MergeFunctionsPDI above).
     if (G->isDiscardableIfUnused() && G->use_empty() && !MergeFunctionsPDI) {
-      mergeEntryCountsInto(F, FEC, GEC);
+      mergeEntryCountsAndImportsInto(*F, *G);
       G->eraseFromParent();
       ++NumFunctionsMerged;
       return;
     }
 
-    if (writeThunkOrAliasIfNeeded(F, G)) {
-      mergeEntryCountsInto(F, FEC, GEC);
+    if (writeThunkOrAliasIfNeeded(F, G, /*MergeProfile*/ true)) {
----------------
teresajohnson wrote:

ditto

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


More information about the llvm-commits mailing list