aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/SampleProf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ProfileData/SampleProf.cpp')
-rw-r--r--llvm/lib/ProfileData/SampleProf.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/SampleProf.cpp b/llvm/lib/ProfileData/SampleProf.cpp
index 9862605..5e32543 100644
--- a/llvm/lib/ProfileData/SampleProf.cpp
+++ b/llvm/lib/ProfileData/SampleProf.cpp
@@ -518,6 +518,12 @@ void CSProfileConverter::convertProfiles(CSProfileConverter::FrameNode &Node) {
auto &SamplesMap = NodeProfile->functionSamplesAt(ChildNode.CallSiteLoc);
SamplesMap.emplace(OrigChildContext.getName().str(), *ChildProfile);
NodeProfile->addTotalSamples(ChildProfile->getTotalSamples());
+ // Remove the corresponding body sample for the callsite and update the
+ // total weight.
+ auto Count = NodeProfile->removeCalledTargetAndBodySample(
+ ChildNode.CallSiteLoc.LineOffset, ChildNode.CallSiteLoc.Discriminator,
+ OrigChildContext.getName());
+ NodeProfile->removeTotalSamples(Count);
}
// Separate child profile to be a standalone profile, if the current parent