[LLVMdev] Alias analysis interface

Shuxin Yang shuxin.llvm at gmail.com
Thu Nov 8 18:07:46 PST 2012


Hi,

     In today meeting, Dan gave a very impressive talk about alias 
analysis.
I had a question about the example in his slide, something like:

   for (i = 0; i < N; i++) a[i] = a[i-1] + 1;

  For the sake of convenience, let A1, A2 be a[i] and a[i-1] respectively.
In Dan's design, Alias(A1, A2) would give "no alias", and in order to
prevent A2 from being mistakenly moved out of loop, the optimizer
needs to query dependence test as well.

   The problems is how optimizer combine the results from alias analysis
and dependence test?

   If I change the code little bit, into following, then combining the
querying dependence testing would prevent hosting *q.

   // points-to(p) = { a, b }
   // points-to(q) = { c, d }
   for (i = 0; i < N; i++) *p += *q + 1;

Thanks
Shuxin















More information about the llvm-dev mailing list