[llvm] r273366 - Add an option to enable MBFI dot viewer for a given function
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 21 19:12:54 PDT 2016
Author: davidxl
Date: Tue Jun 21 21:12:54 2016
New Revision: 273366
URL: http://llvm.org/viewvc/llvm-project?rev=273366&view=rev
Log:
Add an option to enable MBFI dot viewer for a given function
Modified:
llvm/trunk/lib/CodeGen/MachineBlockFrequencyInfo.cpp
Modified: llvm/trunk/lib/CodeGen/MachineBlockFrequencyInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBlockFrequencyInfo.cpp?rev=273366&r1=273365&r2=273366&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineBlockFrequencyInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineBlockFrequencyInfo.cpp Tue Jun 21 21:12:54 2016
@@ -42,6 +42,9 @@ static cl::opt<GVDAGType> ViewMachineBlo
"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::runOnMac
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
More information about the llvm-commits
mailing list