Index: lib/CodeGen/MachineBlockFrequencyInfo.cpp =================================================================== --- lib/CodeGen/MachineBlockFrequencyInfo.cpp +++ lib/CodeGen/MachineBlockFrequencyInfo.cpp @@ -42,6 +42,9 @@ "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 @@ 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