aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-12-16 02:38:22 +0000
committerDan Gohman <gohman@apple.com>2008-12-16 02:38:22 +0000
commit4ea8e85e19b844ef0ff704f27959b6a2ea7369f9 (patch)
treea754a3e7aaf8341743f92efd10d896b778eedeb1
parentc6b680eee58d27f4d38684c95e8fbfef61eb6558 (diff)
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
-rw-r--r--lib/CodeGen/ScheduleDAGInstrs.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/ScheduleDAGInstrs.cpp b/lib/CodeGen/ScheduleDAGInstrs.cpp
index 30e1846ef8..fa42d393a3 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 {