Go to the documentation of this file.
14 #ifndef LLVM_PROFILEDATA_PROFILECOMMON_H
15 #define LLVM_PROFILEDATA_PROFILECOMMON_H
31 namespace sampleprof {
45 std::map<uint64_t, uint32_t, std::greater<uint64_t>> CountFrequencies;
46 std::vector<uint32_t> DetailedSummaryCutoffs;
57 : DetailedSummaryCutoffs(
std::
move(Cutoffs)) {}
77 inline void addEntryCount(
uint64_t Count);
78 inline void addInternalCount(
uint64_t Count);
94 bool isCallsiteSample =
false);
95 std::unique_ptr<ProfileSummary>
106 CountFrequencies[Count]++;
111 #endif // LLVM_PROFILEDATA_PROFILECOMMON_H
static uint64_t getHotCountThreshold(const SummaryEntryVector &DS)
This is an optimization pass for GlobalISel generic memory operations.
std::unordered_map< SampleContext, FunctionSamples, SampleContext::Hash > SampleProfileMap
Profiling information for a single function.
~ProfileSummaryBuilder()=default
ProfileSummaryBuilder(std::vector< uint32_t > Cutoffs)
std::unique_ptr< ProfileSummary > getSummary()
uint64_t MaxFunctionCount
std::unique_ptr< ProfileSummary > computeSummaryForProfiles(const sampleprof::SampleProfileMap &Profiles)
void computeDetailedSummary()
const char * getHotSectionPrefix()
Representation of the samples collected for a function.
static uint64_t getColdCountThreshold(const SummaryEntryVector &DS)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
InstrProfSummaryBuilder(std::vector< uint32_t > Cutoffs)
std::vector< ProfileSummaryEntry > SummaryEntryVector
const char * getUnlikelySectionPrefix()
std::unique_ptr< ProfileSummary > getSummary()
SampleProfileSummaryBuilder(std::vector< uint32_t > Cutoffs)
void addRecord(const sampleprof::FunctionSamples &FS, bool isCallsiteSample=false)
void addCount(uint64_t Count)
This is called when a count is seen in the profile.
void addRecord(const InstrProfRecord &)
SummaryEntryVector DetailedSummary
static const ArrayRef< uint32_t > DefaultCutoffs
A vector of useful cutoff values for detailed summary.
static const ProfileSummaryEntry & getEntryForPercentile(const SummaryEntryVector &DS, uint64_t Percentile)
Find the summary entry for a desired percentile of counts.