[LLVMdev] Re: Dependence Analysis

Chris Lattner sabre at nondot.org
Wed Jul 20 23:35:05 PDT 2005


On Thu, 21 Jul 2005, Aaron Gray wrote:
> This may sound like a dumb question but for those who do not follow either :-
>   "why do you want to turn pointers into indexes ?"

It makes the code far easier to perform dependence analysis on.  For 
example, this code:

   int A[100];
   int *B;
   for (B = &A[1]; ... ; ++i, ++B)
     *B = A[i];

If you turn that into:

   for (; ... ; ++i, ++B)
     A[i+1] = A[i];

... it is much easier for analyzers to understand.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list