Insert loop into LQ before visiting children.

llvm-svn: 34982
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp
index b6b862e..d44e41a 100644
--- a/llvm/lib/Analysis/LoopPass.cpp
+++ b/llvm/lib/Analysis/LoopPass.cpp
@@ -138,9 +138,9 @@
 
 // Recurse through all subloops and all loops  into LQ.
 static void addLoopIntoQueue(Loop *L, std::deque<Loop *> &LQ) {
+  LQ.push_back(L);
   for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
     addLoopIntoQueue(*I, LQ);
-  LQ.push_back(L);
 }
 
 /// Pass Manager itself does not invalidate any analysis info.