[PATCH] D22194: Power9 - Add exploitation of oris/ori fusion

Ehsan Amiri via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 16 17:56:41 PDT 2016


amehsan added a comment.

Not yet looked at everything. Will gradually add comments as I go through the code.


================
Comment at: lib/CodeGen/PostRASchedulerList.cpp:574-589
@@ -590,5 +573,18 @@
+    // if we have clustered instructions, scheduling them first.
+    if (NextClusterSucc) {
+      // Wait until we have correct cycle count and no more hazard.
+      if (NextClusterSucc->getDepth() <= CurCycle &&
+          HazardRec->getHazardType(NextClusterSucc, 0/*no stalls*/) ==
+          ScheduleHazardRecognizer::NoHazard) {
+        for (unsigned i = 0, e = PendingQueue.size(); i != e; ++i)
+          if (PendingQueue[i] == NextClusterSucc) {
+            PendingQueue.erase(PendingQueue.begin() + i);
+            break;
           }
-        } else {
-          FoundSUnit = CurSUnit;
-          break;
-        }
+
+        FoundSUnit = NextClusterSucc;
+        NextClusterSucc->isAvailable = true;
+        NextClusterSucc = nullptr;
+      }
+    } else {
+      // Check to see if any of the pending instructions are ready to issue.  If
----------------
IIUC, this implementation breaks an important invariant of the code: Anything that is in pending queue, and its operands are ready should be moved to the available queue. You should still let everything that is avaialble to go to available queue and then find a way to prioritize the one that you want there. 




https://reviews.llvm.org/D22194





More information about the llvm-commits mailing list