summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-03-18 21:51:46 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-03-18 21:51:46 +0000
commita22773cd45e82e07691284abf85f0fa967eef520 (patch)
tree9943d503f4cb1b1b46dccf3253b490d5d9b5f34d /lib
parent18d3426b8933e433a1a12171643f0e8dc6b1c6b9 (diff)
downloadllvm-a22773cd45e82e07691284abf85f0fa967eef520.tar.gz
llvm-a22773cd45e82e07691284abf85f0fa967eef520.tar.bz2
llvm-a22773cd45e82e07691284abf85f0fa967eef520.tar.xz
[LV] Replace some dead code with an assert. When I first ported this
pass from a loop pass to a function pass I did so in the naive, recursive way. It doesn't actually work, we need a worklist instead. When I switched to the worklist I didn't delete the naive recursion. That recursion was also buggy because it was dead and never really exercised. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 435c0054d0..dd8d5fce8d 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1067,8 +1067,8 @@ struct LoopVectorize : public FunctionPass {
// We only handle inner loops, so if there are children just recurse.
if (!L->empty()) {
bool Changed = false;
- for (Loop::iterator I = L->begin(), E = L->begin(); I != E; ++I)
- Changed |= processLoop(*I);
+ for (Loop *InnerL : *L)
+ Changed |= processLoop(InnerL);
return Changed;
}