#include "llvm/IR/ProfileSummary.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/ProfileData/ProfileCommon.h"
#include "llvm/ProfileData/SampleProf.h"
#include "llvm/Support/CommandLine.h"
usingnamespacellvm;
namespace llvm {
cl::opt<bool> UseContextLessSummary(
"profile-summary-contextless", cl::Hidden,
cl::desc("Merge context profiles before calculating thresholds."));
cl::opt<int> ProfileSummaryCutoffHot(
"profile-summary-cutoff-hot", cl::Hidden, cl::init(990000),
cl::desc("A count is hot if it exceeds the minimum count to"
" reach this percentile of total counts."));
cl::opt<int> ProfileSummaryCutoffCold(
"profile-summary-cutoff-cold", cl::Hidden, cl::init(999999),
cl::desc("A count is cold if it is below the minimum count"
" to reach this percentile of total counts."));
cl::opt<unsigned> ProfileSummaryHugeWorkingSetSizeThreshold(
"profile-summary-huge-working-set-size-threshold", cl::Hidden,
cl::init(15000),
cl::desc("The code working set size is considered huge if the number of"
" blocks required to reach the -profile-summary-cutoff-hot"
" percentile exceeds this count."));
cl::opt<unsigned> ProfileSummaryLargeWorkingSetSizeThreshold(
"profile-summary-large-working-set-size-threshold", cl::Hidden,
cl::init(12500),
cl::desc("The code working set size is considered large if the number of"
" blocks required to reach the -profile-summary-cutoff-hot"
" percentile exceeds this count."));
cl::opt<uint64_t> ProfileSummaryHotCount(
"profile-summary-hot-count", cl::ReallyHidden,
cl::desc("A fixed hot count that overrides the count derived from"
" profile-summary-cutoff-hot"));
cl::opt<uint64_t> ProfileSummaryColdCount(
"profile-summary-cold-count", cl::ReallyHidden,
cl::desc("A fixed cold count that overrides the count derived from"
" profile-summary-cutoff-cold"));
}
static const uint32_t DefaultCutoffsData[] = …;
const ArrayRef<uint32_t> ProfileSummaryBuilder::DefaultCutoffs = …;
const ProfileSummaryEntry &
ProfileSummaryBuilder::getEntryForPercentile(const SummaryEntryVector &DS,
uint64_t Percentile) { … }
void InstrProfSummaryBuilder::addRecord(const InstrProfRecord &R) { … }
void SampleProfileSummaryBuilder::addRecord(
const sampleprof::FunctionSamples &FS, bool isCallsiteSample) { … }
void ProfileSummaryBuilder::computeDetailedSummary() { … }
uint64_t
ProfileSummaryBuilder::getHotCountThreshold(const SummaryEntryVector &DS) { … }
uint64_t
ProfileSummaryBuilder::getColdCountThreshold(const SummaryEntryVector &DS) { … }
std::unique_ptr<ProfileSummary> SampleProfileSummaryBuilder::getSummary() { … }
std::unique_ptr<ProfileSummary>
SampleProfileSummaryBuilder::computeSummaryForProfiles(
const SampleProfileMap &Profiles) { … }
std::unique_ptr<ProfileSummary> InstrProfSummaryBuilder::getSummary() { … }
void InstrProfSummaryBuilder::addEntryCount(uint64_t Count) { … }
void InstrProfSummaryBuilder::addInternalCount(uint64_t Count) { … }