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

Class to accumulate and hold information about a callee. More...

#include "llvm/IR/ModuleSummaryIndex.h"

Public Types

enum class  HotnessType : uint8_t {
  Unknown = 0 , Cold = 1 , None = 2 , Hot = 3 ,
  Critical = 4
}
 

Public Member Functions

 CalleeInfo ()
 
 CalleeInfo (HotnessType Hotness, bool HasTC, uint64_t RelBF)
 
void updateHotness (const HotnessType OtherHotness)
 
bool hasTailCall () const
 
void setHasTailCall (const bool HasTC)
 
HotnessType getHotness () const
 
void updateRelBlockFreq (uint64_t BlockFreq, uint64_t EntryFreq)
 Update RelBlockFreq from BlockFreq and EntryFreq.
 

Public Attributes

uint32_t Hotness: 3
 
bool HasTailCall: 1
 
uint32_t RelBlockFreq: RelBlockFreqBits
 

Static Public Attributes

static constexpr unsigned RelBlockFreqBits = 28
 The value stored in RelBlockFreq has to be interpreted as the digits of a scaled number with a scale of -ScaleShift.
 
static constexpr int32_t ScaleShift = 8
 
static constexpr uint64_t MaxRelBlockFreq = (1 << RelBlockFreqBits) - 1
 

Detailed Description

Class to accumulate and hold information about a callee.

Definition at line 59 of file ModuleSummaryIndex.h.

Member Enumeration Documentation

◆ HotnessType

enum class llvm::CalleeInfo::HotnessType : uint8_t
strong
Enumerator
Unknown 
Cold 
None 
Hot 
Critical 

Definition at line 60 of file ModuleSummaryIndex.h.

Constructor & Destructor Documentation

◆ CalleeInfo() [1/2]

llvm::CalleeInfo::CalleeInfo ( )
inline

Definition at line 82 of file ModuleSummaryIndex.h.

◆ CalleeInfo() [2/2]

llvm::CalleeInfo::CalleeInfo ( HotnessType  Hotness,
bool  HasTC,
uint64_t  RelBF 
)
inlineexplicit

Definition at line 85 of file ModuleSummaryIndex.h.

Member Function Documentation

◆ getHotness()

HotnessType llvm::CalleeInfo::getHotness ( ) const
inline

Definition at line 97 of file ModuleSummaryIndex.h.

References Hotness.

◆ hasTailCall()

bool llvm::CalleeInfo::hasTailCall ( ) const
inline

Definition at line 93 of file ModuleSummaryIndex.h.

References HasTailCall.

◆ setHasTailCall()

void llvm::CalleeInfo::setHasTailCall ( const bool  HasTC)
inline

Definition at line 95 of file ModuleSummaryIndex.h.

References HasTailCall.

◆ updateHotness()

void llvm::CalleeInfo::updateHotness ( const HotnessType  OtherHotness)
inline

Definition at line 89 of file ModuleSummaryIndex.h.

References Hotness.

◆ updateRelBlockFreq()

void llvm::CalleeInfo::updateRelBlockFreq ( uint64_t  BlockFreq,
uint64_t  EntryFreq 
)
inline

Update RelBlockFreq from BlockFreq and EntryFreq.

BlockFreq is divided by EntryFreq and added to RelBlockFreq. To represent fractional values, the result is represented as a fixed point number with scale of -ScaleShift.

Definition at line 104 of file ModuleSummaryIndex.h.

References MaxRelBlockFreq, RelBlockFreq, and ScaleShift.

Member Data Documentation

◆ HasTailCall

bool llvm::CalleeInfo::HasTailCall

◆ Hotness

uint32_t llvm::CalleeInfo::Hotness

Definition at line 70 of file ModuleSummaryIndex.h.

Referenced by getEncodedHotnessCallEdgeInfo(), getHotness(), and updateHotness().

◆ MaxRelBlockFreq

constexpr uint64_t llvm::CalleeInfo::MaxRelBlockFreq = (1 << RelBlockFreqBits) - 1
staticconstexpr

Definition at line 80 of file ModuleSummaryIndex.h.

Referenced by updateRelBlockFreq().

◆ RelBlockFreq

uint32_t llvm::CalleeInfo::RelBlockFreq

Definition at line 78 of file ModuleSummaryIndex.h.

Referenced by getEncodedRelBFCallEdgeInfo(), and updateRelBlockFreq().

◆ RelBlockFreqBits

constexpr unsigned llvm::CalleeInfo::RelBlockFreqBits = 28
staticconstexpr

The value stored in RelBlockFreq has to be interpreted as the digits of a scaled number with a scale of -ScaleShift.

Definition at line 77 of file ModuleSummaryIndex.h.

Referenced by getDecodedRelBFCallEdgeInfo(), and getEncodedRelBFCallEdgeInfo().

◆ ScaleShift

constexpr int32_t llvm::CalleeInfo::ScaleShift = 8
staticconstexpr

Definition at line 79 of file ModuleSummaryIndex.h.

Referenced by llvm::computeSyntheticCounts(), and updateRelBlockFreq().


The documentation for this struct was generated from the following file: