Hi, If I do a loop over the basic blocks in a LoopInfo object, is it going to loop over the basic blocks of the loop AND the subloops of the loop or just the BBs of the loop itself? Thanks! -bw
On Mon, 10 Dec 2007, Bill Wendling wrote:> If I do a loop over the basic blocks in a LoopInfo object, is it going > to loop over the basic blocks of the loop AND the subloops of the loop > or just the BBs of the loop itself?A loop's block list include blocks that are part of subloops. The canonical way to determine if a block is in "this loop and not a child" is: if (LI->getLoopFor(BB) == ThisLoop) If BB is part of a child loop, getLoopFor will return it so the compare will fail. -Chris -- http://nondot.org/sabre/ http://llvm.org/
On Dec 10, 2007, at 5:09 PM, Bill Wendling wrote:> Hi, > > If I do a loop over the basic blocks in a LoopInfo object, is it going > to loop over the basic blocks of the loop AND the subloops of the loopyes> > or just the BBs of the loop itself? > > Thanks! > -bw > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev- Devang