[LLVMdev] AliasAnalysis tutorial 2

Julien Schmitt jschmitt at dibcom.fr
Wed Dec 10 01:38:32 PST 2008


Thank you very much John for your answer , you understood well my problem
(and the signification of my "own" PassManager).

I already tried your solution but it is not enough. The problem is the 
same with
existing AA (andersen for example) : when calling with opt, this works 
well, but
when adding in local PassManager ( with add() ), it is not working (I 
test this with
the DeadStoreEliminationPass which performs an AA).
In particular,  the pass is run (runOnFunction) but the derived method from
AliasAnalysis (like 'alias' or 'getModRefInfo') are not chained with 
those from
basicAA when needed.

Now, i'm trying to understand how opt, RegisterPass, RegisterAnalysisGroup
etc, are working, but it is quite difficult (very high level C++!)

Thank you.

Julien



John Criswell a écrit :
> 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.
>
>   



More information about the llvm-dev mailing list