13#ifndef LLVM_IR_PROFILESUMMARY_H
14#define LLVM_IR_PROFILESUMMARY_H
52 const uint64_t TotalCount, MaxCount, MaxInternalCount, MaxFunctionCount;
53 const uint32_t NumCounts, NumFunctions;
64 double PartialProfileRatio = 0.0;
69 static const int Scale = 1000000;
75 bool Partial =
false,
double PartialProfileRatio = 0)
76 : PSK(K), DetailedSummary(DetailedSummary), TotalCount(TotalCount),
77 MaxCount(MaxCount), MaxInternalCount(MaxInternalCount),
78 MaxFunctionCount(MaxFunctionCount), NumCounts(NumCounts),
79 NumFunctions(NumFunctions), Partial(Partial),
80 PartialProfileRatio(PartialProfileRatio) {}
85 bool AddPartialProfileRatioField =
true);
100 PartialProfileRatio = R;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This is an important class for using LLVM in a threaded context.
uint64_t getTotalCount() const
void setPartialProfileRatio(double R)
uint64_t getMaxCount() const
const SummaryEntryVector & getDetailedSummary()
void setPartialProfile(bool PP)
Metadata * getMD(LLVMContext &Context, bool AddPartialField=true, bool AddPartialProfileRatioField=true)
Return summary information as metadata.
uint32_t getNumCounts() const
ProfileSummary(Kind K, const SummaryEntryVector &DetailedSummary, uint64_t TotalCount, uint64_t MaxCount, uint64_t MaxInternalCount, uint64_t MaxFunctionCount, uint32_t NumCounts, uint32_t NumFunctions, bool Partial=false, double PartialProfileRatio=0)
void printDetailedSummary(raw_ostream &OS) const
uint64_t getMaxInternalCount() const
bool isPartialProfile() const
static ProfileSummary * getFromMD(Metadata *MD)
Construct profile summary from metdata.
uint64_t getMaxFunctionCount() const
void printSummary(raw_ostream &OS) const
double getPartialProfileRatio() const
uint32_t getNumFunctions() const
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
std::vector< ProfileSummaryEntry > SummaryEntryVector
const uint32_t Cutoff
The required percentile of counts.
const uint64_t MinCount
The minimum count for this percentile.
ProfileSummaryEntry(uint32_t TheCutoff, uint64_t TheMinCount, uint64_t TheNumCounts)
const uint64_t NumCounts
Number of counts >= the minimum count.