From 80457ce5fa868719be4e1e5d9020899eb6d0bf16 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Wed, 22 Jun 2016 02:12:54 +0000 Subject: Add an option to enable MBFI dot viewer for a given function llvm-svn: 273366 --- llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp') 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 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 -- cgit v1.2.3