Remove the successor probabilities normalization in tail duplication pass.
[oota-llvm.git] / lib / CodeGen / PHIEliminationUtils.cpp
index 14cb94b05ba1241a9c0d7022abcd95a65d02df78..4cabc3a8c1fde7031da8f0667253d0d39fbc0c74 100644 (file)
@@ -28,17 +28,15 @@ llvm::findPHICopyInsertPoint(MachineBasicBlock* MBB, MachineBasicBlock* SuccMBB,
   // Usually, we just want to insert the copy before the first terminator
   // instruction. However, for the edge going to a landing pad, we must insert
   // the copy before the call/invoke instruction.
-  if (!SuccMBB->isLandingPad())
+  if (!SuccMBB->isEHPad())
     return MBB->getFirstTerminator();
 
   // Discover any defs/uses in this basic block.
   SmallPtrSet<MachineInstr*, 8> DefUsesInMBB;
   MachineRegisterInfo& MRI = MBB->getParent()->getRegInfo();
-  for (MachineRegisterInfo::reg_instr_iterator
-       RI = MRI.reg_instr_begin(SrcReg), RE = MRI.reg_instr_end();
-       RI != RE; ++RI) {
-    if (RI->getParent() == MBB)
-      DefUsesInMBB.insert(&*RI);
+  for (MachineInstr &RI : MRI.reg_instructions(SrcReg)) {
+    if (RI.getParent() == MBB)
+      DefUsesInMBB.insert(&RI);
   }
 
   MachineBasicBlock::iterator InsertPoint;