[llvm-commits] [llvm] r61070 - /llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp

Dan Gohman gohman at apple.com
Mon Dec 15 18:38:22 PST 2008


Author: djg
Date: Mon Dec 15 20:38:22 2008
New Revision: 61070

URL: http://llvm.org/viewvc/llvm-project?rev=61070&view=rev
Log:
Add a simple target-independent heuristic to allow targets with no
instruction itinerary data to back-schedule loads.

Modified:
    llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp

Modified: llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp?rev=61070&r1=61069&r2=61070&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp (original)
+++ llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp Mon Dec 15 20:38:22 2008
@@ -225,6 +225,12 @@
   // 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 {





More information about the llvm-commits mailing list