Skip to content

Commit

Permalink
Update MaxMinLatency even if dependencies have been already scheduled.
Browse files Browse the repository at this point in the history
Covers an extremely rare corner case on internal book keeping.
  • Loading branch information
SergeiYLarin authored and memfrob committed Oct 4, 2022
1 parent 4b75410 commit ff6cfb5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,6 @@ void ConvergingVLIWScheduler::initialize(ScheduleDAGMI *dag) {
}

void ConvergingVLIWScheduler::releaseTopNode(SUnit *SU) {
if (SU->isScheduled)
return;

for (const SDep &PI : SU->Preds) {
unsigned PredReadyCycle = PI.getSUnit()->TopReadyCycle;
unsigned MinLatency = PI.getLatency();
Expand All @@ -298,13 +295,12 @@ void ConvergingVLIWScheduler::releaseTopNode(SUnit *SU) {
if (SU->TopReadyCycle < PredReadyCycle + MinLatency)
SU->TopReadyCycle = PredReadyCycle + MinLatency;
}
Top.releaseNode(SU, SU->TopReadyCycle);

if (!SU->isScheduled)
Top.releaseNode(SU, SU->TopReadyCycle);
}

void ConvergingVLIWScheduler::releaseBottomNode(SUnit *SU) {
if (SU->isScheduled)
return;

assert(SU->getInstr() && "Scheduled SUnit must have instr");

for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
Expand All @@ -317,7 +313,9 @@ void ConvergingVLIWScheduler::releaseBottomNode(SUnit *SU) {
if (SU->BotReadyCycle < SuccReadyCycle + MinLatency)
SU->BotReadyCycle = SuccReadyCycle + MinLatency;
}
Bot.releaseNode(SU, SU->BotReadyCycle);

if (!SU->isScheduled)
Bot.releaseNode(SU, SU->BotReadyCycle);
}

/// Does this SU have a hazard within the current instruction group.
Expand Down

0 comments on commit ff6cfb5

Please sign in to comment.