diff options
author | Xinliang David Li <davidxl@google.com> | 2016-06-22 02:12:54 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-06-22 02:12:54 +0000 |
commit | 80457ce5fa868719be4e1e5d9020899eb6d0bf16 (patch) | |
tree | 864882b490b5d0f4fdcae7f5a5695c293759808d /llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp | |
parent | 189d6a8834e26332e3718cfeb1a27d8169ef7f50 (diff) | |
download | bcm5719-llvm-80457ce5fa868719be4e1e5d9020899eb6d0bf16.tar.gz bcm5719-llvm-80457ce5fa868719be4e1e5d9020899eb6d0bf16.zip |
Add an option to enable MBFI dot viewer for a given function
llvm-svn: 273366
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp index d0c6261a478..884313673ba 100644 --- a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp +++ b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp @@ -42,6 +42,9 @@ static cl::opt<GVDAGType> ViewMachineBlockFreqPropagationDAG( "integer fractional block frequency representation."), clEnumValEnd)); +static cl::opt<std::string> ViewMachineBlockFreqFuncName("view-mbfi-func-name", + cl::Hidden); + namespace llvm { template <> struct GraphTraits<MachineBlockFrequencyInfo *> { @@ -137,7 +140,9 @@ bool MachineBlockFrequencyInfo::runOnMachineFunction(MachineFunction &F) { MBFI.reset(new ImplType); MBFI->calculate(F, MBPI, MLI); #ifndef NDEBUG - if (ViewMachineBlockFreqPropagationDAG != GVDT_None) { + if (ViewMachineBlockFreqPropagationDAG != GVDT_None && + (ViewMachineBlockFreqFuncName.empty() || + F.getName().equals(ViewMachineBlockFreqFuncName))) { view(); } #endif |