summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2017-02-02 19:18:56 +0000
committerXinliang David Li <davidxl@google.com>2017-02-02 19:18:56 +0000
commit1eb4ec6a2eedec4e69b664540fa1a14d5bf899b4 (patch)
tree569d798843a86d1ce40e8a61e0bee2fc49b67b9f /llvm/lib/CodeGen
parentd64360d935d71dcd01913b656b17e8ec7b76623b (diff)
downloadbcm5719-llvm-1eb4ec6a2eedec4e69b664540fa1a14d5bf899b4.tar.gz
bcm5719-llvm-1eb4ec6a2eedec4e69b664540fa1a14d5bf899b4.zip
[PGO] make graph view internal options available for all builds
Differential Revision: https://reviews.llvm.org/D29259 llvm-svn: 293921
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp9
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp4
2 files changed, 0 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
index d8ee2438ae2..856aadc5120 100644
--- a/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
+++ b/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp
@@ -28,7 +28,6 @@ using namespace llvm;
#define DEBUG_TYPE "block-freq"
-#ifndef NDEBUG
static cl::opt<GVDAGType> ViewMachineBlockFreqPropagationDAG(
"view-machine-block-freq-propagation-dags", cl::Hidden,
@@ -145,7 +144,6 @@ struct DOTGraphTraits<MachineBlockFrequencyInfo *>
};
} // end namespace llvm
-#endif
INITIALIZE_PASS_BEGIN(MachineBlockFrequencyInfo, "machine-block-freq",
"Machine Block Frequency Analysis", true, true)
@@ -177,13 +175,11 @@ bool MachineBlockFrequencyInfo::runOnMachineFunction(MachineFunction &F) {
if (!MBFI)
MBFI.reset(new ImplType);
MBFI->calculate(F, MBPI, MLI);
-#ifndef NDEBUG
if (ViewMachineBlockFreqPropagationDAG != GVDT_None &&
(ViewBlockFreqFuncName.empty() ||
F.getName().equals(ViewBlockFreqFuncName))) {
view();
}
-#endif
return false;
}
@@ -193,13 +189,8 @@ void MachineBlockFrequencyInfo::releaseMemory() { MBFI.reset(); }
/// rendered using dot.
void MachineBlockFrequencyInfo::view(bool isSimple) const {
// This code is only for debugging.
-#ifndef NDEBUG
ViewGraph(const_cast<MachineBlockFrequencyInfo *>(this),
"MachineBlockFrequencyDAGs", isSimple);
-#else
- errs() << "MachineBlockFrequencyInfo::view is only available in debug builds "
- "on systems with Graphviz or gv!\n";
-#endif // NDEBUG
}
BlockFrequency
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 780be9c1813..8128efbaf2d 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -160,10 +160,8 @@ static cl::opt<unsigned> TailDupPlacementPenalty(
extern cl::opt<unsigned> StaticLikelyProb;
extern cl::opt<unsigned> ProfileLikelyProb;
-#ifndef NDEBUG
extern cl::opt<GVDAGType> ViewBlockLayoutWithBFI;
extern cl::opt<std::string> ViewBlockFreqFuncName;
-#endif
namespace {
class BlockChain;
@@ -2365,13 +2363,11 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &MF) {
MBI->setAlignment(AlignAllNonFallThruBlocks);
}
}
-#ifndef NDEBUG
if (ViewBlockLayoutWithBFI != GVDT_None &&
(ViewBlockFreqFuncName.empty() ||
F->getFunction()->getName().equals(ViewBlockFreqFuncName))) {
MBFI->view(false);
}
-#endif
// We always return true as we have no way to track whether the final order
OpenPOWER on IntegriCloud