Actually, with -basicaa, the alias result only makes sense for instructions in the same scope:<br><br>  %9 = getelementptr inbounds i32* %8, i32 %7<br>-->  %13 = getelementptr inbounds i32* %12, i32 %11<br>May Alias<br>
<br>  %9 = getelementptr inbounds i32* %8, i32 %7<br>-->  %18 = getelementptr inbounds i32* %17, i32 %16<br>May Alias<br><br>  %9 = getelementptr inbounds i32* %8, i32 %7<br>-->  %8 = getelementptr inbounds [10 x i32]* %a, i32 0, i32 %7<br>
May Alias<br><br>  %9 = getelementptr inbounds i32* %8, i32 %7<br>-->  %13 = getelementptr inbounds [10 x i32]* %a, i32 0, i32 0<br>May Alias<br><br>  %9 = getelementptr inbounds i32* %8, i32 %7<br>-->  %14 = getelementptr inbounds [10 x i32]* %b, i32 0, i32 0<br>
May Alias<br><br>  %13 = getelementptr inbounds i32* %12, i32 %11<br>-->  %18 = getelementptr inbounds i32* %17, i32 %16<br>May Alias<br><br>  %13 = getelementptr inbounds i32* %12, i32 %11<br>-->  %8 = getelementptr inbounds [10 x i32]* %a, i32 0, i32 %7<br>
May Alias<br><br>  %13 = getelementptr inbounds i32* %12, i32 %11<br>-->  %13 = getelementptr inbounds [10 x i32]* %a, i32 0, i32 0<br>May Alias<br><br>  %13 = getelementptr inbounds i32* %12, i32 %11<br>-->  %14 = getelementptr inbounds [10 x i32]* %b, i32 0, i32 0<br>
May Alias<br><br>  %18 = getelementptr inbounds i32* %17, i32 %16<br>-->  %8 = getelementptr inbounds [10 x i32]* %a, i32 0, i32 %7<br>May Alias<br><br>  %18 = getelementptr inbounds i32* %17, i32 %16<br>-->  %13 = getelementptr inbounds [10 x i32]* %a, i32 0, i32 0<br>
May Alias<br><br>  %18 = getelementptr inbounds i32* %17, i32 %16<br>-->  %14 = getelementptr inbounds [10 x i32]* %b, i32 0, i32 0<br>May Alias<br><br>  %8 = getelementptr inbounds [10 x i32]* %a, i32 0, i32 %7<br>-->  %13 = getelementptr inbounds [10 x i32]* %a, i32 0, i32 0<br>
Partial Alias<br><br>  %8 = getelementptr inbounds [10 x i32]* %a, i32 0, i32 %7<br>-->  %14 = getelementptr inbounds [10 x i32]* %b, i32 0, i32 0<br>No Alias<br><br>  %13 = getelementptr inbounds [10 x i32]* %a, i32 0, i32 0<br>
-->  %14 = getelementptr inbounds [10 x i32]* %b, i32 0, i32 0<br>No Alias<br><br><br>The real information I am after is the getModRefInfo() result, however, even with AA turned on, the modref info is still useless for a function call.<br>
  call void @_Z3fooPiS_(i32* %13, i32* %14)<br>  %a = alloca [10 x i32], align 4<br>3<br>  %b = alloca [10 x i32], align 4<br>3<br><br><br>Are there any other projects or examples that use LLVM AA infrastructure to perform array ModRef analysis?<br>
<br><br>Thanks,<br>Welson<br><br><br><br><div class="gmail_quote">On Thu, Feb 16, 2012 at 1:27 PM, Welson Sun <span dir="ltr"><<a href="mailto:welson.sun@gmail.com">welson.sun@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Thanks Duncan! You are right! If I type the command "opt -basicaa -mypass ...", then the output makes sense.</div><div><br></div><div>Now, how can you specify which AA to use in the code?</div><div><br></div>

<div><br></div><div>Regards,</div><div>Welson</div><div class="HOEnZb"><div class="h5"><div><br></div><br><br><div class="gmail_quote">On Thu, Feb 16, 2012 at 12:05 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Welson, the default alias analysis is -no-aa.  As the name suggests it<br>
just returns MayAlias for everything.  Maybe you are using that one?<br>
<br>
Best wishes, Duncan.<br>
_______________________________________________<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/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><div class="HOEnZb"><div class="h5">-- <br>Welson<div><br></div><div>Phone: <a href="tel:%28408%29%20418-8385" value="+14084188385" target="_blank">(408) 418-8385</a></div>
<div>Email:  <a href="mailto:welson.sun@gmail.com" target="_blank">welson.sun@gmail.com</a></div><div><br>
</div><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Welson<div><br></div><div>Phone: (408) 418-8385</div><div>Email:  <a href="mailto:welson.sun@gmail.com" target="_blank">welson.sun@gmail.com</a></div><div><br>
</div><br>