diff options
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index a02d8ea396d..2d3ff839f1f 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -3046,11 +3046,11 @@ static bool prepareICWorklistFromFunction(Function &F, const DataLayout &DL, // Do a quick scan over the function. If we find any blocks that are // unreachable, remove any instructions inside of them. This prevents // the instcombine code from having to deal with some bad special cases. - for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { - if (Visited.count(&*BB)) + for (BasicBlock &BB : F) { + if (Visited.count(&BB)) continue; - unsigned NumDeadInstInBB = removeAllNonTerminatorAndEHPadInstructions(&*BB); + unsigned NumDeadInstInBB = removeAllNonTerminatorAndEHPadInstructions(&BB); MadeIRChange |= NumDeadInstInBB > 0; NumDeadInst += NumDeadInstInBB; } |