diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index ee3f38a9591..d6b167f8b84 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -282,10 +282,9 @@ ReprocessLoop:        // Attempt to hoist out all instructions except for the        // comparison and the branch.        bool AllInvariant = true; -      for (BasicBlock::iterator I = ExitingBlock->begin(), -           E = ExitingBlock->end(); I != E; ) { +      for (BasicBlock::iterator I = ExitingBlock->begin(); &*I != BI; ) {          Instruction *Inst = I++; -        if (Inst == BI || Inst == CI) +        if (Inst == CI)            continue;          if (Inst->isTrapping()) {            AllInvariant = false; | 

