LLVM  8.0.1
Public Member Functions | Static Public Member Functions | List of all members
llvm::BlockFrequency Class Reference

#include "llvm/Support/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*= (BranchProbability Prob)
 Multiplies with a branch probability. More...
 
BlockFrequency operator* (BranchProbability Prob) const
 
BlockFrequencyoperator/= (BranchProbability Prob)
 Divide by a non-zero branch probability using saturating arithmetic. More...
 
BlockFrequency operator/ (BranchProbability Prob) const
 
BlockFrequencyoperator+= (BlockFrequency Freq)
 Adds another block frequency using saturating arithmetic. More...
 
BlockFrequency operator+ (BlockFrequency Freq) const
 
BlockFrequencyoperator-= (BlockFrequency Freq)
 Subtracts another block frequency using saturating arithmetic. More...
 
BlockFrequency operator- (BlockFrequency Freq) const
 
BlockFrequencyoperator>>= (const unsigned count)
 Shift block frequency to the right by count digits saturating to 1. More...
 
bool operator< (BlockFrequency RHS) const
 
bool operator<= (BlockFrequency RHS) const
 
bool operator> (BlockFrequency RHS) const
 
bool operator>= (BlockFrequency RHS) const
 
bool operator== (BlockFrequency RHS) const
 

Static Public Member Functions

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

◆ BlockFrequency()

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

Definition at line 29 of file BlockFrequency.h.

Member Function Documentation

◆ getFrequency()

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

◆ getMaxFrequency()

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

Returns the maximum possible frequency, the saturation value.

Definition at line 32 of file BlockFrequency.h.

Referenced by llvm::SpillPlacement::Node::addBias(), and getLayoutSuccessorProbThreshold().

◆ operator*()

BlockFrequency BlockFrequency::operator* ( BranchProbability  Prob) const

Definition at line 24 of file BlockFrequency.cpp.

Referenced by getFrequency().

◆ operator*=()

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

Multiplies with a branch probability.

The computation will never overflow.

Definition at line 19 of file BlockFrequency.cpp.

References llvm::BranchProbability::scale().

Referenced by getFrequency().

◆ operator+()

BlockFrequency BlockFrequency::operator+ ( BlockFrequency  Freq) const

Definition at line 52 of file BlockFrequency.cpp.

Referenced by getFrequency().

◆ operator+=()

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

Adds another block frequency using saturating arithmetic.

Definition at line 41 of file BlockFrequency.cpp.

References UINT64_MAX.

Referenced by getFrequency().

◆ operator-()

BlockFrequency BlockFrequency::operator- ( BlockFrequency  Freq) const

Definition at line 67 of file BlockFrequency.cpp.

Referenced by getFrequency().

◆ operator-=()

BlockFrequency & BlockFrequency::operator-= ( BlockFrequency  Freq)

Subtracts another block frequency using saturating arithmetic.

Definition at line 58 of file BlockFrequency.cpp.

Referenced by getFrequency().

◆ operator/()

BlockFrequency BlockFrequency::operator/ ( BranchProbability  Prob) const

Definition at line 35 of file BlockFrequency.cpp.

Referenced by getFrequency().

◆ operator/=()

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

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

Definition at line 30 of file BlockFrequency.cpp.

References llvm::BranchProbability::scaleByInverse().

Referenced by getFrequency().

◆ operator<()

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

Definition at line 59 of file BlockFrequency.h.

◆ operator<=()

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

Definition at line 63 of file BlockFrequency.h.

◆ operator==()

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

Definition at line 75 of file BlockFrequency.h.

◆ operator>()

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

Definition at line 67 of file BlockFrequency.h.

◆ operator>=()

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

Definition at line 71 of file BlockFrequency.h.

◆ operator>>=()

BlockFrequency & BlockFrequency::operator>>= ( const unsigned  count)

Shift block frequency to the right by count digits saturating to 1.

Definition at line 73 of file BlockFrequency.cpp.

References assert(), and llvm::count().

Referenced by getFrequency().


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