LLVM 18.0.0git
|
#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. | |
BlockFrequency & | operator*= (BranchProbability Prob) |
Multiplies with a branch probability. | |
BlockFrequency | operator* (BranchProbability Prob) const |
BlockFrequency & | operator/= (BranchProbability Prob) |
Divide by a non-zero branch probability using saturating arithmetic. | |
BlockFrequency | operator/ (BranchProbability Prob) const |
BlockFrequency & | operator+= (BlockFrequency Freq) |
Adds another block frequency using saturating arithmetic. | |
BlockFrequency | operator+ (BlockFrequency Freq) const |
BlockFrequency & | operator-= (BlockFrequency Freq) |
Subtracts another block frequency using saturating arithmetic. | |
BlockFrequency | operator- (BlockFrequency Freq) const |
std::optional< BlockFrequency > | mul (uint64_t Factor) const |
Multiplies frequency with Factor . Returns nullopt in case of overflow. | |
BlockFrequency & | operator>>= (const unsigned count) |
Shift block frequency to the right by count digits saturating to 1. | |
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. | |
Definition at line 25 of file BlockFrequency.h.
|
inline |
Definition at line 29 of file BlockFrequency.h.
|
inline |
Returns the frequency as a fixpoint number scaled by the entry frequency.
Definition at line 36 of file BlockFrequency.h.
Referenced by llvm::CFGMST< Edge, BBInfo >::buildEdges(), llvm::CodeExtractor::extractCodeRegion(), llvm::RegBankSelect::MBBInsertPoint::frequency(), llvm::RegBankSelect::EdgeInsertPoint::frequency(), llvm::MachineBlockFrequencyInfo::getBlockFreqRelativeToEntryBlock(), llvm::InlineFunction(), llvm::ProfileSummaryInfo::isColdBlock(), llvm::BlockFrequencyInfoImplBase::printBlockFreq(), llvm::SplitIndirectBrCriticalEdges(), and updateCallerBFI().
|
inlinestatic |
Returns the maximum possible frequency, the saturation value.
Definition at line 32 of file BlockFrequency.h.
References UINT64_MAX.
Referenced by llvm::SpillPlacement::Node::addBias().
std::optional< BlockFrequency > BlockFrequency::mul | ( | uint64_t | Factor | ) | const |
Multiplies frequency with Factor
. Returns nullopt
in case of overflow.
Definition at line 41 of file BlockFrequency.cpp.
References llvm::SaturatingMultiply().
BlockFrequency BlockFrequency::operator* | ( | BranchProbability | Prob | ) | const |
Definition at line 24 of file BlockFrequency.cpp.
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().
|
inline |
Definition at line 59 of file BlockFrequency.h.
|
inline |
Adds another block frequency using saturating arithmetic.
Definition at line 49 of file BlockFrequency.h.
References Before, and UINT64_MAX.
|
inline |
Definition at line 74 of file BlockFrequency.h.
|
inline |
Subtracts another block frequency using saturating arithmetic.
Definition at line 66 of file BlockFrequency.h.
BlockFrequency BlockFrequency::operator/ | ( | BranchProbability | Prob | ) | const |
Definition at line 35 of file BlockFrequency.cpp.
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().
|
inline |
Definition at line 96 of file BlockFrequency.h.
References RHS.
|
inline |
Definition at line 100 of file BlockFrequency.h.
References RHS.
|
inline |
Definition at line 112 of file BlockFrequency.h.
References RHS.
|
inline |
Definition at line 104 of file BlockFrequency.h.
References RHS.
|
inline |
Definition at line 108 of file BlockFrequency.h.
References RHS.
|
inline |
Shift block frequency to the right by count digits saturating to 1.
Definition at line 84 of file BlockFrequency.h.
References assert(), and llvm::count().