mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-16 14:26:17 +00:00
Simplify the computeOperandLatency API.
The logic for recomputing latency based on a ScheduleDAG edge was shady. This bypasses the problem by requiring the client to provide operand indices. This ensures consistent use of the machine model's API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162420 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -905,13 +905,12 @@ void ConvergingScheduler::releaseTopNode(SUnit *SU) {
|
||||
for (SUnit::succ_iterator I = SU->Preds.begin(), E = SU->Preds.end();
|
||||
I != E; ++I) {
|
||||
unsigned PredReadyCycle = I->getSUnit()->TopReadyCycle;
|
||||
unsigned Latency =
|
||||
DAG->computeOperandLatency(I->getSUnit(), SU, *I, /*FindMin=*/true);
|
||||
unsigned MinLatency = I->getMinLatency();
|
||||
#ifndef NDEBUG
|
||||
Top.MaxMinLatency = std::max(Latency, Top.MaxMinLatency);
|
||||
Top.MaxMinLatency = std::max(MinLatency, Top.MaxMinLatency);
|
||||
#endif
|
||||
if (SU->TopReadyCycle < PredReadyCycle + Latency)
|
||||
SU->TopReadyCycle = PredReadyCycle + Latency;
|
||||
if (SU->TopReadyCycle < PredReadyCycle + MinLatency)
|
||||
SU->TopReadyCycle = PredReadyCycle + MinLatency;
|
||||
}
|
||||
Top.releaseNode(SU, SU->TopReadyCycle);
|
||||
}
|
||||
@@ -925,13 +924,12 @@ void ConvergingScheduler::releaseBottomNode(SUnit *SU) {
|
||||
for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
|
||||
I != E; ++I) {
|
||||
unsigned SuccReadyCycle = I->getSUnit()->BotReadyCycle;
|
||||
unsigned Latency =
|
||||
DAG->computeOperandLatency(SU, I->getSUnit(), *I, /*FindMin=*/true);
|
||||
unsigned MinLatency = I->getMinLatency();
|
||||
#ifndef NDEBUG
|
||||
Bot.MaxMinLatency = std::max(Latency, Bot.MaxMinLatency);
|
||||
Bot.MaxMinLatency = std::max(MinLatency, Bot.MaxMinLatency);
|
||||
#endif
|
||||
if (SU->BotReadyCycle < SuccReadyCycle + Latency)
|
||||
SU->BotReadyCycle = SuccReadyCycle + Latency;
|
||||
if (SU->BotReadyCycle < SuccReadyCycle + MinLatency)
|
||||
SU->BotReadyCycle = SuccReadyCycle + MinLatency;
|
||||
}
|
||||
Bot.releaseNode(SU, SU->BotReadyCycle);
|
||||
}
|
||||
|
Reference in New Issue
Block a user