From 06dbef967776357611094d5abdebf18de0030cf8 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Wed, 22 Jun 2016 02:12:54 +0000 Subject: [PATCH] Add an option to enable MBFI dot viewer for a given function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273366 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineBlockFrequencyInfo.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/MachineBlockFrequencyInfo.cpp b/lib/CodeGen/MachineBlockFrequencyInfo.cpp index d0c6261a478..884313673ba 100644 --- a/lib/CodeGen/MachineBlockFrequencyInfo.cpp +++ b/lib/CodeGen/MachineBlockFrequencyInfo.cpp @@ -42,6 +42,9 @@ static cl::opt ViewMachineBlockFreqPropagationDAG( "integer fractional block frequency representation."), clEnumValEnd)); +static cl::opt ViewMachineBlockFreqFuncName("view-mbfi-func-name", + cl::Hidden); + namespace llvm { template <> struct GraphTraits { @@ -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 -- 2.50.1