From: Dan Gohman Date: Tue, 16 Dec 2008 02:38:22 +0000 (+0000) Subject: Add a simple target-independent heuristic to allow targets with no X-Git-Tag: android-x86-6.0-r1~1047^2~16833 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=aa2a113b16a904b4ad4420c68da7eca513a9fa69;p=android-x86%2Fexternal-llvm.git Add a simple target-independent heuristic to allow targets with no instruction itinerary data to back-schedule loads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61070 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp index 30e1846ef8b..fa42d393a3b 100644 --- a/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/lib/CodeGen/ScheduleDAGInstrs.cpp @@ -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 {