diff options
author | Kazu Hirata <kazu@google.com> | 2021-11-28 18:14:49 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-11-28 18:14:49 -0800 |
commit | fd7d40640d26cd7834a1d85023ed9da8aef2a3a7 (patch) | |
tree | d3ae3277f9f1fe1a0e77c649b2ad507bef6a765d /llvm/lib/CodeGen/MachinePipeliner.cpp | |
parent | ace1d0ad3dc43e28715cbe2f3e0a5a76578bda9f (diff) | |
download | llvm-fd7d40640d26cd7834a1d85023ed9da8aef2a3a7.zip llvm-fd7d40640d26cd7834a1d85023ed9da8aef2a3a7.tar.gz llvm-fd7d40640d26cd7834a1d85023ed9da8aef2a3a7.tar.bz2 |
[llvm] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/MachinePipeliner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachinePipeliner.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp index cf1f3d0..21be671 100644 --- a/llvm/lib/CodeGen/MachinePipeliner.cpp +++ b/llvm/lib/CodeGen/MachinePipeliner.cpp @@ -1455,17 +1455,15 @@ void SwingSchedulerDAG::computeNodeFunctions(NodeSetType &NodeSets) { int asap = 0; int zeroLatencyDepth = 0; SUnit *SU = &SUnits[I]; - for (SUnit::const_pred_iterator IP = SU->Preds.begin(), - EP = SU->Preds.end(); - IP != EP; ++IP) { - SUnit *pred = IP->getSUnit(); - if (IP->getLatency() == 0) + for (const SDep &P : SU->Preds) { + SUnit *pred = P.getSUnit(); + if (P.getLatency() == 0) zeroLatencyDepth = std::max(zeroLatencyDepth, getZeroLatencyDepth(pred) + 1); - if (ignoreDependence(*IP, true)) + if (ignoreDependence(P, true)) continue; - asap = std::max(asap, (int)(getASAP(pred) + IP->getLatency() - - getDistance(pred, SU, *IP) * MII)); + asap = std::max(asap, (int)(getASAP(pred) + P.getLatency() - + getDistance(pred, SU, P) * MII)); } maxASAP = std::max(maxASAP, asap); ScheduleInfo[I].ASAP = asap; |