From f70c5cd5db2531446ac9bb9ddf77adb7b5147c52 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 16 Jan 2007 04:55:25 +0000 Subject: add options to view the dags before the first or second pass of dag combine. llvm-svn: 33249 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 76a60f0f478..96bf9cd4376 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -46,6 +46,20 @@ STATISTIC(PreIndexedNodes , "Number of pre-indexed nodes created"); STATISTIC(PostIndexedNodes, "Number of post-indexed nodes created"); namespace { +#ifndef NDEBUG + static cl::opt + ViewDAGCombine1("view-dag-combine1-dags", cl::Hidden, + cl::desc("Pop up a window to show dags before the first " + "dag combine pass")); + static cl::opt + ViewDAGCombine2("view-dag-combine2-dags", cl::Hidden, + cl::desc("Pop up a window to show dags before the second " + "dag combine pass")); +#else + static const bool ViewDAGCombine1 = false; + static const bool ViewDAGCombine2 = false; +#endif + static cl::opt CombinerAA("combiner-alias-analysis", cl::Hidden, cl::desc("Turn on alias analysis during testing")); @@ -4512,6 +4526,10 @@ SDOperand DAGCombiner::FindBetterChain(SDNode *N, SDOperand OldChain) { // SelectionDAG::Combine - This is the entry point for the file. // void SelectionDAG::Combine(bool RunningAfterLegalize, AliasAnalysis &AA) { + if (!RunningAfterLegalize && ViewDAGCombine1) + viewGraph(); + if (RunningAfterLegalize && ViewDAGCombine2) + viewGraph(); /// run - This is the main entry point to this class. /// DAGCombiner(*this, AA).Run(RunningAfterLegalize); -- cgit v1.2.3