Hi ! I'm writting an AliasAnalysis using the online tutorial (http://www.llvm.org/docs/AliasAnalysis.html). My problem is to chain this pass (function Pass in my case) with the basicAA ... I know that my pass is running (runOnFunction) but the virtual methods derived from AliasAnalysis (alias, getModRefInfo, etc ... ) are never called (even in the case wherer the basicAA reaches the end of 'getModRefInfo(CallSite CS, Value *P, unsigned Size)' virtual function) Either, i misunderstood the process of AA (I expect that each virtual method of each AA are called if they are defined until one of them gives a result (and that's why we need the last 'return') ( = the chain) , but maybe it's not true ) or i have forgotten a special instruction (something like 'registration of a new AA' ) , or maybe both :) Could anybody give me an advice, please ? Thank you ! Julien
Hi ! In my quest of implementing my own AA, i understood that it doesn't work because i don't use the 'opt' tool but i create my own PassManager (this for other reasons). The problem is the same with other existing AA (AndersensPass or globalModRefPass) : these AApasses are not chained with the basicAA when they are created in PassManager ... So my question is now : how to call an AAPass using a local PassManager (without opt) ? Thank you ! Julien
Julien Schmitt wrote:> Hi ! > In my quest of implementing my own AA, i understood that it doesn't work > because i don't use the 'opt' tool but i create my own PassManager (this > for other reasons). > The problem is the same with other existing AA (AndersensPass or > globalModRefPass) : > these AApasses are not chained with the basicAA when they are created in > PassManager ... > > So my question is now : how to call an AAPass using a local PassManager > (without opt) ? >I'm assuming that by "creating your own PassManager" you mean that you're writing your own C++ tool that creates a PassManager object and then explicitly adds passes using the add() method of PassManager. Is this correct? In that case, I think all you need to do is to explicitly specify your alias analysis as one of the passes to run: PassManager Passes; Passes.add (new YourAliasAnalysisPass()); Passes.add (new WhateverPassUsesTheAliasAnalysisInterface()); Creating a pass in the AliasAnalysis group doesn't mean that it will automatically be run when an alias analysis is needed. Rather, what it means is that *if* a pass requests an AliasAnalysis group pass *and* your pass has already been executed, the pass requesting an AliasAnalysis group pass will find your pass and use it. That is why you need to add it explicitly. If you don't add it explicitly, the PassManager will simply use the default AliasAnalisys group pass, which I believe is BasicAA. Does this help answer your question, or am I misunderstanding something? -- John T.> Thank you ! > > Julien > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >