mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[CSSPGO] Use callsite sample counts to annotate indirect call sites.
With CSSPGO all indirect call targets are counted torwards the original indirect call site in the profile, including both inlined and non-inlined targets. Therefore no need to look for callee entry counts. This also fixes the issue where callee entry count doesn't match callsite count due to the nature of CS sampling. I'm also cleaning up the orginal code that called `findIndirectCallFunctionSamples` just to compute the sum, the return value of which was disgarded. Reviewed By: wmi, wenlei Differential Revision: https://reviews.llvm.org/D96990
This commit is contained in:
parent
c8d672e931
commit
9372bfe8ed
@ -1248,8 +1248,19 @@ void SampleProfileLoader::generateMDProfMetadata(Function &F) {
|
||||
}
|
||||
SmallVector<InstrProfValueData, 2> SortedCallTargets =
|
||||
GetSortedValueDataFromCallTargets(T.get());
|
||||
uint64_t Sum;
|
||||
findIndirectCallFunctionSamples(I, Sum);
|
||||
uint64_t Sum = 0;
|
||||
for (const auto &C : T.get())
|
||||
Sum += C.second;
|
||||
// With CSSPGO all indirect call targets are counted torwards the
|
||||
// original indirect call site in the profile, including both
|
||||
// inlined and non-inlined targets.
|
||||
if (!FunctionSamples::ProfileIsCS) {
|
||||
if (const FunctionSamplesMap *M =
|
||||
FS->findFunctionSamplesMapAt(CallSite)) {
|
||||
for (const auto &NameFS : *M)
|
||||
Sum += NameFS.second.getEntrySamples();
|
||||
}
|
||||
}
|
||||
annotateValueSite(*I.getParent()->getParent()->getParent(), I,
|
||||
SortedCallTargets, Sum, IPVK_IndirectCallTarget,
|
||||
SortedCallTargets.size());
|
||||
|
Loading…
Reference in New Issue
Block a user