Hello,<div><br></div><div>I'm afraid I don't understand your question. Could you restate your example and your question, and say what specifically you would like alias analysis to do?</div><div><br></div><div>Dan<br>
<br><div class="gmail_quote">
On Fri, Nov 9, 2012 at 9:31 AM, Shuxin Yang <span dir="ltr"><<a href="mailto:shuxin.llvm@gmail.com" target="_blank">shuxin.llvm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Sorry the 1st example I gave it bit lame, it is changed to following:<br>
<br>
   // a[] is local array, no addr taken. die right after the loop<div><br>
   for (i = 0; i < N; i++) {<br></div>
       a[i] = ... /* s1 */<br>
       sum += a[i-1];<br>
   }<br>
<br>
 S1 could be easily deleted if alias analyizer say a[i] and a[i-1].<div><div><br>
<br>
<br>
On 11/8/12 6:07 PM, Shuxin Yang wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
    In today meeting, Dan gave a very impressive talk about alias analysis.<br>
I had a question about the example in his slide, something like:<br>
<br>
  for (i = 0; i < N; i++) a[i] = a[i-1] + 1;<br>
<br>
 For the sake of convenience, let A1, A2 be a[i] and a[i-1] respectively.<br>
In Dan's design, Alias(A1, A2) would give "no alias", and in order to<br>
prevent A2 from being mistakenly moved out of loop, the optimizer<br>
needs to query dependence test as well.<br>
<br>
  The problems is how optimizer combine the results from alias analysis<br>
and dependence test?<br>
<br>
  If I change the code little bit, into following, then combining the<br>
querying dependence testing would prevent hosting *q.<br>
<br>
  // points-to(p) = { a, b }<br>
  // points-to(q) = { c, d }<br>
  for (i = 0; i < N; i++) *p += *q + 1;<br>
<br>
Thanks<br>
Shuxin<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>