[LLVMdev] Comparison of Alias Analysis in LLVM

Jianzhou Zhao jianzhou at seas.upenn.edu
Wed Jan 4 10:36:31 PST 2012


On Wed, Jan 4, 2012 at 12:10 PM, David Gardner <daveg at xmos.com> wrote:
> Jianzhou Zhao <jianzhou <at> seas.upenn.edu> writes:
>> The documents say that all the aa analysis are chained, and give an
>> example like opt -basicaa -ds-aa -licm. In this case, does ds-aa
>> automatically call basicaa for the case when ds-aa can only return
>> MayAlias? This looks magic to me. Is this handled by AnalysisGroup
>> magically?
>
> As I understand it, the simplest AA pass which can determine reliable
> information is the one which is used, which then chains on to more
> complex (and presumably slower) passes.  In this way something like
> basicaa can determine a few things as definite and anything it cannot
> determine it chains onto another pass (e.g. ds- aa) to have a go at.
> This will continue until it finds a definite answer or runs out of AA
> passes.

Hi David,

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.

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?

>
> The chaining is used with masking of the results to ensure that the
> result only becomes more accurate, even if a chained-to pass doesn't
> have any idea what to do (at least for mod/ref info, so I presume it
> is similar for alias() calls).
>
>
> _______________________________________________
> 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