LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
llvm::ProfileSummary Class Reference

#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
 
MetadatagetMD (LLVMContext &Context, bool AddPartialField=true, bool AddPartialProfileRatioField=true)
 Return summary information as metadata.
 
const SummaryEntryVectorgetDetailedSummary ()
 
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 ProfileSummarygetFromMD (Metadata *MD)
 Construct profile summary from metdata.
 

Static Public Attributes

static const int Scale = 1000000
 

Detailed Description

Definition at line 45 of file ProfileSummary.h.

Member Enumeration Documentation

◆ Kind

Enumerator
PSK_Instr 
PSK_CSInstr 
PSK_Sample 

Definition at line 47 of file ProfileSummary.h.

Constructor & Destructor Documentation

◆ ProfileSummary()

llvm::ProfileSummary::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 
)
inline

Definition at line 71 of file ProfileSummary.h.

Member Function Documentation

◆ getDetailedSummary()

const SummaryEntryVector & llvm::ProfileSummary::getDetailedSummary ( )
inline

Definition at line 88 of file ProfileSummary.h.

Referenced by setSummary().

◆ getFromMD()

ProfileSummary * ProfileSummary::getFromMD ( Metadata MD)
static

◆ getKind()

Kind llvm::ProfileSummary::getKind ( ) const
inline

Definition at line 82 of file ProfileSummary.h.

Referenced by llvm::Module::setPartialSampleProfileRatio().

◆ getMaxCount()

uint64_t llvm::ProfileSummary::getMaxCount ( ) const
inline

Definition at line 93 of file ProfileSummary.h.

Referenced by getMD(), and setSummary().

◆ getMaxFunctionCount()

uint64_t llvm::ProfileSummary::getMaxFunctionCount ( ) const
inline

Definition at line 90 of file ProfileSummary.h.

Referenced by getMD(), and setSummary().

◆ getMaxInternalCount()

uint64_t llvm::ProfileSummary::getMaxInternalCount ( ) const
inline

Definition at line 94 of file ProfileSummary.h.

Referenced by getMD(), and setSummary().

◆ getMD()

Metadata * ProfileSummary::getMD ( LLVMContext Context,
bool  AddPartialField = true,
bool  AddPartialProfileRatioField = true 
)

◆ getNumCounts()

uint32_t llvm::ProfileSummary::getNumCounts ( ) const
inline

Definition at line 91 of file ProfileSummary.h.

Referenced by getMD(), llvm::Module::setPartialSampleProfileRatio(), and setSummary().

◆ getNumFunctions()

uint32_t llvm::ProfileSummary::getNumFunctions ( ) const
inline

Definition at line 89 of file ProfileSummary.h.

Referenced by getMD(), and setSummary().

◆ getPartialProfileRatio()

double llvm::ProfileSummary::getPartialProfileRatio ( ) const
inline

Definition at line 97 of file ProfileSummary.h.

Referenced by getMD().

◆ getTotalCount()

uint64_t llvm::ProfileSummary::getTotalCount ( ) const
inline

Definition at line 92 of file ProfileSummary.h.

Referenced by getMD(), and setSummary().

◆ isPartialProfile()

bool llvm::ProfileSummary::isPartialProfile ( ) const
inline

◆ printDetailedSummary()

void ProfileSummary::printDetailedSummary ( raw_ostream OS) const

Definition at line 259 of file ProfileSummary.cpp.

References llvm::format(), OS, and Scale.

◆ printSummary()

void ProfileSummary::printSummary ( raw_ostream OS) const

Definition at line 251 of file ProfileSummary.cpp.

References OS.

◆ setPartialProfile()

void llvm::ProfileSummary::setPartialProfile ( bool  PP)
inline

Definition at line 95 of file ProfileSummary.h.

◆ setPartialProfileRatio()

void llvm::ProfileSummary::setPartialProfileRatio ( double  R)
inline

Definition at line 98 of file ProfileSummary.h.

References assert(), and isPartialProfile().

Referenced by llvm::Module::setPartialSampleProfileRatio().

Member Data Documentation

◆ Scale

const int llvm::ProfileSummary::Scale = 1000000
static

The documentation for this class was generated from the following files: