[LLVMdev] Incorrect result in LLVM Alias Analysis

Duncan Sands baldrick at free.fr
Sat Apr 14 05:03:25 PDT 2012


Hi Adarsh,

>> I have used the follwing command,
>> opt -load LLVComMan.so -ComMan -memdep -tbaa -mem2reg maptest.ll   -S
>> What option other than -mem2reg should be included in this case to get the
>> right results? Does the order in which I specify the optimizations to be run
>> make a difference?

you should be using -basicaa not -tbaa.  TBAA won't do anything here because you
don't have any tbaa metadata.  Also, specifying tbaa won't automagically cause
basicaa to be used too: if you want them both (and to chain to each other) then
you need to specify both of them AFAIK.

Notice "must alias" in what follows.

$ opt -basicaa -mem2reg adarsh.ll -disable-output -aa-eval
===== Alias Analysis Evaluator Report =====
   1 Total Alias Queries Performed
   0 no alias responses (0.0%)
   0 may alias responses (0.0%)
   0 partial alias responses (0.0%)
   1 must alias responses (100.0%)
   Alias Analysis Evaluator Pointer Alias Summary: 0%/0%/0%/100%
   6 Total ModRef Queries Performed
   0 no mod/ref responses (0.0%)
   0 mod responses (0.0%)
   0 ref responses (0.0%)
   6 mod & ref responses (100.0%)
   Alias Analysis Evaluator Mod/Ref Summary: 0%/0%/0%/100%


Ciao, Duncan.



More information about the llvm-dev mailing list