Comment: try to clarify loop iteration order.
authorAndrew Trick <atrick@apple.com>
Sat, 20 Jul 2013 23:10:31 +0000 (23:10 +0000)
committerAndrew Trick <atrick@apple.com>
Sat, 20 Jul 2013 23:10:31 +0000 (23:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186774 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/LoopPass.cpp

index 1540112fe10cfda4aa659f771b946e485ad717be..acf2ba63bd321d650ac5952bc138314efec16f80 100644 (file)
@@ -188,6 +188,10 @@ bool LPPassManager::runOnFunction(Function &F) {
   // advantage in deleting uses in a later loop before optimizing the
   // definitions in an earlier loop. If we find a clear reason to process in
   // forward order, then a forward variant of LoopPassManager should be created.
+  //
+  // Note that LoopInfo::iterator visits loops in reverse program
+  // order. Here, reverse_iterator gives us a forward order, and the LoopQueue
+  // reverses the order a third time by popping from the back.
   for (LoopInfo::reverse_iterator I = LI->rbegin(), E = LI->rend(); I != E; ++I)
     addLoopIntoQueue(*I, LQ);