[LLVMdev] Problems understanding alias analysis validation logic

Damien D Neff ddneff at hotmail.com
Fri Aug 15 07:46:06 PDT 2008


I have a problem where I add an Andersens AA pass to the pass manager, but it appears to get invalidated by another pass, and never rerun.  My understanding from reading the documentation is that when a pass gets invalidated, it should be rerun before any other passes that requires it.  Here is a simple example of the problem I am seeing:  

PassManager passManager; 
passManager.add(new TargetData(getTargetData())); 
passManager.add(createAndersensPass()); 
passManager.add(createIPSCCPPass()); 
passManager.add(createGVNPass()); <----will use BasicAA not Andersens 
... 

In this case, I would expect that the GVN pass would use the andersen AA results, but it doesn't; it uses the results from a Basic AA pass.  Reordering the passes like below fixes the problem, but I still don't understand why the andersens wasn't rerun before the GVN pass in the case above:

PassManager passManager; 
passManager.add(new TargetData(*s_executionEngine->getTargetData())); 
passManager.add(createIPSCCPPass()); 
passManager.add(createAndersensPass()); 
passManager.add(createGVNPass()); <----will correctly use the Andersens 
... 

I am using code from the trunk that is about 2 weeks old.   Can anyone explain why the basicaa pass is used in the first case instead of the andersens, and what rule of thumb I need to follow to ensure that I get the AA pass I expect.  Thanks,

Damien
_________________________________________________________________
Get ideas on sharing photos from people like you.  Find new ways to share.
http://www.windowslive.com/explore/photogallery/posts?ocid=TXT_TAGLM_WL_Photo_Gallery_082008



More information about the llvm-dev mailing list