LLVM  11.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"

Collaboration diagram for llvm::ProfileSummary:
Collaboration graph
[legend]

Public Types

enum  Kind { PSK_Instr, PSK_CSInstr, PSK_Sample }
 

Public Member Functions

 ProfileSummary (Kind K, 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. More...
 
SummaryEntryVectorgetDetailedSummary ()
 
uint32_t getNumFunctions ()
 
uint64_t getMaxFunctionCount ()
 
uint32_t getNumCounts ()
 
uint64_t getTotalCount ()
 
uint64_t getMaxCount ()
 
uint64_t getMaxInternalCount ()
 
void setPartialProfile (bool PP)
 
bool isPartialProfile ()
 
double getPartialProfileRatio ()
 
void setPartialProfileRatio (double R)
 
void printSummary (raw_ostream &OS)
 
void printDetailedSummary (raw_ostream &OS)
 

Static Public Member Functions

static ProfileSummarygetFromMD (Metadata *MD)
 Construct profile summary from metdata. More...
 

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,
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.

Referenced by getFromMD().

Member Function Documentation

◆ getDetailedSummary()

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.

◆ getMaxCount()

uint64_t llvm::ProfileSummary::getMaxCount ( )
inline

Definition at line 93 of file ProfileSummary.h.

Referenced by getMD(), and setSummary().

◆ getMaxFunctionCount()

uint64_t llvm::ProfileSummary::getMaxFunctionCount ( )
inline

Definition at line 90 of file ProfileSummary.h.

Referenced by getMD(), and setSummary().

◆ getMaxInternalCount()

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

Definition at line 91 of file ProfileSummary.h.

References llvm::ProfileSummaryEntry::NumCounts.

Referenced by getMD(), and setSummary().

◆ getNumFunctions()

uint32_t llvm::ProfileSummary::getNumFunctions ( )
inline

Definition at line 89 of file ProfileSummary.h.

Referenced by getMD(), and setSummary().

◆ getPartialProfileRatio()

double llvm::ProfileSummary::getPartialProfileRatio ( )
inline

Definition at line 97 of file ProfileSummary.h.

Referenced by getMD().

◆ getTotalCount()

uint64_t llvm::ProfileSummary::getTotalCount ( )
inline

Definition at line 92 of file ProfileSummary.h.

Referenced by getMD(), and setSummary().

◆ isPartialProfile()

bool llvm::ProfileSummary::isPartialProfile ( )
inline

Definition at line 96 of file ProfileSummary.h.

Referenced by getMD().

◆ printDetailedSummary()

void ProfileSummary::printDetailedSummary ( raw_ostream OS)

Definition at line 260 of file ProfileSummary.cpp.

◆ printSummary()

void ProfileSummary::printSummary ( raw_ostream OS)

Definition at line 252 of file ProfileSummary.cpp.

◆ 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().

Member Data Documentation

◆ Scale

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

Definition at line 69 of file ProfileSummary.h.


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