LLVM API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes
llvm::ProfileInfoT< FType, BType > Class Template Reference

#include <ProfileInfo.h>

Collaboration diagram for llvm::ProfileInfoT< FType, BType >:
Collaboration graph
[legend]

List of all members.

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)
EdgeWeightsgetEdgeWeights (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 BasicBlockGetPath (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

Detailed Description

template<class FType, class BType>
class llvm::ProfileInfoT< FType, BType >

ProfileInfo Class - This class holds and maintains profiling information for some unit of code.

Definition at line 55 of file ProfileInfo.h.


Member Typedef Documentation

template<class FType, class BType>
typedef std::map<const BType*, double> llvm::ProfileInfoT< FType, BType >::BlockCounts

Definition at line 61 of file ProfileInfo.h.

template<class FType, class BType>
typedef std::pair<const BType*, const BType*> llvm::ProfileInfoT< FType, BType >::Edge

Definition at line 58 of file ProfileInfo.h.

template<class FType, class BType>
typedef std::pair<Edge, double> llvm::ProfileInfoT< FType, BType >::EdgeWeight

Definition at line 59 of file ProfileInfo.h.

template<class FType, class BType>
typedef std::map<Edge, double> llvm::ProfileInfoT< FType, BType >::EdgeWeights

Definition at line 60 of file ProfileInfo.h.

template<class FType, class BType>
typedef std::map<const BType*, const BType*> llvm::ProfileInfoT< FType, BType >::Path

Definition at line 62 of file ProfileInfo.h.


Member Enumeration Documentation

template<class FType, class BType>
enum llvm::ProfileInfoT::GetPathMode
Enumerator:
GetPathToExit 
GetPathToValue 
GetPathToDest 
GetPathWithNewEdges 

Definition at line 145 of file ProfileInfo.h.


Constructor & Destructor Documentation

template<class FType, class BType>
llvm::ProfileInfoT< FType, BType >::ProfileInfoT ( )
template<class FType, class BType>
llvm::ProfileInfoT< FType, BType >::~ProfileInfoT ( )

Definition at line 37 of file ProfileInfo.cpp.

Definition at line 39 of file ProfileInfo.cpp.

Definition at line 42 of file ProfileInfo.cpp.

Definition at line 46 of file ProfileInfo.cpp.


Member Function Documentation

template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::addEdgeWeight ( Edge  e,
double  w 
)
template<>
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().

template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::addExecutionCount ( const BType *  BB,
double  w 
)
template<>
void llvm::ProfileInfoT< Function, BasicBlock >::addExecutionCount ( const BasicBlock BB,
double  w 
)
template<class FType, class BType>
bool llvm::ProfileInfoT< FType, BType >::CalculateMissingEdge ( const BType *  BB,
Edge removed,
bool  assumeEmptyExit = false 
)
template<>
bool llvm::ProfileInfoT< Function, BasicBlock >::CalculateMissingEdge ( const BasicBlock BB,
Edge removed,
bool  assumeEmptySelf 
)
template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::divertFlow ( const Edge ,
const Edge  
)
template<>
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.

template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::dump ( FType *  F = 0,
bool  real = true 
) [inline]
template<class FType, class BType>
bool llvm::ProfileInfoT< FType, BType >::EstimateMissingEdges ( const BType *  BB)
template<>
bool llvm::ProfileInfoT< Function, BasicBlock >::EstimateMissingEdges ( const BasicBlock BB)
template<class FType, class BType>
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().

template<class FType, class BType>
double llvm::ProfileInfoT< FType, BType >::getEdgeWeight ( Edge  e) const [inline]
template<class FType, class BType>
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().

template<>
double llvm::ProfileInfoT< Function, BasicBlock >::getExecutionCount ( const BasicBlock BB)
template<class FType, class BType>
double llvm::ProfileInfoT< FType, BType >::getExecutionCount ( const FType *  F)

Profile Information Queries

Referenced by llvm::ProfileInfoT< FType, BType >::dump().

template<class FType, class BType>
double llvm::ProfileInfoT< FType, BType >::getExecutionCount ( const BType *  BB)
template<>
double llvm::ProfileInfoT< MachineFunction, MachineBasicBlock >::getExecutionCount ( const MachineBasicBlock MBB)

Definition at line 125 of file ProfileInfo.cpp.

References llvm::MachineBasicBlock::getParent(), and I.

template<>
double llvm::ProfileInfoT< Function, BasicBlock >::getExecutionCount ( const Function F)
template<>
double llvm::ProfileInfoT< MachineFunction, MachineBasicBlock >::getExecutionCount ( const MachineFunction MF)

Definition at line 155 of file ProfileInfo.cpp.

References llvm::MachineFunction::front().

template<class FType, class BType>
static const FType* llvm::ProfileInfoT< FType, BType >::getFunction ( Edge  e) [inline, static]
template<class FType, class BType>
const BType* llvm::ProfileInfoT< FType, BType >::GetPath ( const BType *  Src,
const BType *  Dest,
Path P,
unsigned  Mode 
)
template<>
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().

template<class FType, class BType>
bool llvm::ProfileInfoT< FType, BType >::hasMI ( ) const [inline]

Definition at line 232 of file ProfileInfo.h.

References llvm::ProfileInfoT< FType, BType >::MachineProfile.

template<>
char llvm::ProfileInfoT< Function, BasicBlock >::ID ( )

Definition at line 28 of file ProfileInfo.cpp.

template<>
char SingleLoopExtractor::ID ( ) = 0

Definition at line 51 of file ProfileInfo.cpp.

template<class FType, class BType>
ProfileInfoT<MachineFunction, MachineBasicBlock>* llvm::ProfileInfoT< FType, BType >::MI ( ) [inline]

Definition at line 226 of file ProfileInfo.h.

References llvm::ProfileInfoT< FType, BType >::MachineProfile.

template<>
const double llvm::ProfileInfoT< Function, BasicBlock >::MissingValue ( )

Definition at line 57 of file ProfileInfo.cpp.

template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::removeBlock ( const BType *  BB)

Analysis Update Methods

template<>
void llvm::ProfileInfoT< Function, BasicBlock >::removeBlock ( const BasicBlock BB)
template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::removeEdge ( Edge  e)
template<>
void llvm::ProfileInfoT< Function, BasicBlock >::removeEdge ( Edge  e)

Definition at line 212 of file ProfileInfo.cpp.

References llvm::dbgs(), and DEBUG.

template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::repair ( const FType *  F)
template<>
void llvm::ProfileInfoT< Function, BasicBlock >::repair ( const Function F)
template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::replaceAllUses ( const BType *  RmBB,
const BType *  DestBB 
)
template<>
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.

template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::replaceEdge ( const Edge ,
const Edge  
)
template<>
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.

template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::setEdgeWeight ( Edge  e,
double  w 
) [inline]
template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::setExecutionCount ( const BType *  BB,
double  w 
)
template<>
void llvm::ProfileInfoT< Function, BasicBlock >::setExecutionCount ( const BasicBlock BB,
double  w 
)
template<>
void llvm::ProfileInfoT< MachineFunction, MachineBasicBlock >::setExecutionCount ( const MachineBasicBlock MBB,
double  w 
)
template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::splitBlock ( const BType *  Old,
const BType *  New 
)
template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::splitBlock ( const BType *  BB,
const BType *  NewBB,
BType *const *  Preds,
unsigned  NumPreds 
)
template<>
void llvm::ProfileInfoT< Function, BasicBlock >::splitBlock ( const BasicBlock Old,
const BasicBlock New 
)
template<>
void llvm::ProfileInfoT< Function, BasicBlock >::splitBlock ( const BasicBlock BB,
const BasicBlock NewBB,
BasicBlock *const *  Preds,
unsigned  NumPreds 
)
template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::splitEdge ( const BType *  FirstBB,
const BType *  SecondBB,
const BType *  NewBB,
bool  MergeIdenticalEdges = false 
)
template<>
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().

template<class FType, class BType>
void llvm::ProfileInfoT< FType, BType >::transfer ( const FType *  Old,
const FType *  New 
)
template<>
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().


Member Data Documentation

template<class FType, class BType>
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().

template<class FType, class BType>
std::map<const FType*, EdgeWeights> llvm::ProfileInfoT< FType, BType >::EdgeInformation [protected]
template<class FType, class BType>
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().

template<class FType, class BType>
char llvm::ProfileInfoT< FType, BType >::ID [static]

Definition at line 79 of file ProfileInfo.h.

template<class FType, class BType>
ProfileInfoT<MachineFunction, MachineBasicBlock>* llvm::ProfileInfoT< FType, BType >::MachineProfile [protected]
template<class FType, class BType>
const double llvm::ProfileInfoT< FType, BType >::MissingValue [static]

Definition at line 85 of file ProfileInfo.h.


The documentation for this class was generated from the following files: