[LLVMdev] sample-code for alias-analysis

RAAD B raad_7007 at yahoo.com
Thu Mar 19 02:27:48 PDT 2009


Hi,

i need a sample-code, for which the llvm alias-analysis finds a *must-aliases*.
I have tried codes like followings. In all cases, i see just *may-aliases* when i use "opt -aa-eval -print-all-alias-modref-info foo.bc":

Regards
Raad 


1 ==========================================
void foo() {
    int i = 2;
    int& r = i;
} 

2 ===========================================
void foo(){
    int gi;
    int *gip1 = &gi;
    int *gip2 = &gi;
}

3 ==========================================
void foo (double * fa){
    int fi, fj;
    fi = 0;
    fj = 2;
    if (! fa)
        fj = fj + 4;
    fa[fi] = fa[fi + fj];
}



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090319/103392f3/attachment.html>


More information about the llvm-dev mailing list