[PATCH] D96990: [CSSPGO] Use callsite sample counts to annotate indirect call sites.
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 18 14:52:52 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe87b1b1d4e78: [CSSPGO] Use callsite sample counts to annotate indirect call sites. (authored by hoy).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96990/new/
https://reviews.llvm.org/D96990
Files:
llvm/lib/Transforms/IPO/SampleProfile.cpp
Index: llvm/lib/Transforms/IPO/SampleProfile.cpp
===================================================================
--- llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -1248,8 +1248,19 @@
}
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());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96990.324780.patch
Type: text/x-patch
Size: 1240 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210218/c96071f8/attachment.bin>
More information about the llvm-commits
mailing list