[LLVMdev] basicaa result

Hal Finkel hfinkel at anl.gov
Thu Feb 19 16:19:29 PST 2015


----- Original Message -----
> From: "Haopeng Liu" <hyliuhp at gmail.com>
> To: LLVMdev at cs.uiuc.edu
> Sent: Thursday, February 19, 2015 6:07:10 PM
> Subject: [LLVMdev] basicaa result
> 
> Hi,
> 
> I'm trying to explore basicaa alias analysis.
> 
> test.c:
> int main() {
>      int a;
>      int *p, *q;
>      p = &a;
>      q = p;
>      ...
> }
> 
> Commands:
> clang -emit-llvm -c -g -O0 test.c -o test.bc
> opt -basicaa -print-must-aliases test.bc
> 
> However, the result shows that p and q are no alias.

If you've run only -O0, then you're likely looking at the aliasing of the local stack areas assigned to 'p' and 'q', and they are distinct.

 -Hal

> 
> Could anyone explain it? Your help is much appreciated!
> 
> -Haopeng
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list