hoist loop-invariant; NFCI
[oota-llvm.git] / lib / CodeGen / MachineCombiner.cpp
index 9af7a65ca41a18743d6316ecf790c1208024dafc..39adce380719a0a9d78161e9126d686006611884 100644 (file)
@@ -387,10 +387,9 @@ bool MachineCombiner::combineInstructions(MachineBasicBlock *MBB) {
         } else {
           // Cleanup instructions of the alternative code sequence. There is no
           // use for them.
-          for (auto *InstrPtr : InsInstrs) {
-            MachineFunction *MF = MBB->getParent();
+          MachineFunction *MF = MBB->getParent();
+          for (auto *InstrPtr : InsInstrs)
             MF->DeleteMachineInstr(InstrPtr);
-          }
         }
         InstrIdxForVirtReg.clear();
       }