LLVM API Documentation
#include <ProfileInfo.h>

Public Types | |
| enum | GetPathMode { GetPathToExit = 1, GetPathToValue = 2, GetPathToDest = 4, GetPathWithNewEdges = 8 } |
| typedef std::pair< const BType *, const BType * > | Edge |
| typedef std::pair< Edge, double > | EdgeWeight |
| typedef std::map< Edge, double > | EdgeWeights |
| typedef std::map< const BType *, double > | BlockCounts |
| typedef std::map< const BType *, const BType * > | Path |
Public Member Functions | |
| ProfileInfoT () | |
| ~ProfileInfoT () | |
| double | getExecutionCount (const FType *F) |
| double | getExecutionCount (const BType *BB) |
| void | setExecutionCount (const BType *BB, double w) |
| void | addExecutionCount (const BType *BB, double w) |
| double | getEdgeWeight (Edge e) const |
| void | setEdgeWeight (Edge e, double w) |
| void | addEdgeWeight (Edge e, double w) |
| EdgeWeights & | getEdgeWeights (const FType *F) |
| void | removeBlock (const BType *BB) |
| void | removeEdge (Edge e) |
| void | replaceEdge (const Edge &, const Edge &) |
| const BType * | GetPath (const BType *Src, const BType *Dest, Path &P, unsigned Mode) |
| void | divertFlow (const Edge &, const Edge &) |
| void | splitEdge (const BType *FirstBB, const BType *SecondBB, const BType *NewBB, bool MergeIdenticalEdges=false) |
| void | splitBlock (const BType *Old, const BType *New) |
| void | splitBlock (const BType *BB, const BType *NewBB, BType *const *Preds, unsigned NumPreds) |
| void | replaceAllUses (const BType *RmBB, const BType *DestBB) |
| void | transfer (const FType *Old, const FType *New) |
| void | repair (const FType *F) |
| void | dump (FType *F=0, bool real=true) |
| bool | CalculateMissingEdge (const BType *BB, Edge &removed, bool assumeEmptyExit=false) |
| bool | EstimateMissingEdges (const BType *BB) |
| ProfileInfoT< MachineFunction, MachineBasicBlock > * | MI () |
| bool | hasMI () const |
| template<> | |
| char | ID |
| template<> | |
| ProfileInfoT () | |
| template<> | |
| ~ProfileInfoT () | |
| template<> | |
| ProfileInfoT () | |
| template<> | |
| ~ProfileInfoT () | |
| template<> | |
| char | ID = 0 |
| template<> | |
| const double | MissingValue |
| template<> | |
| const double | MissingValue |
| template<> | |
| double | getExecutionCount (const BasicBlock *BB) |
| template<> | |
| double | getExecutionCount (const MachineBasicBlock *MBB) |
| template<> | |
| double | getExecutionCount (const Function *F) |
| template<> | |
| double | getExecutionCount (const MachineFunction *MF) |
| template<> | |
| void | setExecutionCount (const BasicBlock *BB, double w) |
| template<> | |
| void | setExecutionCount (const MachineBasicBlock *MBB, double w) |
| template<> | |
| void | addEdgeWeight (Edge e, double w) |
| template<> | |
| void | addExecutionCount (const BasicBlock *BB, double w) |
| template<> | |
| void | removeBlock (const BasicBlock *BB) |
| template<> | |
| void | removeEdge (Edge e) |
| template<> | |
| void | replaceEdge (const Edge &oldedge, const Edge &newedge) |
| template<> | |
| const BasicBlock * | GetPath (const BasicBlock *Src, const BasicBlock *Dest, Path &P, unsigned Mode) |
| template<> | |
| void | divertFlow (const Edge &oldedge, const Edge &newedge) |
| template<> | |
| void | replaceAllUses (const BasicBlock *RmBB, const BasicBlock *DestBB) |
| template<> | |
| void | splitEdge (const BasicBlock *FirstBB, const BasicBlock *SecondBB, const BasicBlock *NewBB, bool MergeIdenticalEdges) |
| template<> | |
| void | splitBlock (const BasicBlock *Old, const BasicBlock *New) |
| template<> | |
| void | splitBlock (const BasicBlock *BB, const BasicBlock *NewBB, BasicBlock *const *Preds, unsigned NumPreds) |
| template<> | |
| void | transfer (const Function *Old, const Function *New) |
| template<> | |
| bool | CalculateMissingEdge (const BasicBlock *BB, Edge &removed, bool assumeEmptySelf) |
| template<> | |
| bool | EstimateMissingEdges (const BasicBlock *BB) |
| template<> | |
| void | repair (const Function *F) |
Static Public Member Functions | |
| static const FType * | getFunction (Edge e) |
| static Edge | getEdge (const BType *Src, const BType *Dest) |
Static Public Attributes | |
| static char | ID |
| static const double | MissingValue |
Protected Attributes | |
| std::map< const FType *, EdgeWeights > | EdgeInformation |
| std::map< const FType *, BlockCounts > | BlockInformation |
| std::map< const FType *, double > | FunctionInformation |
| ProfileInfoT< MachineFunction, MachineBasicBlock > * | MachineProfile |
ProfileInfo Class - This class holds and maintains profiling information for some unit of code.
Definition at line 55 of file ProfileInfo.h.
| typedef std::map<const BType*, double> llvm::ProfileInfoT< FType, BType >::BlockCounts |
Definition at line 61 of file ProfileInfo.h.
| typedef std::pair<const BType*, const BType*> llvm::ProfileInfoT< FType, BType >::Edge |
Definition at line 58 of file ProfileInfo.h.
| typedef std::pair<Edge, double> llvm::ProfileInfoT< FType, BType >::EdgeWeight |
Definition at line 59 of file ProfileInfo.h.
| typedef std::map<Edge, double> llvm::ProfileInfoT< FType, BType >::EdgeWeights |
Definition at line 60 of file ProfileInfo.h.
| typedef std::map<const BType*, const BType*> llvm::ProfileInfoT< FType, BType >::Path |
Definition at line 62 of file ProfileInfo.h.
| enum llvm::ProfileInfoT::GetPathMode |
Definition at line 145 of file ProfileInfo.h.
| llvm::ProfileInfoT< FType, BType >::ProfileInfoT | ( | ) |
| llvm::ProfileInfoT< FType, BType >::~ProfileInfoT | ( | ) |
| llvm::ProfileInfoT< MachineFunction, MachineBasicBlock >::ProfileInfoT | ( | ) |
Definition at line 37 of file ProfileInfo.cpp.
| llvm::ProfileInfoT< MachineFunction, MachineBasicBlock >::~ProfileInfoT | ( | ) |
Definition at line 39 of file ProfileInfo.cpp.
| llvm::ProfileInfoT< Function, BasicBlock >::ProfileInfoT | ( | ) |
Definition at line 42 of file ProfileInfo.cpp.
| llvm::ProfileInfoT< Function, BasicBlock >::~ProfileInfoT | ( | ) |
Definition at line 46 of file ProfileInfo.cpp.
| void llvm::ProfileInfoT< FType, BType >::addEdgeWeight | ( | Edge | e, |
| double | w | ||
| ) |
| void llvm::ProfileInfoT< Function, BasicBlock >::addEdgeWeight | ( | Edge | e, |
| double | w | ||
| ) |
Definition at line 183 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, and llvm::format().
| void llvm::ProfileInfoT< FType, BType >::addExecutionCount | ( | const BType * | BB, |
| double | w | ||
| ) |
| void llvm::ProfileInfoT< Function, BasicBlock >::addExecutionCount | ( | const BasicBlock * | BB, |
| double | w | ||
| ) |
Definition at line 193 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, llvm::format(), llvm::Value::getName(), and llvm::BasicBlock::getParent().
| bool llvm::ProfileInfoT< FType, BType >::CalculateMissingEdge | ( | const BType * | BB, |
| Edge & | removed, | ||
| bool | assumeEmptyExit = false |
||
| ) |
| bool llvm::ProfileInfoT< Function, BasicBlock >::CalculateMissingEdge | ( | const BasicBlock * | BB, |
| Edge & | removed, | ||
| bool | assumeEmptySelf | ||
| ) |
Definition at line 505 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, llvm::format(), llvm::BasicBlock::getParent(), llvm::SmallSet< T, N, C >::insert(), llvm::pred_begin(), llvm::pred_end(), llvm::readEdgeOrRemember(), llvm::succ_begin(), and llvm::succ_end().
| void llvm::ProfileInfoT< FType, BType >::divertFlow | ( | const Edge & | , |
| const Edge & | |||
| ) |
| void llvm::ProfileInfoT< Function, BasicBlock >::divertFlow | ( | const Edge & | oldedge, |
| const Edge & | newedge | ||
| ) |
Definition at line 282 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, llvm::format(), and P.
| void llvm::ProfileInfoT< FType, BType >::dump | ( | FType * | F = 0, |
| bool | real = true |
||
| ) | [inline] |
Definition at line 171 of file ProfileInfo.h.
References llvm::ProfileInfoT< FType, BType >::BlockInformation, llvm::dbgs(), llvm::ProfileInfoT< FType, BType >::EdgeInformation, F(), llvm::format(), llvm::ProfileInfoT< FType, BType >::FunctionInformation, and llvm::ProfileInfoT< FType, BType >::getExecutionCount().
| bool llvm::ProfileInfoT< FType, BType >::EstimateMissingEdges | ( | const BType * | BB | ) |
| bool llvm::ProfileInfoT< Function, BasicBlock >::EstimateMissingEdges | ( | const BasicBlock * | BB | ) |
Definition at line 582 of file ProfileInfo.cpp.
References llvm::pred_begin(), llvm::pred_end(), llvm::readEdge(), llvm::succ_begin(), and llvm::succ_end().
| static Edge llvm::ProfileInfoT< FType, BType >::getEdge | ( | const BType * | Src, |
| const BType * | Dest | ||
| ) | [inline, static] |
Definition at line 97 of file ProfileInfo.h.
Referenced by llvm::MergeBasicBlockIntoOnlyPred().
| double llvm::ProfileInfoT< FType, BType >::getEdgeWeight | ( | Edge | e | ) | const [inline] |
Definition at line 112 of file ProfileInfo.h.
References llvm::ProfileInfoT< FType, BType >::EdgeInformation, llvm::ProfileInfoT< FType, BType >::getFunction(), I, and llvm::ProfileInfoT< FType, BType >::MissingValue().
Referenced by llvm::readEdge().
| EdgeWeights& llvm::ProfileInfoT< FType, BType >::getEdgeWeights | ( | const FType * | F | ) | [inline] |
Definition at line 132 of file ProfileInfo.h.
References llvm::ProfileInfoT< FType, BType >::EdgeInformation, and F().
| double llvm::ProfileInfoT< Function, BasicBlock >::getExecutionCount | ( | const BasicBlock * | BB | ) |
Definition at line 60 of file ProfileInfo.cpp.
References llvm::BasicBlock::getParent(), I, P, llvm::pred_begin(), llvm::pred_end(), llvm::succ_begin(), and llvm::succ_end().
| double llvm::ProfileInfoT< FType, BType >::getExecutionCount | ( | const FType * | F | ) |
Profile Information Queries
Referenced by llvm::ProfileInfoT< FType, BType >::dump().
| double llvm::ProfileInfoT< FType, BType >::getExecutionCount | ( | const BType * | BB | ) |
| double llvm::ProfileInfoT< MachineFunction, MachineBasicBlock >::getExecutionCount | ( | const MachineBasicBlock * | MBB | ) |
Definition at line 125 of file ProfileInfo.cpp.
References llvm::MachineBasicBlock::getParent(), and I.
| double llvm::ProfileInfoT< Function, BasicBlock >::getExecutionCount | ( | const Function * | F | ) |
Definition at line 138 of file ProfileInfo.cpp.
References F(), llvm::Function::getEntryBlock(), if(), and llvm::GlobalValue::isDeclaration().
| double llvm::ProfileInfoT< MachineFunction, MachineBasicBlock >::getExecutionCount | ( | const MachineFunction * | MF | ) |
Definition at line 155 of file ProfileInfo.cpp.
References llvm::MachineFunction::front().
| static const FType* llvm::ProfileInfoT< FType, BType >::getFunction | ( | Edge | e | ) | [inline, static] |
Definition at line 88 of file ProfileInfo.h.
References llvm_unreachable.
Referenced by llvm::ProfileInfoT< FType, BType >::getEdgeWeight(), and llvm::ProfileInfoT< FType, BType >::setEdgeWeight().
| const BType* llvm::ProfileInfoT< FType, BType >::GetPath | ( | const BType * | Src, |
| const BType * | Dest, | ||
| Path & | P, | ||
| unsigned | Mode | ||
| ) |
| const BasicBlock * llvm::ProfileInfoT< Function, BasicBlock >::GetPath | ( | const BasicBlock * | Src, |
| const BasicBlock * | Dest, | ||
| Path & | P, | ||
| unsigned | Mode | ||
| ) |
Definition at line 238 of file ProfileInfo.cpp.
References llvm::BasicBlock::front(), llvm::succ_begin(), and llvm::succ_end().
| bool llvm::ProfileInfoT< FType, BType >::hasMI | ( | ) | const [inline] |
Definition at line 232 of file ProfileInfo.h.
References llvm::ProfileInfoT< FType, BType >::MachineProfile.
| char llvm::ProfileInfoT< Function, BasicBlock >::ID | ( | ) |
Definition at line 28 of file ProfileInfo.cpp.
| char SingleLoopExtractor::ID | ( | ) | = 0 |
Definition at line 51 of file ProfileInfo.cpp.
| ProfileInfoT<MachineFunction, MachineBasicBlock>* llvm::ProfileInfoT< FType, BType >::MI | ( | ) | [inline] |
Definition at line 226 of file ProfileInfo.h.
References llvm::ProfileInfoT< FType, BType >::MachineProfile.
| const double llvm::ProfileInfoT< Function, BasicBlock >::MissingValue | ( | ) |
Definition at line 54 of file ProfileInfo.cpp.
Referenced by llvm::ProfileInfoT< FType, BType >::getEdgeWeight(), ignoreMissing(), llvm::readEdge(), llvm::readEdgeOrRemember(), and llvm::ProfileInfoT< FType, BType >::splitEdge().
| const double llvm::ProfileInfoT< MachineFunction, MachineBasicBlock >::MissingValue | ( | ) |
Definition at line 57 of file ProfileInfo.cpp.
| void llvm::ProfileInfoT< FType, BType >::removeBlock | ( | const BType * | BB | ) |
Analysis Update Methods
| void llvm::ProfileInfoT< Function, BasicBlock >::removeBlock | ( | const BasicBlock * | BB | ) |
Definition at line 202 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, llvm::Value::getName(), and llvm::BasicBlock::getParent().
| void llvm::ProfileInfoT< FType, BType >::removeEdge | ( | Edge | e | ) |
Referenced by llvm::MergeBasicBlockIntoOnlyPred().
| void llvm::ProfileInfoT< Function, BasicBlock >::removeEdge | ( | Edge | e | ) |
Definition at line 212 of file ProfileInfo.cpp.
References llvm::dbgs(), and DEBUG.
| void llvm::ProfileInfoT< FType, BType >::repair | ( | const FType * | F | ) |
| void llvm::ProfileInfoT< Function, BasicBlock >::repair | ( | const Function * | F | ) |
Definition at line 635 of file ProfileInfo.cpp.
References llvm::BasicBlock::begin(), llvm::dbgs(), llvm::sys::path::end(), llvm::errs(), F(), llvm::BasicBlock::front(), llvm::Function::getEntryBlock(), llvm::Value::getName(), P, llvm::pred_begin(), llvm::pred_end(), llvm::succ_begin(), and llvm::succ_end().
| void llvm::ProfileInfoT< FType, BType >::replaceAllUses | ( | const BType * | RmBB, |
| const BType * | DestBB | ||
| ) |
Referenced by llvm::MergeBasicBlockIntoOnlyPred().
| void llvm::ProfileInfoT< Function, BasicBlock >::replaceAllUses | ( | const BasicBlock * | RmBB, |
| const BasicBlock * | DestBB | ||
| ) |
Replaces all occurrences of RmBB in the ProfilingInfo with DestBB. This checks all edges of the function the blocks reside in and replaces the occurrences of RmBB with DestBB.
Definition at line 317 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, F(), llvm::Value::getName(), llvm::BasicBlock::getParent(), and I.
| void llvm::ProfileInfoT< FType, BType >::replaceEdge | ( | const Edge & | , |
| const Edge & | |||
| ) |
| void llvm::ProfileInfoT< Function, BasicBlock >::replaceEdge | ( | const Edge & | oldedge, |
| const Edge & | newedge | ||
| ) |
Definition at line 223 of file ProfileInfo.cpp.
References llvm::dbgs(), and DEBUG.
| void llvm::ProfileInfoT< FType, BType >::setEdgeWeight | ( | Edge | e, |
| double | w | ||
| ) | [inline] |
Definition at line 123 of file ProfileInfo.h.
References llvm::dbgs(), DEBUG_WITH_TYPE, llvm::ProfileInfoT< FType, BType >::EdgeInformation, llvm::format(), and llvm::ProfileInfoT< FType, BType >::getFunction().
| void llvm::ProfileInfoT< FType, BType >::setExecutionCount | ( | const BType * | BB, |
| double | w | ||
| ) |
| void llvm::ProfileInfoT< Function, BasicBlock >::setExecutionCount | ( | const BasicBlock * | BB, |
| double | w | ||
| ) |
Definition at line 168 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, llvm::format(), llvm::Value::getName(), and llvm::BasicBlock::getParent().
| void llvm::ProfileInfoT< MachineFunction, MachineBasicBlock >::setExecutionCount | ( | const MachineBasicBlock * | MBB, |
| double | w | ||
| ) |
Definition at line 176 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, llvm::format(), llvm::MachineBasicBlock::getBasicBlock(), llvm::Value::getName(), and llvm::MachineBasicBlock::getParent().
| void llvm::ProfileInfoT< FType, BType >::splitBlock | ( | const BType * | Old, |
| const BType * | New | ||
| ) |
| void llvm::ProfileInfoT< FType, BType >::splitBlock | ( | const BType * | BB, |
| const BType * | NewBB, | ||
| BType *const * | Preds, | ||
| unsigned | NumPreds | ||
| ) |
| void llvm::ProfileInfoT< Function, BasicBlock >::splitBlock | ( | const BasicBlock * | Old, |
| const BasicBlock * | New | ||
| ) |
Definition at line 412 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, F(), llvm::Value::getName(), and llvm::BasicBlock::getParent().
| void llvm::ProfileInfoT< Function, BasicBlock >::splitBlock | ( | const BasicBlock * | BB, |
| const BasicBlock * | NewBB, | ||
| BasicBlock *const * | Preds, | ||
| unsigned | NumPreds | ||
| ) |
Definition at line 441 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, F(), llvm::Value::getName(), and llvm::BasicBlock::getParent().
| void llvm::ProfileInfoT< FType, BType >::splitEdge | ( | const BType * | FirstBB, |
| const BType * | SecondBB, | ||
| const BType * | NewBB, | ||
| bool | MergeIdenticalEdges = false |
||
| ) |
| void llvm::ProfileInfoT< Function, BasicBlock >::splitEdge | ( | const BasicBlock * | FirstBB, |
| const BasicBlock * | SecondBB, | ||
| const BasicBlock * | NewBB, | ||
| bool | MergeIdenticalEdges | ||
| ) |
Splits an edge in the ProfileInfo and redirects flow over NewBB. Since its possible that there is more than one edge in the CFG from FristBB to SecondBB its necessary to redirect the flow proporionally.
Definition at line 366 of file ProfileInfo.cpp.
References F(), llvm::LibFunc::floor, llvm::BasicBlock::getParent(), llvm::ProfileInfoT< FType, BType >::MissingValue(), llvm::succ_begin(), and llvm::succ_end().
| void llvm::ProfileInfoT< FType, BType >::transfer | ( | const FType * | Old, |
| const FType * | New | ||
| ) |
| void llvm::ProfileInfoT< Function, BasicBlock >::transfer | ( | const Function * | Old, |
| const Function * | New | ||
| ) |
Definition at line 478 of file ProfileInfo.cpp.
References llvm::dbgs(), DEBUG, and llvm::Value::getName().
std::map<const FType*, BlockCounts> llvm::ProfileInfoT< FType, BType >::BlockInformation [protected] |
Definition at line 72 of file ProfileInfo.h.
Referenced by llvm::ProfileInfoT< FType, BType >::dump().
std::map<const FType*, EdgeWeights> llvm::ProfileInfoT< FType, BType >::EdgeInformation [protected] |
Definition at line 69 of file ProfileInfo.h.
Referenced by llvm::ProfileInfoT< FType, BType >::dump(), llvm::ProfileInfoT< FType, BType >::getEdgeWeight(), llvm::ProfileInfoT< FType, BType >::getEdgeWeights(), and llvm::ProfileInfoT< FType, BType >::setEdgeWeight().
std::map<const FType*, double> llvm::ProfileInfoT< FType, BType >::FunctionInformation [protected] |
Definition at line 75 of file ProfileInfo.h.
Referenced by llvm::ProfileInfoT< FType, BType >::dump().
char llvm::ProfileInfoT< FType, BType >::ID [static] |
Definition at line 79 of file ProfileInfo.h.
ProfileInfoT<MachineFunction, MachineBasicBlock>* llvm::ProfileInfoT< FType, BType >::MachineProfile [protected] |
Definition at line 77 of file ProfileInfo.h.
Referenced by llvm::ProfileInfoT< FType, BType >::hasMI(), and llvm::ProfileInfoT< FType, BType >::MI().
const double llvm::ProfileInfoT< FType, BType >::MissingValue [static] |
Definition at line 85 of file ProfileInfo.h.