>On Aug 16, 2012, at 1:09 PM, "Rao, Prashantha" <Prashantha.Rao at amd.com<mailto: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. >-AndyMore than one loop may share the same header; I can certainly run LoopSimplify as a prepass. But will that ensure unique loop header for each loop. As I will be performing transformation after the analysis other optimizations will not interfere (hopefully). Will the debug info metadata be available always? If so, what are good pointers to explore? Thanks, -Prashantha -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120821/94beef5c/attachment.html>
On Aug 21, 2012, at 4:17 AM, "Rao, Prashantha" <Prashantha.Rao at amd.com> wrote:> More than one loop may share the same header;You have a different definition of loop than the rest of the optimizer. You can identify your loops by the backedge if you prefer.> I can certainly run LoopSimplify as a prepass. But will that ensure unique loop header for each loop.It tries to split loops into single back edge loops. No guarantee.> As I will be performing transformation after the analysis other optimizations will not interfere (hopefully).Now it sounds like you're writing a standard in-process Analysis pass that can be used by your transformation without being invalidated. If so, just refer directly to Loop* from LoopInfo.> Will the debug info metadata be available always? If so, what are good pointers to explore?Certainly no guarantee. Do you want your optimization to depend on debug info? -Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120821/59bec1c6/attachment.html>
From: Andrew Trick [mailto:atrick at apple.com] Sent: Tuesday, August 21, 2012 9:58 PM To: Rao, Prashantha Cc: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] How to uniquely remember a loop? On Aug 21, 2012, at 4:17 AM, "Rao, Prashantha" <Prashantha.Rao at amd.com<mailto:Prashantha.Rao at amd.com>> wrote: More than one loop may share the same header; You have a different definition of loop than the rest of the optimizer. You can identify your loops by the backedge if you prefer. I can certainly run LoopSimplify as a prepass. But will that ensure unique loop header for each loop. It tries to split loops into single back edge loops. No guarantee. As I will be performing transformation after the analysis other optimizations will not interfere (hopefully). Now it sounds like you're writing a standard in-process Analysis pass that can be used by your transformation without being invalidated. If so, just refer directly to Loop* from LoopInfo. Will the debug info metadata be available always? If so, what are good pointers to explore? Certainly no guarantee. Do you want your optimization to depend on debug info? -Andy Andy- I will go with an Analysis phase followed by transformation phase and I will make LoopInfo run as prepass for analysis. That should make LoopInfo valid when I run analysis and transform. Thanks, -Prashantha -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120821/f671d7da/attachment.html>