diff options
| -rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index f79b39140c0..ef916174267 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/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 |

