[LLVMdev] madandas at soe.ucsc.edu

Duncan Sands baldrick at free.fr
Sun Nov 11 01:21:25 PST 2012


Hi Madan,

>    I'm trying to find if the access within a loop body is using the loop
> induction variable, and to get the start and end indices of the loop.
> for(int i = start; i < end; i++) {  A[i] = 0; }
> Let's say, I want to replace this with a function call   'zero(A,start, end)'

check out how lib/Transform/MemCpyOptimizer.cpp does it (this is where LLVM
turns loops like this into a call to memset).

Ciao, Duncan.

> How can I get the Value for start and end, and see if the index is same as loop
> induction variable? Assume loop is in loopsimplify form.
> I browsed many header files, but could't figure out.
> Thanks in advance!
> madan
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list