LLVM API Documentation
#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... | |
BlockFrequency & | operator*= (const BranchProbability &Prob) |
Multiplies with a branch probability. The computation will never overflow. More... | |
const BlockFrequency | operator* (const BranchProbability &Prob) const |
BlockFrequency & | operator/= (const BranchProbability &Prob) |
Divide by a non-zero branch probability using saturating arithmetic. More... | |
BlockFrequency | operator/ (const BranchProbability &Prob) const |
BlockFrequency & | operator+= (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... | |
Definition at line 25 of file BlockFrequency.h.
|
inline |
Definition at line 36 of file BlockFrequency.h.
|
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().
|
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().
|
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().
|
inline |
Definition at line 66 of file BlockFrequency.h.
|
inline |
Definition at line 70 of file BlockFrequency.h.
|
inline |
Definition at line 74 of file BlockFrequency.h.
|
inline |
Definition at line 78 of file BlockFrequency.h.
void BlockFrequency::print | ( | raw_ostream & | OS | ) | const |
Definition at line 152 of file BlockFrequency.cpp.
References getEntryFrequency().
Referenced by llvm::DOTGraphTraits< BlockFrequencyInfo * >::getNodeLabel(), and llvm::operator<<().
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().