From: Andrew Trick Date: Mon, 9 Sep 2013 22:28:08 +0000 (+0000) Subject: mi-sched: smooth out the cyclicpath heuristic. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=ee50a46026a8e131bd1b82df729d1c45f856d0ec 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% | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190360 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineScheduler.cpp b/lib/CodeGen/MachineScheduler.cpp index f79b39140c0..ef916174267 100644 --- a/lib/CodeGen/MachineScheduler.cpp +++ b/lib/CodeGen/MachineScheduler.cpp @@ -2492,7 +2492,10 @@ void ConvergingScheduler::tryCandidate(SchedCandidate &Cand, 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