diff options
author | Dan Gohman <gohman@apple.com> | 2009-02-06 18:26:51 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-02-06 18:26:51 +0000 |
commit | 0a3776dc6f702d4e3f4a189df7f43d8f99957773 (patch) | |
tree | e30b19a66d6375f674fda6f466a98a607aafc1d5 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | a2d8b06272621a0cf4ec68c736163836f68a9fce (diff) |
Rename SelectionDAGISel::Schedule to
SelectionDAGISel::CreateScheduler, and make it just create the
scheduler. Leave running the scheduler to the higher-level code.
This makes the higher-level code a little more explicit and
easier to follow, and will help enable some future refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63944 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 7bef0392d2..6330739d4d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -662,12 +662,12 @@ void SelectionDAGISel::CodeGenAndEmitDAG() { if (ViewSchedDAGs) CurDAG->viewGraph("scheduler input for " + BlockName); // Schedule machine code. - ScheduleDAG *Scheduler; + ScheduleDAG *Scheduler = CreateScheduler(); if (TimePassesIsEnabled) { NamedRegionTimer T("Instruction Scheduling", GroupName); - Scheduler = Schedule(); + Scheduler->Run(CurDAG, BB, BB->end(), BB->end()); } else { - Scheduler = Schedule(); + Scheduler->Run(CurDAG, BB, BB->end(), BB->end()); } if (ViewSUnitDAGs) Scheduler->viewGraph(); @@ -1064,10 +1064,11 @@ SelectionDAGISel::FinishBasicBlock() { } -/// Schedule - Pick a safe ordering for instructions for each -/// target node in the graph. +/// Create the scheduler. If a specific scheduler was specified +/// via the SchedulerRegistry, use it, otherwise select the +/// one preferred by the target. /// -ScheduleDAG *SelectionDAGISel::Schedule() { +ScheduleDAG *SelectionDAGISel::CreateScheduler() { RegisterScheduler::FunctionPassCtor Ctor = RegisterScheduler::getDefault(); if (!Ctor) { @@ -1075,13 +1076,9 @@ ScheduleDAG *SelectionDAGISel::Schedule() { RegisterScheduler::setDefault(Ctor); } - ScheduleDAG *Scheduler = Ctor(this, Fast); - Scheduler->Run(CurDAG, BB, BB->end(), BB->end()); - - return Scheduler; + return Ctor(this, Fast); } - ScheduleHazardRecognizer *SelectionDAGISel::CreateTargetHazardRecognizer() { return new ScheduleHazardRecognizer(); } |