LiveIntervalAnalysis: Fix performance bug that I introduced in r224663.
[oota-llvm.git] / lib / CodeGen / LiveIntervalAnalysis.cpp
index 8c53658595c8513f73365d3e485f580bce5403c9..56f38b6407d95d6abd4f9c7691918d6c7e098642 100644 (file)
@@ -676,7 +676,7 @@ void LiveIntervals::addKillFlags(const VirtRegMap *VRM) {
       // There should be no kill flag on FOO when %vreg5 is rewritten as %EAX.
       for (auto &RUP : RU) {
         const LiveRange &RURange = *RUP.first;
-        LiveRange::const_iterator I = RUP.second;
+        LiveRange::const_iterator &I = RUP.second;
         if (I == RURange.end())
           continue;
         I = RURange.advanceTo(I, RI->end);
@@ -704,7 +704,7 @@ void LiveIntervals::addKillFlags(const VirtRegMap *VRM) {
           DefinedLanesMask = 0;
           for (auto &SRP : SRs) {
             const LiveInterval::SubRange &SR = *SRP.first;
-            LiveRange::const_iterator I = SRP.second;
+            LiveRange::const_iterator &I = SRP.second;
             if (I == SR.end())
               continue;
             I = SR.advanceTo(I, RI->end);