[llvm] r204184 - [LV] Replace some dead code with an assert. When I first ported this

Chandler Carruth chandlerc at gmail.com
Tue Mar 18 14:51:46 PDT 2014


Author: chandlerc
Date: Tue Mar 18 16:51:46 2014
New Revision: 204184

URL: http://llvm.org/viewvc/llvm-project?rev=204184&view=rev
Log:
[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.

Modified:
    llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp

Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=204184&r1=204183&r2=204184&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Tue Mar 18 16:51:46 2014
@@ -1067,8 +1067,8 @@ struct LoopVectorize : public FunctionPa
     // 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;
     }
 





More information about the llvm-commits mailing list