[LLVMdev] Problems understanding alias analysis validation logic

Devang Patel dpatel at apple.com
Fri Aug 15 16:34:21 PDT 2008


On Aug 15, 2008, at 7:46 AM, Damien D Neff wrote:

>
> 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:

Simple answer, the pass manager is not smart enough. It does not  
remember that it invalidated one of the specialized analysis pass. It  
could be extended to handle this.
-
Devang

>
>
> 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
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list