24 cl::desc(
"Synthesize entry counts based on the summary"));
31 auto Root =
Index.calculateCallGraphRoot();
37 for (
auto &
C : Root.calls()) {
39 for (
auto &GVS : V.getSummaryList()) {
40 auto S = GVS.get()->getBaseObject();
41 auto *
F = cast<FunctionSummary>(S);
57 if (V.getSummaryList().size()) {
58 auto S = V.getSummaryList().front()->getBaseObject();
59 auto *
F = cast<FunctionSummary>(S);
60 return F->entryCount();
66 if (!V.getSummaryList().size())
68 for (
auto &GVS : V.getSummaryList()) {
69 auto S = GVS.get()->getBaseObject();
70 auto *
F = cast<FunctionSummary>(S);
77 auto RelFreq = GetCallSiteRelFreq(Edge);
87 Index.setHasSyntheticEntryCounts();
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
static void initializeCounts(ModuleSummaryIndex &Index)
static cl::opt< bool > ThinLTOSynthesizeEntryCounts("thinlto-synthesize-entry-counts", cl::init(false), cl::Hidden, cl::desc("Synthesize entry counts based on the summary"))
ScaledNumber< uint64_t > Scaled64
std::pair< ValueInfo, CalleeInfo > EdgeTy
<CalleeValueInfo, CalleeInfo> call edge pair.
Class to hold module path string table and global value map, and encapsulate methods for operating on...
static void propagate(const CallGraphType &CG, GetProfCountTy GetProfCount, AddCountTy AddCount)
Propgate synthetic entry counts on a callgraph CG.
@ C
The default llvm calling convention, compatible with C.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
void computeSyntheticCounts(ModuleSummaryIndex &Index)
Compute synthetic function entry counts.
cl::opt< int > InitialSyntheticCount
std::enable_if_t< std::is_unsigned_v< T >, T > SaturatingAdd(T X, T Y, bool *ResultOverflowed=nullptr)
Add two unsigned integers, X and Y, of type T.
static constexpr int32_t ScaleShift
Struct that holds a reference to a particular GUID in a global value summary.