diff --git a/lib/Transforms/Vectorize/BBVectorize.cpp b/lib/Transforms/Vectorize/BBVectorize.cpp index dc88e2c85f6..ce6e994c463 100644 --- a/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/lib/Transforms/Vectorize/BBVectorize.cpp @@ -1591,9 +1591,7 @@ namespace { std::multimap &LoadMoveSet, Instruction *I, Instruction *J) { // Skip to the first instruction past I. - BasicBlock::iterator L = BB.begin(); - for (; cast(L) != I; ++L); - ++L; + BasicBlock::iterator L = llvm::next(BasicBlock::iterator(I)); DenseSet Users; AliasSetTracker WriteSet(*AA); @@ -1613,9 +1611,7 @@ namespace { Instruction *&InsertionPt, Instruction *I, Instruction *J) { // Skip to the first instruction past I. - BasicBlock::iterator L = BB.begin(); - for (; cast(L) != I; ++L); - ++L; + BasicBlock::iterator L = llvm::next(BasicBlock::iterator(I)); DenseSet Users; AliasSetTracker WriteSet(*AA); @@ -1643,9 +1639,7 @@ namespace { std::multimap &LoadMoveSet, Instruction *I) { // Skip to the first instruction past I. - BasicBlock::iterator L = BB.begin(); - for (; cast(L) != I; ++L); - ++L; + BasicBlock::iterator L = llvm::next(BasicBlock::iterator(I)); DenseSet Users; AliasSetTracker WriteSet(*AA);