[llvm-commits] [llvm] r60498 - /llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp

Dan Gohman gohman at apple.com
Wed Dec 3 11:37:42 PST 2008


Author: djg
Date: Wed Dec  3 13:37:34 2008
New Revision: 60498

URL: http://llvm.org/viewvc/llvm-project?rev=60498&view=rev
Log:
Don't charge the full latency for anti and output dependencies. This is
an area where eventually it would be good to use target-dependent
information.

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

Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=60498&r1=60497&r2=60498&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original)
+++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Wed Dec  3 13:37:34 2008
@@ -160,9 +160,12 @@
     for (SUnit::pred_iterator P = SU->Preds.begin(), PE = SU->Preds.end();
          P != PE; ++P) {
       SUnit *PredSU = P->Dep;
-      unsigned PredLatency = PredSU->CycleBound + PredSU->Latency;
-      if (SU->CycleBound < PredLatency) {
-        SU->CycleBound = PredLatency;
+      // This assumes that there's no delay for reusing registers.
+      unsigned PredLatency = (P->isCtrl && P->Reg != 0) ? 1 : PredSU->Latency;
+      unsigned PredTotalLatency = PredSU->CycleBound + PredLatency;
+      if (SU->CycleBound < PredTotalLatency ||
+          (SU->CycleBound == PredTotalLatency && !P->isAntiDep)) {
+        SU->CycleBound = PredTotalLatency;
         CriticalPath[*I] = &*P;
       }
     }





More information about the llvm-commits mailing list