Add a simple target-independent heuristic to allow targets with no

instruction itinerary data to back-schedule loads.

llvm-svn: 61070
This commit is contained in:
Dan Gohman 2008-12-16 02:38:22 +00:00
parent c4a4c5f02d
commit 8f782bbb28
1 changed files with 6 additions and 0 deletions

View File

@ -225,6 +225,12 @@ void ScheduleDAGInstrs::ComputeLatency(SUnit *SU) {
// all nodes flagged together into this SUnit.
SU->Latency =
InstrItins.getLatency(SU->getInstr()->getDesc().getSchedClass());
// Simplistic target-independent heuristic: assume that loads take
// extra time.
if (InstrItins.isEmpty())
if (SU->getInstr()->getDesc().mayLoad())
SU->Latency += 2;
}
void ScheduleDAGInstrs::dumpNode(const SUnit *SU) const {