LLVM API Documentation
Distribution of unscaled probability weight. More...
#include <BlockFrequencyInfoImpl.h>
Public Types | |
typedef SmallVector< Weight, 4 > | WeightList |
Public Member Functions | |
Distribution () | |
void | addLocal (const BlockNode &Node, uint64_t Amount) |
void | addExit (const BlockNode &Node, uint64_t Amount) |
void | addBackedge (const BlockNode &Node, uint64_t Amount) |
void | normalize () |
Normalize the distribution. | |
Public Attributes | |
WeightList | Weights |
Individual successor weights. | |
uint64_t | Total |
Sum of all weights. | |
bool | DidOverflow |
Whether Total did overflow. |
Distribution of unscaled probability weight.
Distribution of unscaled probability weight to a set of successors.
This class collates the successor edge weights for later processing.
DidOverflow indicates whether Total did overflow while adding to the distribution. It should never overflow twice.
Definition at line 337 of file BlockFrequencyInfoImpl.h.
Definition at line 338 of file BlockFrequencyInfoImpl.h.
Definition at line 343 of file BlockFrequencyInfoImpl.h.
void llvm::BlockFrequencyInfoImplBase::Distribution::addBackedge | ( | const BlockNode & | Node, |
uint64_t | Amount | ||
) | [inline] |
Definition at line 350 of file BlockFrequencyInfoImpl.h.
References llvm::BlockFrequencyInfoImplBase::Weight::Backedge.
Referenced by llvm::BlockFrequencyInfoImplBase::addToDist().
void llvm::BlockFrequencyInfoImplBase::Distribution::addExit | ( | const BlockNode & | Node, |
uint64_t | Amount | ||
) | [inline] |
Definition at line 347 of file BlockFrequencyInfoImpl.h.
References llvm::BlockFrequencyInfoImplBase::Weight::Exit.
Referenced by llvm::BlockFrequencyInfoImplBase::addToDist().
void llvm::BlockFrequencyInfoImplBase::Distribution::addLocal | ( | const BlockNode & | Node, |
uint64_t | Amount | ||
) | [inline] |
Definition at line 344 of file BlockFrequencyInfoImpl.h.
References llvm::BlockFrequencyInfoImplBase::Weight::Local.
Referenced by llvm::BlockFrequencyInfoImplBase::addToDist().
void Distribution::normalize | ( | ) |
Normalize the distribution.
Combines multiple edges to the same Weight::TargetNode and scales down so that Total fits into 32-bits.
This is linear in the size of Weights. For the vast majority of cases, adjacent edge weights are combined by sorting WeightList and combining adjacent weights. However, for very large edge lists an auxiliary hash table is used.
Definition at line 183 of file BlockFrequencyInfoImpl.cpp.
References combineWeights(), llvm::countLeadingZeros(), and shiftRightAndRound().
Whether Total did overflow.
Definition at line 341 of file BlockFrequencyInfoImpl.h.
Sum of all weights.
Definition at line 340 of file BlockFrequencyInfoImpl.h.
Individual successor weights.
Definition at line 339 of file BlockFrequencyInfoImpl.h.
Referenced by llvm::BlockFrequencyInfoImplBase::distributeMass().