[mips][microMIPS] MicroMIPS Compact Branch Instructions BEQZC and BNEZC
[oota-llvm.git] / lib / Target / AArch64 / AArch64A57FPLoadBalancing.cpp
index 705679b570e64d4fcd7f5109ea63ffa8c60d6986..dc8cb32d199e0c3008496f60cc0b828e859900af 100644 (file)
@@ -671,13 +671,14 @@ maybeKillChain(MachineOperand &MO, unsigned Idx,
   } else if (MO.isRegMask()) {
 
     for (auto I = ActiveChains.begin(), E = ActiveChains.end();
-         I != E; ++I) {
+         I != E;) {
       if (MO.clobbersPhysReg(I->first)) {
         DEBUG(dbgs() << "Kill (regmask) seen for chain "
               << TRI->getName(I->first) << "\n");
         I->second->setKill(MI, Idx, /*Immutable=*/true);
-        ActiveChains.erase(I);
-      }
+        ActiveChains.erase(I++);
+      } else
+        ++I;
     }
 
   }