Add an issue width check to the postRA scheduler. Patch by Max Kazakov!
authorAndrew Trick <atrick@apple.com>
Wed, 1 Jun 2011 03:27:56 +0000 (03:27 +0000)
committerAndrew Trick <atrick@apple.com>
Wed, 1 Jun 2011 03:27:56 +0000 (03:27 +0000)
For targets with no itinerary (x86) it is a nop by default. For
targets with issue width already expressed in the itinerary (ARM) it
bypasses a scoreboard check but otherwise does not affect the
schedule. It does make the code more consistent and complete and
allows new targets to specify their issue width in an arbitrary way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132385 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PostRASchedulerList.cpp

index 34c9259d2abaad13cf93da6e393dabb63c105857..95c748cba176e725f69f45ea411556190f076fe0 100644 (file)
@@ -661,6 +661,12 @@ void SchedulePostRATDList::ListScheduleTopDown() {
       ScheduleNodeTopDown(FoundSUnit, CurCycle);
       HazardRec->EmitInstruction(FoundSUnit);
       CycleHasInsts = true;
+      if (HazardRec->atIssueLimit()) {
+        DEBUG(dbgs() << "*** Max instructions per cycle " << CurCycle << '\n');
+        HazardRec->AdvanceCycle();
+        ++CurCycle;
+        CycleHasInsts = false;
+      }
     } else {
       if (CycleHasInsts) {
         DEBUG(dbgs() << "*** Finished cycle " << CurCycle << '\n');