LLVM 20.0.0git
|
#include "llvm/IR/ProfileSummary.h"
Public Types | |
enum | Kind { PSK_Instr , PSK_CSInstr , PSK_Sample } |
Public Member Functions | |
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) | |
Kind | getKind () const |
Metadata * | getMD (LLVMContext &Context, bool AddPartialField=true, bool AddPartialProfileRatioField=true) |
Return summary information as metadata. | |
const SummaryEntryVector & | getDetailedSummary () |
uint32_t | getNumFunctions () const |
uint64_t | getMaxFunctionCount () const |
uint32_t | getNumCounts () const |
uint64_t | getTotalCount () const |
uint64_t | getMaxCount () const |
uint64_t | getMaxInternalCount () const |
void | setPartialProfile (bool PP) |
bool | isPartialProfile () const |
double | getPartialProfileRatio () const |
void | setPartialProfileRatio (double R) |
void | printSummary (raw_ostream &OS) const |
void | printDetailedSummary (raw_ostream &OS) const |
Static Public Member Functions | |
static ProfileSummary * | getFromMD (Metadata *MD) |
Construct profile summary from metdata. | |
Static Public Attributes | |
static const int | Scale = 1000000 |
Definition at line 45 of file ProfileSummary.h.
Enumerator | |
---|---|
PSK_Instr | |
PSK_CSInstr | |
PSK_Sample |
Definition at line 47 of file ProfileSummary.h.
|
inline |
Definition at line 71 of file ProfileSummary.h.
|
inline |
Definition at line 88 of file ProfileSummary.h.
Referenced by setSummary().
|
static |
Construct profile summary from metdata.
Definition at line 194 of file ProfileSummary.cpp.
References llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), getOptionalVal(), getSummaryFromMD(), getVal(), I, isKeyValuePair(), PSK_CSInstr, PSK_Instr, and PSK_Sample.
Referenced by llvm::ProfileSummaryInfo::refresh(), and llvm::Module::setPartialSampleProfileRatio().
|
inline |
Definition at line 82 of file ProfileSummary.h.
Referenced by llvm::Module::setPartialSampleProfileRatio().
|
inline |
Definition at line 93 of file ProfileSummary.h.
Referenced by getMD(), and setSummary().
|
inline |
Definition at line 90 of file ProfileSummary.h.
Referenced by getMD(), and setSummary().
|
inline |
Definition at line 94 of file ProfileSummary.h.
Referenced by getMD(), and setSummary().
Metadata * ProfileSummary::getMD | ( | LLVMContext & | Context, |
bool | AddPartialField = true , |
||
bool | AddPartialProfileRatioField = true |
||
) |
Return summary information as metadata.
Definition at line 80 of file ProfileSummary.cpp.
References llvm::MDTuple::get(), getKeyFPValMD(), getKeyValMD(), getMaxCount(), getMaxFunctionCount(), getMaxInternalCount(), getNumCounts(), getNumFunctions(), getPartialProfileRatio(), getTotalCount(), isPartialProfile(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::Module::setPartialSampleProfileRatio().
|
inline |
Definition at line 91 of file ProfileSummary.h.
Referenced by getMD(), llvm::Module::setPartialSampleProfileRatio(), and setSummary().
|
inline |
Definition at line 89 of file ProfileSummary.h.
Referenced by getMD(), and setSummary().
|
inline |
Definition at line 97 of file ProfileSummary.h.
Referenced by getMD().
|
inline |
Definition at line 92 of file ProfileSummary.h.
Referenced by getMD(), and setSummary().
|
inline |
Definition at line 96 of file ProfileSummary.h.
Referenced by getMD(), setPartialProfileRatio(), and llvm::Module::setPartialSampleProfileRatio().
void ProfileSummary::printDetailedSummary | ( | raw_ostream & | OS | ) | const |
Definition at line 259 of file ProfileSummary.cpp.
References llvm::format(), OS, and Scale.
void ProfileSummary::printSummary | ( | raw_ostream & | OS | ) | const |
Definition at line 251 of file ProfileSummary.cpp.
References OS.
|
inline |
Definition at line 95 of file ProfileSummary.h.
|
inline |
Definition at line 98 of file ProfileSummary.h.
References assert(), and isPartialProfile().
Referenced by llvm::Module::setPartialSampleProfileRatio().
|
static |
Definition at line 69 of file ProfileSummary.h.
Referenced by llvm::ProfileSummaryBuilder::computeDetailedSummary(), and printDetailedSummary().