[PATCH] D72125: [NFC] Move InPQueue into normal argument in releaseNode

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 18:53:28 PST 2020


qiucf created this revision.
qiucf added reviewers: DoktorC, fhahn, lkail, steven.zhang.
Herald added subscribers: llvm-commits, javed.absar, hiraditya, MatzeB.
Herald added a project: LLVM.

D72069 <https://reviews.llvm.org/D72069> has been committed quickly to remove build block. But as discussed in the revision, directly put `InPQueue` into function arguments of `releaseNode` is a quite cleaner approach.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72125

Files:
  llvm/include/llvm/CodeGen/MachineScheduler.h
  llvm/lib/CodeGen/MachineScheduler.cpp


Index: llvm/lib/CodeGen/MachineScheduler.cpp
===================================================================
--- llvm/lib/CodeGen/MachineScheduler.cpp
+++ llvm/lib/CodeGen/MachineScheduler.cpp
@@ -2088,13 +2088,8 @@
   return OtherCritCount;
 }
 
-template void SchedBoundary::releaseNode<true>(SUnit *SU, unsigned ReadyCycle,
-                                               unsigned Idx);
-template void SchedBoundary::releaseNode<false>(SUnit *SU, unsigned ReadyCycle,
-                                                unsigned Idx);
-
-template <bool InPQueue>
-void SchedBoundary::releaseNode(SUnit *SU, unsigned ReadyCycle, unsigned Idx) {
+void SchedBoundary::releaseNode(SUnit *SU, unsigned ReadyCycle, bool InPQueue,
+                                unsigned Idx) {
   assert(SU->getInstr() && "Scheduled SUnit must have instr");
 
 #ifndef NDEBUG
@@ -2373,7 +2368,7 @@
     if (Available.size() >= ReadyListLimit)
       break;
 
-    releaseNode<true>(SU, ReadyCycle, I);
+    releaseNode(SU, ReadyCycle, true, I);
     if (E != Pending.size()) {
       --I;
       --E;
Index: llvm/include/llvm/CodeGen/MachineScheduler.h
===================================================================
--- llvm/include/llvm/CodeGen/MachineScheduler.h
+++ llvm/include/llvm/CodeGen/MachineScheduler.h
@@ -757,8 +757,8 @@
 
   unsigned getOtherResourceCount(unsigned &OtherCritIdx);
 
-  template <bool InPQueue>
-  void releaseNode(SUnit *SU, unsigned ReadyCycle, unsigned Idx = 0);
+  void releaseNode(SUnit *SU, unsigned ReadyCycle, bool InPQueue,
+                   unsigned Idx = 0);
 
   void bumpCycle(unsigned NextCycle);
 
@@ -956,7 +956,7 @@
     if (SU->isScheduled)
       return;
 
-    Top.releaseNode<false>(SU, SU->TopReadyCycle);
+    Top.releaseNode(SU, SU->TopReadyCycle, false);
     TopCand.SU = nullptr;
   }
 
@@ -964,7 +964,7 @@
     if (SU->isScheduled)
       return;
 
-    Bot.releaseNode<false>(SU, SU->BotReadyCycle);
+    Bot.releaseNode(SU, SU->BotReadyCycle, false);
     BotCand.SU = nullptr;
   }
 
@@ -1044,7 +1044,7 @@
   void releaseTopNode(SUnit *SU) override {
     if (SU->isScheduled)
       return;
-    Top.releaseNode<false>(SU, SU->TopReadyCycle);
+    Top.releaseNode(SU, SU->TopReadyCycle, false);
   }
 
   // Only called for roots.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72125.235987.patch
Type: text/x-patch
Size: 2283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200103/4701327d/attachment.bin>


More information about the llvm-commits mailing list