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 | 0c8c2c102d749c43917cf1e7596dec6ddcc649f6 (patch) | |
| tree | 06ae034ce0cbaf56a3f59b5f810a841b863c552f /llvm/lib | |
| parent | 4e00ff6e7081377e6098188dd4364a9932c743ff (diff) | |
| download | bcm5719-llvm-0c8c2c102d749c43917cf1e7596dec6ddcc649f6.tar.gz bcm5719-llvm-0c8c2c102d749c43917cf1e7596dec6ddcc649f6.zip | |
add a new -view-sched-dags option to view dags as they are sent to the scheduler.
llvm-svn: 22878
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index c4dba414416..bf77d4c7f73 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/llvm/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(); } |

