[llvm] r275806 - [Hexagon] Misc changes to HexagonMachineScheduler, NFC

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 09:15:15 PDT 2016


Author: kparzysz
Date: Mon Jul 18 11:15:15 2016
New Revision: 275806

URL: http://llvm.org/viewvc/llvm-project?rev=275806&view=rev
Log:
[Hexagon] Misc changes to HexagonMachineScheduler, NFC

- Remove duplicated code.
- Convert loop to range-for.

Modified:
    llvm/trunk/lib/Target/Hexagon/HexagonMachineScheduler.cpp

Modified: llvm/trunk/lib/Target/Hexagon/HexagonMachineScheduler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonMachineScheduler.cpp?rev=275806&r1=275805&r2=275806&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonMachineScheduler.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonMachineScheduler.cpp Mon Jul 18 11:15:15 2016
@@ -265,10 +265,6 @@ void VLIWMachineScheduler::schedule() {
   // Initialize the strategy before modifying the DAG.
   SchedImpl->initialize(this);
 
-  // To view Height/Depth correctly, they should be accessed at least once.
-  //
-  // FIXME: SUnit::dumpAll always recompute depth and height now. The max
-  // depth/height could be computed directly from the roots and leaves.
   DEBUG(unsigned maxH = 0;
         for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
           if (SUnits[su].getHeight() > maxH)
@@ -345,10 +341,9 @@ void ConvergingVLIWScheduler::releaseTop
   if (SU->isScheduled)
     return;
 
-  for (SUnit::succ_iterator I = SU->Preds.begin(), E = SU->Preds.end();
-       I != E; ++I) {
-    unsigned PredReadyCycle = I->getSUnit()->TopReadyCycle;
-    unsigned MinLatency = I->getLatency();
+  for (const SDep &PI : SU->Preds) {
+    unsigned PredReadyCycle = PI.getSUnit()->TopReadyCycle;
+    unsigned MinLatency = PI.getLatency();
 #ifndef NDEBUG
     Top.MaxMinLatency = std::max(MinLatency, Top.MaxMinLatency);
 #endif
@@ -710,9 +705,6 @@ int ConvergingVLIWScheduler::SchedulingC
   // available for it.
   auto &QST = DAG->MF.getSubtarget<HexagonSubtarget>();
   auto &QII = *QST.getInstrInfo();
-
-  // Give a little extra priority to a .cur instruction if there is a resource
-  // available for it.
   if (SU->isInstr() && QII.mayBeCurLoad(SU->getInstr())) {
     if (Q.getID() == TopQID && Top.ResourceModel->isResourceAvailable(SU)) {
       ResCount += PriorityTwo;
@@ -786,21 +778,6 @@ int ConvergingVLIWScheduler::SchedulingC
     }
   }
 
-  // Give less preference to an instruction that will cause a stall with
-  // an instruction in the previous packet.
-  if (QII.isV60VectorInstruction(Instr)) {
-    // Check for stalls in the previous packet.
-    if (Q.getID() == TopQID) {
-      for (auto J : Top.ResourceModel->OldPacket)
-        if (QII.producesStall(J->getInstr(), Instr))
-          ResCount -= PriorityOne;
-    } else {
-      for (auto J : Bot.ResourceModel->OldPacket)
-        if (QII.producesStall(Instr, J->getInstr()))
-          ResCount -= PriorityOne;
-    }
-  }
-
   DEBUG(if (verbose) {
     std::stringstream dbgstr;
     dbgstr << "Total " << std::setw(4) << ResCount << ")";




More information about the llvm-commits mailing list