<div dir="ltr"><div>Hi</div><div><br></div>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).<div><br></div><div>What I have done is that I</div><div><br></div><div>---make lib/Analysis/BasicAliasAnalysis.cpp into a .so file</div><div>---write a sample c program, hello.c, with the following code<br></div><div><br></div><div><div>#include<stdio.h></div><div><br></div><div>int main()</div><div>{</div><div>    int a;</div><div>    int *p;</div><div>    p = &a;</div><div>    a = 10;</div><div>    printf("Hello World");</div><div>    return 0;</div><div>}</div></div><div><br></div><div>---compile the c program into bit code by doing</div><div>clang -c -emit-llvm hello.c -o hello.bc<br></div><div><br></div><div>---run the bit code through basicaa pass</div><div>opt -load lib/AliasAnalysis.so -basicaa < hello.bc > result.bc</div><div><br></div><div>---display the resulted bit code</div><div>llvm-dis result.bc -o -</div><div><br></div><div>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.</div><div><br></div><div>Could someone explain what I should do to get some results from basicaa alias analysis pass?</div><div><br></div><div>Thank you very much.  Your help is much appreciated!</div><div><br></div><div>Sheng-Hsiu</div></div>