36 cl::desc(
"Pop up a window to show a dag displaying how block "
37 "frequencies propagation through the CFG."),
40 "do not display graphs."),
42 "fractional block frequency representation."),
44 "integer fractional block frequency representation."),
96 "never reach this point.");
107 "Block Frequency Analysis",
true,
true)
112 char BlockFrequencyInfo::
ID = 0;
131 BFI->doFunction(&F, &BPI);
144 return BFI->getBlockFreq(BB);
152 ViewGraph(const_cast<BlockFrequencyInfo *>(
this),
"BlockFrequencyDAGs");
154 errs() <<
"BlockFrequencyInfo::view is only available in debug builds on "
155 "systems with Graphviz or gv!\n";
block Block Frequency true
std::string getNodeLabel(const BasicBlock *Node, const BlockFrequencyInfo *Graph)
static PassRegistry * getPassRegistry()
The main container class for the LLVM Intermediate Representation.
bool runOnFunction(Function &F)
DOTGraphTraits(bool isSimple=false)
succ_const_iterator ChildIteratorType
ValuesClass< DataType > END_WITH_NULL values(const char *Arg, DataType Val, const char *Desc,...)
std::string str() const
str - Get the contents as an std::string.
uint64_t getFrequency() const
Returns the frequency as a fixpoint number scaled by the entry frequency.
StringRef getName() const
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
void getAnalysisUsage(AnalysisUsage &AU) const
#define llvm_unreachable(msg)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
static ChildIteratorType child_begin(const NodeType *N)
ID
LLVM Calling Convention Representation.
Interval::succ_iterator succ_begin(Interval *I)
static nodes_iterator nodes_begin(const BlockFrequencyInfo *G)
Interval::succ_iterator succ_end(Interval *I)
LLVM Basic Block Representation.
void ViewGraph(const GraphType &G, const Twine &Name, bool ShortNames=false, const Twine &Title="", GraphProgram::Name Program=GraphProgram::DOT)
static cl::opt< GVDAGType > ViewBlockFreqPropagationDAG("view-block-freq-propagation-dags", cl::Hidden, cl::desc("Pop up a window to show a dag displaying how block ""frequencies propagation through the CFG."), cl::values(clEnumValN(GVDT_None,"none","do not display graphs."), clEnumValN(GVDT_Fraction,"fraction","display a graph using the ""fractional block frequency representation."), clEnumValN(GVDT_Integer,"integer","display a graph using the raw ""integer fractional block frequency representation."), clEnumValEnd))
void initializeBlockFrequencyInfoPass(PassRegistry &)
void print(raw_ostream &OS) const
void print(raw_ostream &O, const Module *M) const
static ChildIteratorType child_end(const NodeType *N)
INITIALIZE_PASS_BEGIN(BlockFrequencyInfo,"block-freq","Block Frequency Analysis", true, true) INITIALIZE_PASS_END(BlockFrequencyInfo
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
const BasicBlock NodeType
Function::const_iterator nodes_iterator
Analysis pass providing branch probability information.
block Block Frequency Analysis
const Function * getFunction() const
static const NodeType * getEntryNode(const BlockFrequencyInfo *G)
static std::string getGraphName(const BlockFrequencyInfo *G)
BlockFrequency getBlockFreq(const BasicBlock *BB) const
static nodes_iterator nodes_end(const BlockFrequencyInfo *G)