[LLVMdev] Adding structures in a loop pass

Devang Patel devang.patel at gmail.com
Wed Apr 22 10:56:15 PDT 2009

On Wed, Apr 22, 2009 at 12:10 AM, Kshitiz Garg <ksh.cseiitk at gmail.com> wrote:
> Hello,
>     I wanted to do some speculative execution on a loop for which I
> require some data storage structure for book keeping. The exact
> structure of this storage buffer can only be determined after loop
> analysis. Is there a clean way to add this new structure to the
> module. Since this structure is to be used for each loop iteration I
> do not want to allocate it inside the loop.
>    A second alternative could be I run a module pass and go through
> the loop inside that. Is there a way to call the loop pass from inside
> the module pass or obtain information about the loops present inside
> the module and individually call the loop pass on them.


Your loop pass should be able to manage this extra information. See
various loop transformations implementation, for example LoopRotation
maintains LoopHeaderInfo.


More information about the llvm-dev mailing list