[LLVMdev] Using basicaa alias analysis pass

Sheng-Hsiu Lin shl311 at lehigh.edu
Wed Jan 21 08:09:42 PST 2015


Hi

I am completely new to LLVM, and I am trying to explore the alias analysis
part of it.  It seems to me that -basicaa is the most simple alias analysis
pass in LLVM.  So I would like to try and make it work (to see some alias
analysis results of some sample bit code).

What I have done is that I

---make lib/Analysis/BasicAliasAnalysis.cpp into a .so file
---write a sample c program, hello.c, with the following code

#include<stdio.h>

int main()
{
    int a;
    int *p;
    p = &a;
    a = 10;
    printf("Hello World");
    return 0;
}

---compile the c program into bit code by doing
clang -c -emit-llvm hello.c -o hello.bc

---run the bit code through basicaa pass
opt -load lib/AliasAnalysis.so -basicaa < hello.bc > result.bc

---display the resulted bit code
llvm-dis result.bc -o -

However, the resulted bit code result.bc is exactly the same as the
original bit code hello.bc.  That is no alias analysis information is
printed on the screen or recorded in the resulting result.bc file.

Could someone explain what I should do to get some results from basicaa
alias analysis pass?

Thank you very much.  Your help is much appreciated!

Sheng-Hsiu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150121/0f9d400e/attachment.html>


More information about the llvm-dev mailing list