13#ifndef LLVM_IR_PROFILESUMMARY_H
14#define LLVM_IR_PROFILESUMMARY_H
53 const uint64_t TotalCount, MaxCount, MaxInternalCount, MaxFunctionCount;
54 const uint32_t NumCounts, NumFunctions;
65 double PartialProfileRatio = 0.0;
70 static const int Scale = 1000000;
76 bool Partial =
false,
double PartialProfileRatio = 0)
77 : PSK(K), DetailedSummary(DetailedSummary), TotalCount(TotalCount),
78 MaxCount(MaxCount), MaxInternalCount(MaxInternalCount),
79 MaxFunctionCount(MaxFunctionCount), NumCounts(NumCounts),
80 NumFunctions(NumFunctions), Partial(Partial),
81 PartialProfileRatio(PartialProfileRatio) {}
86 bool AddPartialProfileRatioField =
true);
101 PartialProfileRatio = R;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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)
LLVM_ABI 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)
LLVM_ABI void printDetailedSummary(raw_ostream &OS) const
uint64_t getMaxInternalCount() const
bool isPartialProfile() const
static LLVM_ABI ProfileSummary * getFromMD(Metadata *MD)
Construct profile summary from metdata.
uint64_t getMaxFunctionCount() const
LLVM_ABI 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.