[PATCH] Improve BasicAA CS-CS queries

Chandler Carruth chandlerc at google.com
Mon Jul 7 21:13:19 PDT 2014


Adding someone who might be interested in this patch...


On Mon, Jul 7, 2014 at 8:59 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> Ping.
>
>  -Hal
>
> ----- Original Message -----
> > From: hfinkel at anl.gov
> > To: hfinkel at anl.gov, aschwaighofer at apple.com, dan433584 at gmail.com
> > Cc: llvm-commits at cs.uiuc.edu
> > Sent: Saturday, June 28, 2014 7:21:16 AM
> > Subject: [PATCH] Improve BasicAA CS-CS queries
> >
> > Hi aschwaighofer, sunfish,
> >
> > BasicAA contains knowledge of certain intrinsics, such as memcpy and
> > memset, and uses that information to form more-accurate answers to
> > CallSite vs. Loc ModRef queries. Unfortunately, it does not use this
> > information when answering CallSite vs. CallSite queries.
> >
> > Generically, when an intrinsic takes one or more pointers and the
> > intrinsic is marked only to read/write from its arguments, the
> > offset/size is unknown. As a result, the generic code that answers
> > CallSite vs. CallSite (and CallSite vs. Loc) queries in AA uses
> > UnknownSize when forming Locs from an intrinsic's arguments. While
> > BasicAA's CallSite vs. Loc override could use more-accurate size
> > information for some intrinsics, it did not do the same for CallSite
> > vs. CallSite queries.
> >
> > This patch refactors the intrinsic-specific logic in BasicAA into a
> > generic AA query function: getArgLocation, which is overridden by
> > BasicAA to supply the intrinsic-specific knowledge, and used by AA's
> > generic implementation. This allows the intrinsic-specific knowledge
> > to be used by both CallSite vs. Loc and CallSite vs. CallSite
> > queries, and simplifies the BasicAA implementation.
> >
> > Currently, only one function, Mac's memset_pattern16, is handled by
> > BasicAA (all the rest are intrinsics). As a side-effect of this
> > refactoring, BasicAA's getModRefBehavior override now also returns
> > OnlyAccessesArgumentPointees for this function (which is an
> > improvement).
> >
> > http://reviews.llvm.org/D4342
> >
> > Files:
> >   include/llvm/Analysis/AliasAnalysis.h
> >   lib/Analysis/AliasAnalysis.cpp
> >   lib/Analysis/BasicAliasAnalysis.cpp
> >   lib/Analysis/NoAliasAnalysis.cpp
> >   test/Analysis/BasicAA/cs-cs.ll
> >
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140707/de03e4b6/attachment.html>


More information about the llvm-commits mailing list