[LLVMdev] AliasAnalysis tutorial 2

Julien Schmitt jschmitt at dibcom.fr
Wed Dec 10 02:55:51 PST 2008


Well, now i added the creation of my AA just before the
creation of DSE, (in the former case it was done at top of all passes list)
and it's working (alias and getModRefInfo are called)...
Maybe a particular pass destroyed the AliasAnalysGroup ??

However he solution is not very clean, since i don't know which
pass need an AA (i guess this should be automatic whith the
method 'getAnalysisUsage' )

to be continued ...

Julien



Julien Schmitt a écrit :
> 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.
>>
>>
>>     
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
> CONFIDENTIAL NOTICE: The contents of this message, including any attachments, are confidential and are intended solely for the use of the person or entity to whom the message was addressed. If you are not the intended recipient of this message, please be advised that any dissemination, distribution, or use of the contents of this message is strictly prohibited. If you received this message in error, please notify the sender. Please also permanently delete all copies of the original message and any attached documentation. Thank you.
>   




More information about the llvm-dev mailing list