24 cl::desc(
"Synthesize entry counts based on the summary"));
35 for (
auto &
C : Root.calls()) {
37 for (
auto &GVS : V.getSummaryList()) {
38 auto S = GVS.get()->getBaseObject();
39 auto *
F = cast<FunctionSummary>(S);
40 F->setEntryCount(InitialSyntheticCount);
55 if (V.getSummaryList().size()) {
56 auto S = V.getSummaryList().front().get()->getBaseObject();
57 auto *
F = cast<FunctionSummary>(S);
58 return F->entryCount();
67 auto S = GVS.get()->getBaseObject();
68 auto *
F = cast<FunctionSummary>(S);
75 auto RelFreq = GetCallSiteRelFreq(Edge);
This class represents lattice values for constants.
std::enable_if< std::is_unsigned< T >::value, T >::type SaturatingAdd(T X, T Y, bool *ResultOverflowed=nullptr)
Add two unsigned integers, X and Y, of type T.
std::pair< ValueInfo, CalleeInfo > EdgeTy
<CalleeValueInfo, CalleeInfo> call edge pair.
static constexpr int32_t ScaleShift
Class to hold module path string table and global value map, and encapsulate methods for operating on...
ArrayRef< std::unique_ptr< GlobalValueSummary > > getSummaryList() const
initializer< Ty > init(const Ty &Val)
static void propagate(const CallGraphType &CG, GetProfCountTy GetProfCount, AddCountTy AddCount)
Propgate synthetic entry counts on a callgraph CG.
static void initializeCounts(ModuleSummaryIndex &Index)
Struct that holds a reference to a particular GUID in a global value summary.
void computeSyntheticCounts(ModuleSummaryIndex &Index)
Compute synthetic function entry counts.
void setHasSyntheticEntryCounts()
FunctionSummary calculateCallGraphRoot()
cl::opt< int > InitialSyntheticCount
Initial synthetic count assigned to functions.
ModuleSummaryIndex.h This file contains the declarations the classes that hold the module index and s...
ScaledNumber< uint64_t > Scaled64
cl::opt< bool > ThinLTOSynthesizeEntryCounts("thinlto-synthesize-entry-counts", cl::init(false), cl::Hidden, cl::desc("Synthesize entry counts based on the summary"))