diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/InterferenceCache.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/InterferenceCache.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/InterferenceCache.cpp b/contrib/llvm-project/llvm/lib/CodeGen/InterferenceCache.cpp index ae197ee5553a..fb76f44c2501 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/InterferenceCache.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/InterferenceCache.cpp @@ -136,14 +136,12 @@ void InterferenceCache::Entry::update(unsigned MBBNum) { // Use advanceTo only when possible. if (PrevPos != Start) { if (!PrevPos.isValid() || Start < PrevPos) { - for (unsigned i = 0, e = RegUnits.size(); i != e; ++i) { - RegUnitInfo &RUI = RegUnits[i]; + for (RegUnitInfo &RUI : RegUnits) { RUI.VirtI.find(Start); RUI.FixedI = RUI.Fixed->find(Start); } } else { - for (unsigned i = 0, e = RegUnits.size(); i != e; ++i) { - RegUnitInfo &RUI = RegUnits[i]; + for (RegUnitInfo &RUI : RegUnits) { RUI.VirtI.advanceTo(Start); if (RUI.FixedI != RUI.Fixed->end()) RUI.FixedI = RUI.Fixed->advanceTo(RUI.FixedI, Start); @@ -162,8 +160,8 @@ void InterferenceCache::Entry::update(unsigned MBBNum) { BI->First = BI->Last = SlotIndex(); // Check for first interference from virtregs. - for (unsigned i = 0, e = RegUnits.size(); i != e; ++i) { - LiveIntervalUnion::SegmentIter &I = RegUnits[i].VirtI; + for (RegUnitInfo &RUI : RegUnits) { + LiveIntervalUnion::SegmentIter &I = RUI.VirtI; if (!I.valid()) continue; SlotIndex StartI = I.start(); @@ -174,9 +172,9 @@ void InterferenceCache::Entry::update(unsigned MBBNum) { } // Same thing for fixed interference. - for (unsigned i = 0, e = RegUnits.size(); i != e; ++i) { - LiveInterval::const_iterator I = RegUnits[i].FixedI; - LiveInterval::const_iterator E = RegUnits[i].Fixed->end(); + for (RegUnitInfo &RUI : RegUnits) { + LiveInterval::const_iterator I = RUI.FixedI; + LiveInterval::const_iterator E = RUI.Fixed->end(); if (I == E) continue; SlotIndex StartI = I->start; @@ -213,8 +211,8 @@ void InterferenceCache::Entry::update(unsigned MBBNum) { } // Check for last interference in block. - for (unsigned i = 0, e = RegUnits.size(); i != e; ++i) { - LiveIntervalUnion::SegmentIter &I = RegUnits[i].VirtI; + for (RegUnitInfo &RUI : RegUnits) { + LiveIntervalUnion::SegmentIter &I = RUI.VirtI; if (!I.valid() || I.start() >= Stop) continue; I.advanceTo(Stop); @@ -229,9 +227,9 @@ void InterferenceCache::Entry::update(unsigned MBBNum) { } // Fixed interference. - for (unsigned i = 0, e = RegUnits.size(); i != e; ++i) { - LiveInterval::iterator &I = RegUnits[i].FixedI; - LiveRange *LR = RegUnits[i].Fixed; + for (RegUnitInfo &RUI : RegUnits) { + LiveInterval::iterator &I = RUI.FixedI; + LiveRange *LR = RUI.Fixed; if (I == LR->end() || I->start >= Stop) continue; I = LR->advanceTo(I, Stop); |