diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-04-02 03:07:27 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-04-02 03:07:27 +0000 | 
| commit | ef598059f2fdf9ed1ad486d011215eafc190f4be (patch) | |
| tree | 7a5e51fa01885bee3b6f96c001b1f721999b8b94 /llvm/lib/CodeGen | |
| parent | e4e64b6b8587cafd51e318ec92c7b1bc7b5cd8bc (diff) | |
| download | bcm5719-llvm-ef598059f2fdf9ed1ad486d011215eafc190f4be.tar.gz bcm5719-llvm-ef598059f2fdf9ed1ad486d011215eafc190f4be.zip | |
Add a new -view-legalize-dags command line option
llvm-svn: 27342
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 13 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 3 | 
2 files changed, 13 insertions, 3 deletions
| diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index e689bdc7ad6..f3d2fdfce4c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -14,16 +14,25 @@  #include "llvm/CodeGen/SelectionDAG.h"  #include "llvm/CodeGen/MachineFunction.h"  #include "llvm/CodeGen/MachineFrameInfo.h" -#include "llvm/Support/MathExtras.h"  #include "llvm/Target/TargetLowering.h"  #include "llvm/Target/TargetData.h"  #include "llvm/Target/TargetOptions.h"  #include "llvm/CallingConv.h"  #include "llvm/Constants.h" +#include "llvm/Support/MathExtras.h" +#include "llvm/Support/CommandLine.h"  #include <iostream>  #include <map>  using namespace llvm; +#ifndef NDEBUG +static cl::opt<bool> +ViewLegalizeDAGs("view-legalize-dags", cl::Hidden, +                 cl::desc("Pop up a window to show dags before legalize")); +#else +static const bool ViewLegalizeDAGs = 0; +#endif +  //===----------------------------------------------------------------------===//  /// SelectionDAGLegalize - This takes an arbitrary SelectionDAG as input and  /// hacks on it until the target machine can handle it.  This involves @@ -4628,6 +4637,8 @@ SDOperand SelectionDAGLegalize::PackVectorOp(SDOperand Op,  // SelectionDAG::Legalize - This is the entry point for the file.  //  void SelectionDAG::Legalize() { +  if (ViewLegalizeDAGs) viewGraph(); +    /// run - This is the main entry point to this class.    ///    SelectionDAGLegalize(*this).LegalizeDAG(); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 0956e8f9ad7..5a95ff0bc53 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -54,8 +54,7 @@ static cl::opt<bool>  ViewSchedDAGs("view-sched-dags", cl::Hidden,            cl::desc("Pop up a window to show sched dags as they are processed"));  #else -static const bool ViewISelDAGs = 0; -static const bool ViewSchedDAGs = 0; +static const bool ViewISelDAGs = 0, ViewSchedDAGs = 0;  #endif  // Scheduling heuristics | 

