[PATCH] improve BasicAA analysis of static globals.

Daniel Berlin dberlin at dberlin.org
Mon May 11 08:23:18 PDT 2015


1. Use Phabricator, please ;)

2. This almost certainly belongs in globalsmodref-aa, not in basicaa.

BasicAA is supposed to be stateless.

As written, your code will give wrong answers if i query it, get a
result, and then add a user of the static global that makes it escape.

There is deliberately no invalidation interface to BasicAA.

I understand BasicAA is a default and people therefore want to shove
everything into it. But BasicAA is slow enough already, and we should
be doing the opposite - moving expensive  and cached things out of
BasicAA into something that can cache and invalidate, and add it to
the defaults.



On Mon, May 11, 2015 at 6:36 AM, Sam Parker <sam.parker at arm.com> wrote:
> Hi,
>
>
>
> I’ve attached a patch for BasicAA to analyze whether a global variable has
> its address taken or not. This allows basicaa to return noalias for queries
> where object ‘A’ points to a static global that does not escape and object
> ‘B’ does not.
>
>
>
> Cheers,
>
> Sam
>
>
>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list