diff --git a/llvm/include/llvm/CodeGen/MachineScheduler.h b/llvm/include/llvm/CodeGen/MachineScheduler.h --- a/llvm/include/llvm/CodeGen/MachineScheduler.h +++ b/llvm/include/llvm/CodeGen/MachineScheduler.h @@ -757,8 +757,8 @@ unsigned getOtherResourceCount(unsigned &OtherCritIdx); - template - 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(SU, SU->TopReadyCycle); + Top.releaseNode(SU, SU->TopReadyCycle, false); TopCand.SU = nullptr; } @@ -964,7 +964,7 @@ if (SU->isScheduled) return; - Bot.releaseNode(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(SU, SU->TopReadyCycle); + Top.releaseNode(SU, SU->TopReadyCycle, false); } // Only called for roots. diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -2088,13 +2088,8 @@ return OtherCritCount; } -template void SchedBoundary::releaseNode(SUnit *SU, unsigned ReadyCycle, - unsigned Idx); -template void SchedBoundary::releaseNode(SUnit *SU, unsigned ReadyCycle, - unsigned Idx); - -template -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(SU, ReadyCycle, I); + releaseNode(SU, ReadyCycle, true, I); if (E != Pending.size()) { --I; --E;