LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
llvm::BlockFrequency Class Reference

#include <BlockFrequency.h>

Public Member Functions

 BlockFrequency (uint64_t Freq=0)
 
uint64_t getFrequency () const
 Returns the frequency as a fixpoint number scaled by the entry frequency. More...
 
BlockFrequencyoperator*= (const BranchProbability &Prob)
 Multiplies with a branch probability. The computation will never overflow. More...
 
const BlockFrequency operator* (const BranchProbability &Prob) const
 
BlockFrequencyoperator/= (const BranchProbability &Prob)
 Divide by a non-zero branch probability using saturating arithmetic. More...
 
BlockFrequency operator/ (const BranchProbability &Prob) const
 
BlockFrequencyoperator+= (const BlockFrequency &Freq)
 Adds another block frequency using saturating arithmetic. More...
 
const BlockFrequency operator+ (const BlockFrequency &Freq) const
 
uint32_t scale (const BranchProbability &Prob)
 Scale the given BlockFrequency by N/D. Return the remainder from the division by D. Upon overflow, the routine will saturate. More...
 
bool operator< (const BlockFrequency &RHS) const
 
bool operator<= (const BlockFrequency &RHS) const
 
bool operator> (const BlockFrequency &RHS) const
 
bool operator>= (const BlockFrequency &RHS) const
 
void print (raw_ostream &OS) const
 

Static Public Member Functions

static uint64_t getEntryFrequency ()
 Returns the frequency of the entry block of the function. More...
 
static uint64_t getMaxFrequency ()
 Returns the maximum possible frequency, the saturation value. More...
 

Detailed Description

Definition at line 25 of file BlockFrequency.h.

Constructor & Destructor Documentation

llvm::BlockFrequency::BlockFrequency ( uint64_t  Freq = 0)
inline

Definition at line 36 of file BlockFrequency.h.

Member Function Documentation

static uint64_t llvm::BlockFrequency::getEntryFrequency ( )
inlinestatic

Returns the frequency of the entry block of the function.

Definition at line 39 of file BlockFrequency.h.

Referenced by llvm::LiveIntervals::getSpillWeight(), and print().

uint64_t llvm::BlockFrequency::getFrequency ( ) const
inline

Returns the frequency as a fixpoint number scaled by the entry frequency.

Definition at line 46 of file BlockFrequency.h.

Referenced by llvm::DOTGraphTraits< BlockFrequencyInfo * >::getNodeLabel(), and llvm::LiveIntervals::getSpillWeight().

static uint64_t llvm::BlockFrequency::getMaxFrequency ( )
inlinestatic

Returns the maximum possible frequency, the saturation value.

Definition at line 42 of file BlockFrequency.h.

Referenced by llvm::SpillPlacement::Node::addBias().

const BlockFrequency BlockFrequency::operator* ( const BranchProbability Prob) const

Definition at line 113 of file BlockFrequency.cpp.

BlockFrequency & BlockFrequency::operator*= ( const BranchProbability Prob)

Multiplies with a branch probability. The computation will never overflow.

Definition at line 107 of file BlockFrequency.cpp.

References llvm::BranchProbability::getDenominator(), and llvm::BranchProbability::getNumerator().

const BlockFrequency BlockFrequency::operator+ ( const BlockFrequency Freq) const

Definition at line 142 of file BlockFrequency.cpp.

BlockFrequency & BlockFrequency::operator+= ( const BlockFrequency Freq)

Adds another block frequency using saturating arithmetic.

Definition at line 130 of file BlockFrequency.cpp.

BlockFrequency BlockFrequency::operator/ ( const BranchProbability Prob) const

Definition at line 124 of file BlockFrequency.cpp.

BlockFrequency & BlockFrequency::operator/= ( const BranchProbability Prob)

Divide by a non-zero branch probability using saturating arithmetic.

Definition at line 119 of file BlockFrequency.cpp.

References llvm::BranchProbability::getDenominator(), and llvm::BranchProbability::getNumerator().

bool llvm::BlockFrequency::operator< ( const BlockFrequency RHS) const
inline

Definition at line 66 of file BlockFrequency.h.

bool llvm::BlockFrequency::operator<= ( const BlockFrequency RHS) const
inline

Definition at line 70 of file BlockFrequency.h.

bool llvm::BlockFrequency::operator> ( const BlockFrequency RHS) const
inline

Definition at line 74 of file BlockFrequency.h.

bool llvm::BlockFrequency::operator>= ( const BlockFrequency RHS) const
inline

Definition at line 78 of file BlockFrequency.h.

void BlockFrequency::print ( raw_ostream OS) const
uint32_t BlockFrequency::scale ( const BranchProbability Prob)

Scale the given BlockFrequency by N/D. Return the remainder from the division by D. Upon overflow, the routine will saturate.

Definition at line 148 of file BlockFrequency.cpp.

References llvm::BranchProbability::getDenominator(), and llvm::BranchProbability::getNumerator().


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