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
This commit is contained in:
Dan Gohman 2009-02-06 18:26:51 +00:00
parent a2d8b06272
commit 0a3776dc6f
2 changed files with 13 additions and 14 deletions

View File

@ -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();
};
}

View File

@ -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();
}