aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-06-28 06:58:21 +0000
committerXinliang David Li <davidxl@google.com>2016-06-28 06:58:21 +0000
commit3e176c77ab593e2edf659e7318cb41319cae10ff (patch)
tree91c850fd5ff9444e40fa13d0f76d85f3fc5f1762 /llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
parenta727f3cfde91553113ee33f7fea6f8c4299d2919 (diff)
downloadllvm-3e176c77ab593e2edf659e7318cb41319cae10ff.zip
llvm-3e176c77ab593e2edf659e7318cb41319cae10ff.tar.gz
llvm-3e176c77ab593e2edf659e7318cb41319cae10ff.tar.bz2
[BFI/MBFI]: cfg graph view with color scheme
This patch enhances dot graph viewer to show hot regions with hot bbs/edges displayed in red. The ratio of the bb freq to the max freq of the function needs to be no less than the value specified by view-hot-freq-percent option. The default value is 10 (i.e. 10%). llvm-svn: 273996
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
index 7e05ebe..4353ec4 100644
--- a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
+++ b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
@@ -47,6 +47,7 @@ static cl::opt<GVDAGType> ViewMachineBlockFreqPropagationDAG(
clEnumValEnd));
extern cl::opt<std::string> ViewBlockFreqFuncName;
+extern cl::opt<uint64_t> ViewHotFreqPercent;
namespace llvm {
@@ -92,9 +93,16 @@ struct DOTGraphTraits<MachineBlockFrequencyInfo *>
Node, Graph, ViewMachineBlockFreqPropagationDAG);
}
+ std::string getNodeAttributes(const MachineBasicBlock *Node,
+ const MachineBlockFrequencyInfo *Graph) {
+ return MBFIDOTGraphTraitsBase::getNodeAttributes(Node, Graph,
+ ViewHotFreqPercent);
+ }
+
std::string getEdgeAttributes(const MachineBasicBlock *Node, EdgeIter EI,
const MachineBlockFrequencyInfo *MBFI) {
- return MBFIDOTGraphTraitsBase::getEdgeAttributes(Node, EI, MBFI->getMBPI());
+ return MBFIDOTGraphTraitsBase::getEdgeAttributes(
+ Node, EI, MBFI, MBFI->getMBPI(), ViewHotFreqPercent);
}
};