[llvm-commits] [llvm] r66673 - in /llvm/branches/Apple/Dib: include/llvm/CodeGen/SelectionDAGISel.h lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Dan Gohman gohman at apple.com
Wed Mar 11 11:08:18 PDT 2009


Author: djg
Date: Wed Mar 11 13:08:18 2009
New Revision: 66673

URL: http://llvm.org/viewvc/llvm-project?rev=66673&view=rev
Log:
Merge from trunk:

r63944 | djg | 2009-02-06 10:26:51 -0800 (Fri, 06 Feb 2009) | 6 lines

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.


Modified:
    llvm/branches/Apple/Dib/include/llvm/CodeGen/SelectionDAGISel.h
    llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/SelectionDAGISel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/CodeGen/SelectionDAGISel.h?rev=66673&r1=66672&r2=66673&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/CodeGen/SelectionDAGISel.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/CodeGen/SelectionDAGISel.h Wed Mar 11 13:08:18 2009
@@ -129,9 +129,11 @@
 
   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();
 };
 
 }

Modified: llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=66673&r1=66672&r2=66673&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Mar 11 13:08:18 2009
@@ -662,12 +662,12 @@
   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 @@
 }
 
 
-/// 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 @@
     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();
 }





More information about the llvm-commits mailing list