[LLVMdev] How to uniquely remember a loop?

Andrew Trick atrick at apple.com
Mon Aug 20 12:04:52 PDT 2012


On Aug 16, 2012, at 1:09 PM, "Rao, Prashantha" <Prashantha.Rao at amd.com> wrote:

> Hi-
>  
> I am writing a pass to traverse loops and collect some analysis data and later on come back to transform the IR. In the analysis phase I need to remember statistics regarding every loop in the program. What is the best way to uniquely remember a loop?

Probably too late to help you but... loops are identified by their header block. Depending on your situation you might directly point to the block or refer to its name. If you need to be more robust across CFG optimization and inlining, you'll have to use debug info instead.
-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120820/d2ba3c75/attachment.html>


More information about the llvm-dev mailing list