[LLVMdev] E = L->begin() in LoopVectorize

Liang Wang netcasper at gmail.com
Tue Mar 18 14:38:56 PDT 2014


Hi,

I'm studying loop vectorizer.  I don't understand the code yet.  But
it looks not right to assign L->begin() to E.  Is it a typo?

Thanks,
Liang

diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp
b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 435c005..87b5d79 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1067,7 +1067,7 @@ 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)
+      for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
         Changed |= processLoop(*I);
       return Changed;
     }



More information about the llvm-dev mailing list