diff --git a/include/llvm/CodeGen/MachineScheduler.h b/include/llvm/CodeGen/MachineScheduler.h index 25a6105b689..58cb7a803af 100644 --- a/include/llvm/CodeGen/MachineScheduler.h +++ b/include/llvm/CodeGen/MachineScheduler.h @@ -718,10 +718,6 @@ public: void releaseNode(SUnit *SU, unsigned ReadyCycle); - void releaseTopNode(SUnit *SU); - - void releaseBottomNode(SUnit *SU); - void bumpCycle(unsigned NextCycle); void incExecutedResources(unsigned PIdx, unsigned Count); @@ -892,12 +888,18 @@ public: void schedNode(SUnit *SU, bool IsTopNode) override; void releaseTopNode(SUnit *SU) override { - Top.releaseTopNode(SU); + if (SU->isScheduled) + return; + + Top.releaseNode(SU, SU->TopReadyCycle); TopCand.SU = nullptr; } void releaseBottomNode(SUnit *SU) override { - Bot.releaseBottomNode(SU); + if (SU->isScheduled) + return; + + Bot.releaseNode(SU, SU->BotReadyCycle); BotCand.SU = nullptr; } @@ -975,7 +977,9 @@ public: void schedNode(SUnit *SU, bool IsTopNode) override; void releaseTopNode(SUnit *SU) override { - Top.releaseTopNode(SU); + if (SU->isScheduled) + return; + Top.releaseNode(SU, SU->TopReadyCycle); } // Only called for roots. diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp index bc1c97d7466..f431ee9ba00 100644 --- a/lib/CodeGen/MachineScheduler.cpp +++ b/lib/CodeGen/MachineScheduler.cpp @@ -1995,20 +1995,6 @@ void SchedBoundary::releaseNode(SUnit *SU, unsigned ReadyCycle) { Available.push(SU); } -void SchedBoundary::releaseTopNode(SUnit *SU) { - if (SU->isScheduled) - return; - - releaseNode(SU, SU->TopReadyCycle); -} - -void SchedBoundary::releaseBottomNode(SUnit *SU) { - if (SU->isScheduled) - return; - - releaseNode(SU, SU->BotReadyCycle); -} - /// Move the boundary of scheduled code by one cycle. void SchedBoundary::bumpCycle(unsigned NextCycle) { if (SchedModel->getMicroOpBufferSize() == 0) {