[llvm] [MemProf] Make sure call clones without callsite node clones get updated (PR #159861)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 25 10:53:05 PDT 2025
================
@@ -5047,6 +5132,25 @@ bool CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::assignFunctions() {
// Update all the matching calls as well.
for (auto &Call : Node->MatchingCalls)
updateCall(Call, CalleeFunc);
+
+ // Now update all calls recorded earlier that are still in function clones
+ // which don't have a clone of this callsite node.
+ if (!UnassignedCallClones.contains(Node))
+ return;
+ DenseSet<unsigned> NodeCallClones;
+ for (auto *C : Node->Clones)
+ NodeCallClones.insert(C->Call.cloneNo());
+ auto &ClonedCalls = UnassignedCallClones[Node];
----------------
teresajohnson wrote:
We can't do this because at() returns a const reference. Note a few lines above we continue if the entry doesn't exist - I added a comment to this effect.
https://github.com/llvm/llvm-project/pull/159861
More information about the llvm-commits
mailing list