diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-08-18 20:11:49 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-08-18 20:11:49 +0000 |
| commit | 068ca15d5e1c55af57e2b0898c1ea6a5aee836c0 (patch) | |
| tree | 07c2d6804554b813a9fc8d58c338c5e010fd784d /lib/CodeGen | |
| parent | 0bc04231c0aa42fbb50cc4fd531340d35b60450d (diff) | |
add a new -view-sched-dags option to view dags as they are sent to the scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22878 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index c4dba41441..bf77d4c7f7 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -17,8 +17,17 @@ #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" +#include "llvm/Support/CommandLine.h" using namespace llvm; +#ifndef _NDEBUG +static cl::opt<bool> +ViewDAGs("view-sched-dags", cl::Hidden, + cl::desc("Pop up a window to show sched dags as they are processed")); +#else +static const bool ViewDAGS = 0; +#endif + namespace { class SimpleSched { SelectionDAG &DAG; @@ -112,5 +121,6 @@ unsigned SimpleSched::Emit(SDOperand Op) { /// Pick a safe ordering and emit instructions for each target node in the /// graph. void SelectionDAGISel::ScheduleAndEmitDAG(SelectionDAG &SD) { + if (ViewDAGs) SD.viewGraph(); SimpleSched(SD, BB).Run(); } |
