|
LLVM
10.0.0
|
Mass of a block. More...
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
Public Member Functions | |
| BlockMass ()=default | |
| BlockMass (uint64_t Mass) | |
| uint64_t | getMass () const |
| bool | isFull () const |
| bool | isEmpty () const |
| bool | operator! () const |
| BlockMass & | operator+= (BlockMass X) |
| Add another mass. More... | |
| BlockMass & | operator-= (BlockMass X) |
| Subtract another mass. More... | |
| BlockMass & | operator*= (BranchProbability P) |
| bool | operator== (BlockMass X) const |
| bool | operator!= (BlockMass X) const |
| bool | operator<= (BlockMass X) const |
| bool | operator>= (BlockMass X) const |
| bool | operator< (BlockMass X) const |
| bool | operator> (BlockMass X) const |
| ScaledNumber< uint64_t > | toScaled () const |
| Convert to scaled number. More... | |
| void | dump () const |
| raw_ostream & | print (raw_ostream &OS) const |
Static Public Member Functions | |
| static BlockMass | getEmpty () |
| static BlockMass | getFull () |
Mass of a block.
This class implements a sort of fixed-point fraction always between 0.0 and 1.0. getMass() == std::numeric_limits<uint64_t>::max() indicates a value of 1.0.
Masses can be added and subtracted. Simple saturation arithmetic is used, so arithmetic operations never overflow or underflow.
Masses can be multiplied. Multiplication treats full mass as 1.0 and uses an inexpensive floating-point algorithm that's off-by-one (almost, but not quite, maximum precision).
Masses can be scaled by BranchProbability at maximum precision.
Definition at line 82 of file BlockFrequencyInfoImpl.h.
|
default |
Referenced by getEmpty(), getFull(), llvm::bfi_detail::operator*(), llvm::bfi_detail::operator+(), and llvm::bfi_detail::operator-().
|
inlineexplicit |
Definition at line 87 of file BlockFrequencyInfoImpl.h.
| LLVM_DUMP_METHOD void BlockMass::dump | ( | ) | const |
Definition at line 50 of file BlockFrequencyInfoImpl.cpp.
References llvm::dbgs(), and print().
Referenced by llvm::BlockFrequencyInfoImplBase::finalizeMetrics(), and operator>().
|
inlinestatic |
Definition at line 89 of file BlockFrequencyInfoImpl.h.
References BlockMass().
Referenced by llvm::bfi_detail::IrreducibleGraph::addNode(), and llvm::BlockFrequencyInfoImplBase::updateLoopWithIrreducible().
|
inlinestatic |
Definition at line 91 of file BlockFrequencyInfoImpl.h.
References BlockMass(), and llvm::max().
Referenced by llvm::BlockFrequencyInfoImplBase::adjustLoopHeaderMass(), llvm::BlockFrequencyInfoImplBase::computeLoopScale(), and llvm::BlockFrequencyInfoImplBase::distributeIrrLoopHeaderMass().
|
inline |
Definition at line 95 of file BlockFrequencyInfoImpl.h.
Referenced by llvm::BlockFrequencyInfoImplBase::distributeMass(), and toScaled().
|
inline |
Definition at line 98 of file BlockFrequencyInfoImpl.h.
Referenced by llvm::BlockFrequencyInfoImplBase::computeLoopScale(), and operator!().
|
inline |
Definition at line 97 of file BlockFrequencyInfoImpl.h.
References llvm::max().
Referenced by toScaled().
|
inline |
Definition at line 100 of file BlockFrequencyInfoImpl.h.
References isEmpty().
|
inline |
Definition at line 127 of file BlockFrequencyInfoImpl.h.
|
inline |
Definition at line 121 of file BlockFrequencyInfoImpl.h.
References llvm::BranchProbability::scale().
Add another mass.
Adds another mass, saturating at isFull() rather than overflowing.
Definition at line 105 of file BlockFrequencyInfoImpl.h.
References llvm::max().
Subtract another mass.
Subtracts another mass, saturating at isEmpty() rather than undeflowing.
Definition at line 115 of file BlockFrequencyInfoImpl.h.
Definition at line 130 of file BlockFrequencyInfoImpl.h.
Definition at line 128 of file BlockFrequencyInfoImpl.h.
Definition at line 126 of file BlockFrequencyInfoImpl.h.
Definition at line 131 of file BlockFrequencyInfoImpl.h.
References dump(), print(), and toScaled().
Definition at line 129 of file BlockFrequencyInfoImpl.h.
| raw_ostream & BlockMass::print | ( | raw_ostream & | OS | ) | const |
Definition at line 60 of file BlockFrequencyInfoImpl.cpp.
References add(), assert(), and getHexDigit().
Referenced by dump(), llvm::BlockFrequencyInfoImplBase::dump(), llvm::BlockFrequencyInfoImpl< llvm::BitTracker >::getBPI(), llvm::bfi_detail::operator<<(), and operator>().
| ScaledNumber< uint64_t > BlockMass::toScaled | ( | ) | const |
Convert to scaled number.
Convert to ScaledNumber. isFull() gives 1.0, while isEmpty() gives slightly above 0.0.
Definition at line 43 of file BlockFrequencyInfoImpl.cpp.
References getMass(), and isFull().
Referenced by llvm::BlockFrequencyInfoImplBase::computeLoopScale(), operator>(), and llvm::BlockFrequencyInfoImplBase::unwrapLoops().
1.8.13