[LLVMdev] Adding structures in a loop pass

Devang Patel devang.patel at gmail.com
Thu Apr 23 10:08:30 PDT 2009

Hi Kshitiz,

On Wed, Apr 22, 2009 at 9:30 PM, Kshitiz Garg <ksh.cseiitk at gmail.com> wrote:
> Devang,
> Let me reframe my question.I require to keep this extra information as
> a structure so as to pass it around to other functions which require
> it. Specifically I am working on CellBE and wish to DMA this
> information to the SPEs The way of adding the information by PHI nodes
> will not suffise since the information may be very large in some cases
> which will need to be transfered by a DMA rather than by parameter
> passing.

In that case, you want to write an analysis pass that collect this
info which is used by another pass.

>  From what I know it is not allowed  to modify anything outside the
> loop's scope in a loop pass. A runonFunction method will run on
> functions and probably able to add this new struct type to the module.
> Can you provide me pointers towards obtaining loops inside
> runOnFunction method?

see LPPassManager::runOnFunction(Function &F)  in LoopPass.cpp


More information about the llvm-dev mailing list