[llvm] r190360 - mi-sched: smooth out the cyclicpath heuristic.

Andrew Trick atrick at apple.com
Mon Sep 9 15:28:08 PDT 2013


Author: atrick
Date: Mon Sep  9 17:28:08 2013
New Revision: 190360

URL: http://llvm.org/viewvc/llvm-project?rev=190360&view=rev
Log:
mi-sched: smooth out the cyclicpath heuristic.

Arnold's idea.

I generally try to avoid stateful heuristics because it can make
debugging harder. However, we need a way to prevent the latency
priority from dominating, and it somewhat makes sense to schedule
aggressively for latency only within an issue group.

Swift in particular likes this, and it doesn't hurt anyone else:
| Benchmarks/MiBench/consumer-lame              |  10.39% |
| Benchmarks/Misc/himenobmtxpa                  |   9.63% |

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

Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=190360&r1=190359&r2=190360&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Mon Sep  9 17:28:08 2013
@@ -2492,7 +2492,10 @@ void ConvergingScheduler::tryCandidate(S
     return;
 
   // For loops that are acyclic path limited, aggressively schedule for latency.
-  if (Rem.IsAcyclicLatencyLimited && tryLatency(TryCand, Cand, Zone))
+  // This can result in very long dependence chains scheduled in sequence, so
+  // once every cycle (when CurrMOps == 0), switch to normal heuristics.
+  if (Rem.IsAcyclicLatencyLimited && !Zone.CurrMOps
+      && tryLatency(TryCand, Cand, Zone))
     return;
 
   // Keep clustered nodes together to encourage downstream peephole





More information about the llvm-commits mailing list