diff options
author | Xinliang David Li <davidxl@google.com> | 2017-01-23 18:58:24 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2017-01-23 18:58:24 +0000 |
commit | cb253ce90b7fdf2bfe455301b1365c1ac39837ee (patch) | |
tree | 8c413642bd8e5aa0eb7079c2ad2d7705e2c17389 /llvm/lib/Analysis/BlockFrequencyInfo.cpp | |
parent | 703066136443500a8ed962e25f4d3272a5b94919 (diff) | |
download | bcm5719-llvm-cb253ce90b7fdf2bfe455301b1365c1ac39837ee.tar.gz bcm5719-llvm-cb253ce90b7fdf2bfe455301b1365c1ac39837ee.zip |
[PGO] add debug option to view annotated cfg after prof use annotation
Differential Revision: http://reviews.llvm.org/D28967
llvm-svn: 292815
Diffstat (limited to 'llvm/lib/Analysis/BlockFrequencyInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/BlockFrequencyInfo.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/BlockFrequencyInfo.cpp b/llvm/lib/Analysis/BlockFrequencyInfo.cpp index 1c4e28f20ca..3c57c171e07 100644 --- a/llvm/lib/Analysis/BlockFrequencyInfo.cpp +++ b/llvm/lib/Analysis/BlockFrequencyInfo.cpp @@ -55,8 +55,18 @@ cl::opt<unsigned> "is no less than the max frequency of the " "function multiplied by this percent.")); +// Command line option to turn on CFG dot dump after profile annotation. +cl::opt<bool> PGOViewCounts("pgo-view-counts", cl::init(false), cl::Hidden); + namespace llvm { +static GVDAGType getGVDT() { + + if (PGOViewCounts) + return GVDT_Count; + return ViewBlockFreqPropagationDAG; +} + template <> struct GraphTraits<BlockFrequencyInfo *> { typedef const BasicBlock *NodeRef; @@ -89,8 +99,7 @@ struct DOTGraphTraits<BlockFrequencyInfo *> : public BFIDOTGTraitsBase { std::string getNodeLabel(const BasicBlock *Node, const BlockFrequencyInfo *Graph) { - return BFIDOTGTraitsBase::getNodeLabel(Node, Graph, - ViewBlockFreqPropagationDAG); + return BFIDOTGTraitsBase::getNodeLabel(Node, Graph, getGVDT()); } std::string getNodeAttributes(const BasicBlock *Node, |