14 #ifndef LLVM_ANALYSIS_BRANCHPROBABILITYINFO_H
15 #define LLVM_ANALYSIS_BRANCHPROBABILITYINFO_H
58 unsigned IndexInSuccessors)
const;
93 unsigned IndexInSuccessors)
const;
113 typedef std::pair<const BasicBlock *, unsigned> Edge;
121 static const uint32_t DEFAULT_WEIGHT = 16;
138 uint32_t getSumForBlock(
const BasicBlock *BB)
const;
140 bool calcUnreachableHeuristics(
BasicBlock *BB);
144 bool calcLoopBranchHeuristics(
BasicBlock *BB);
146 bool calcFloatingPointHeuristics(
BasicBlock *BB);
static PassRegistry * getPassRegistry()
raw_ostream & printEdgeProbability(raw_ostream &OS, const BasicBlock *Src, const BasicBlock *Dst) const
Print an edge's probability.
The main container class for the LLVM Intermediate Representation.
BasicBlock * getHotSucc(BasicBlock *BB) const
Retrieve the hot successor of a block if one exists.
void initializeBranchProbabilityInfoPass(PassRegistry &)
void print(raw_ostream &OS, const Module *M=0) const
LLVM Basic Block Representation.
void setEdgeWeight(const BasicBlock *Src, unsigned IndexInSuccessors, uint32_t Weight)
Set the raw edge weight for a given edge.
bool isEdgeHot(const BasicBlock *Src, const BasicBlock *Dst) const
Test if an edge is hot relative to other out-edges of the Src.
void getAnalysisUsage(AnalysisUsage &AU) const
Analysis pass providing branch probability information.
bool runOnFunction(Function &F)
BranchProbability getEdgeProbability(const BasicBlock *Src, unsigned IndexInSuccessors) const
Get an edge's probability, relative to other out-edges of the Src.
uint32_t getEdgeWeight(const BasicBlock *Src, unsigned IndexInSuccessors) const
Get the raw edge weight calculated for the edge.