[LLVMdev] Comparison of Alias Analysis in LLVM

Jianzhou Zhao jianzhou at seas.upenn.edu
Thu Jan 5 05:25:20 PST 2012


On Thu, Jan 5, 2012 at 4:14 AM, David Gardner <daveg at xmos.com> wrote:
> Jianzhou Zhao <jianzhou <at> seas.upenn.edu> writes:
>> At this level, I can understand how it works. I was confused because I
>> have been looking at the source code for implementing them. All the
>> globalmodref, scev-aa, steenaa and ds-aa are only subclasses of the
>> AliasAnalysis class, so I cannot see how ds-aa can automatically call
>> basicaa.
>
> There's some magic in the pass registration which adds them with a
> `previous' link between AA passes, so the base AliasAnalysis class
> ends up calling the previous one via the "AliasAnalysis *AA" member.
>
>> What I guess is that the order of the flags matters. This means if I
>> want to chain a simple AA (say, -basicaa) and a fancier one (ds-aa), I
>> should add the  -basicaa before -ds-aa to define the chain, which the
>> AnalysisGroup can understand. If I add ds-aa before basicaa, does that
>> mean basicaa will chain with ds-aa backward?
>
> It will affect the order of the usage of the particular alias analysis
> passes, but the last one specified is called first (so -basicaa -ds-aa
> will cause ds-aa to be used first, then chain to basicaa as the previous
> AA pass).  However, I believe that it should not affect the accuracy of
> the alias information as the chaining will stop when a definite answer
> is reached, whatever the order of the chained passes.

Thanks. This makes a lot of sense.

>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



-- 
Jianzhou




More information about the llvm-dev mailing list