Ignore lifetime intrinsics in use list for MemCpyOptimizer. Patch by Luqman Aden...
[oota-llvm.git] / lib / Transforms / Utils / LoopUnrollRuntime.cpp
index ce420ee4bf0b607ff8db6602c4c8a4f14d8efabc..a96c46ad63e0d62d658dc51e49b30b2b221881d8 100644 (file)
@@ -66,8 +66,9 @@ static void ConnectProlog(Loop *L, Value *TripCount, unsigned Count,
   // The new PHI node is inserted in the prolog end basic block.
   // The new PHI name is added as an operand of a PHI node in either
   // the loop header or the loop exit block.
-  for (BasicBlock *Succ : successors(Latch)) {
-    for (BasicBlock::iterator BBI = Succ->begin();
+  for (succ_iterator SBI = succ_begin(Latch), SBE = succ_end(Latch);
+       SBI != SBE; ++SBI) {
+    for (BasicBlock::iterator BBI = (*SBI)->begin();
          PHINode *PN = dyn_cast<PHINode>(BBI); ++BBI) {
 
       // Add a new PHI node to the prolog end block and add the