[LLVMdev] Accessing Loop Variables

dhruv choudhary choudharydhruv at gmail.com
Mon Oct 12 08:08:58 PDT 2009


Hi,

You can use the getInductionVariable() on each loop,and maintain a smallvect
of all induction variables that you have come across.
Also remember to run some passes to hoist loop independent entities out of
the loop.

Cheers

Dhruv

On Mon, Oct 12, 2009 at 6:46 AM, Prasenjit Chakraborty
<cprasenj at in.ibm.com>wrote:

>
> Hi,
>      How do I access the loop variables in a loop.
>
> for(i = 0; i < N; i++)
>      for(j = 0; j < M; j++)
>            A[i][j+k] = i + j;
>
> Is there anyway for me to know that in A[i][j+k], i & j are loop variables
> whereas k is not!
>
> Regards,
>
> Prasenjit Chakraborty
> Performance Modeling and Analysis
> IBM Systems & Technology Lab
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 
School of Electrical and Computer Engineering
Georgia Institute of Technology

(M)  +1 770 827 9264
Personal Email : choudharydhruv at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091012/ad01c59a/attachment.html>


More information about the llvm-dev mailing list