14#ifndef LLVM_PROFILEDATA_PROFILECOMMON_H
15#define LLVM_PROFILEDATA_PROFILECOMMON_H
50 std::map<uint64_t, uint32_t, std::greater<uint64_t>> CountFrequencies;
51 std::vector<uint32_t> DetailedSummaryCutoffs;
62 : DetailedSummaryCutoffs(
std::
move(Cutoffs)) {}
82 inline void addEntryCount(
uint64_t Count);
83 inline void addInternalCount(
uint64_t Count);
99 bool isCallsiteSample =
false);
100 std::unique_ptr<ProfileSummary>
111 CountFrequencies[Count]++;
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
std::unique_ptr< ProfileSummary > getSummary()
void addRecord(const InstrProfRecord &)
InstrProfSummaryBuilder(std::vector< uint32_t > Cutoffs)
void computeDetailedSummary()
void addCount(uint64_t Count)
This is called when a count is seen in the profile.
static const ProfileSummaryEntry & getEntryForPercentile(const SummaryEntryVector &DS, uint64_t Percentile)
Find the summary entry for a desired percentile of counts.
~ProfileSummaryBuilder()=default
uint64_t MaxFunctionCount
static const ArrayRef< uint32_t > DefaultCutoffs
A vector of useful cutoff values for detailed summary.
ProfileSummaryBuilder(std::vector< uint32_t > Cutoffs)
SummaryEntryVector DetailedSummary
static uint64_t getHotCountThreshold(const SummaryEntryVector &DS)
static uint64_t getColdCountThreshold(const SummaryEntryVector &DS)
std::unique_ptr< ProfileSummary > getSummary()
std::unique_ptr< ProfileSummary > computeSummaryForProfiles(const sampleprof::SampleProfileMap &Profiles)
void addRecord(const sampleprof::FunctionSamples &FS, bool isCallsiteSample=false)
SampleProfileSummaryBuilder(std::vector< uint32_t > Cutoffs)
Representation of the samples collected for a function.
This class provides operator overloads to the map container using MD5 as the key type,...
This is an optimization pass for GlobalISel generic memory operations.
cl::opt< uint64_t > ProfileSummaryHotCount
cl::opt< bool > UseContextLessSummary
cl::opt< uint64_t > ProfileSummaryColdCount
cl::opt< int > ProfileSummaryCutoffCold
std::vector< ProfileSummaryEntry > SummaryEntryVector
cl::opt< unsigned > ProfileSummaryLargeWorkingSetSizeThreshold
cl::opt< int > ProfileSummaryCutoffHot
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
cl::opt< unsigned > ProfileSummaryHugeWorkingSetSizeThreshold
Implement std::hash so that hash_code can be used in STL containers.
Profiling information for a single function.