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 | 817a24f8e930a18dfd6ddf93c1255b0d1beb8d7f (patch) | |
tree | 47baf7d6da37e81d7487d53da49728c7a9232eb6 | |
parent | 48d6bb9924e3dd9d044a8547fb4b146fdda0d236 (diff) | |
download | bcm5719-llvm-817a24f8e930a18dfd6ddf93c1255b0d1beb8d7f.tar.gz bcm5719-llvm-817a24f8e930a18dfd6ddf93c1255b0d1beb8d7f.zip |
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.
llvm-svn: 63944
-rw-r--r-- | llvm/include/llvm/CodeGen/SelectionDAGISel.h | 8 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 19 |
2 files changed, 13 insertions, 14 deletions
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGISel.h b/llvm/include/llvm/CodeGen/SelectionDAGISel.h index 1b680f72f07..468f1b74c5e 100644 --- a/llvm/include/llvm/CodeGen/SelectionDAGISel.h +++ b/llvm/include/llvm/CodeGen/SelectionDAGISel.h @@ -129,9 +129,11 @@ private: bool HandlePHINodesInSuccessorBlocksFast(BasicBlock *LLVMBB, FastISel *F); - /// Pick a safe ordering for instructions for each target node in the - /// graph. - ScheduleDAG *Schedule(); + /// Create the scheduler. If a specific scheduler was specified + /// via the SchedulerRegistry, use it, otherwise select the + /// one preferred by the target. + /// + ScheduleDAG *CreateScheduler(); }; } diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 7bef0392d2d..6330739d4d1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/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(); } |