[PATCH] D17279: [Sink] Don't move calls to readonly functions across stores

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 12:21:01 PST 2016


hfinkel added a comment.

In http://reviews.llvm.org/D17279#372215, @nhaehnle wrote:

> In http://reviews.llvm.org/D17279#353238, @dberlin wrote:
>
> > Doesn't AA have an existing API that gives you exactly the info you want
> >  here (Does this call ref the memory touched the things in the store list)
>
>
> I see no such interface in AAResults at least. All queries test $something against a MemoryLocation, but the Stores are instructions because they could also be call sites. There would have to be an interface to test an instruction against an instruction, or two call sites against each other.


we have:

  /// getModRefInfo (for call sites) - Return information about whether
  /// a particular call site modifies or reads the specified memory location.
  ModRefInfo getModRefInfo(ImmutableCallSite CS, const MemoryLocation &Loc);
  
  /// getModRefInfo (for calls) - Return information about whether
  /// a particular call modifies or reads the specified memory location.
  ModRefInfo getModRefInfo(const CallInst *C, const MemoryLocation &Loc) {
    return getModRefInfo(ImmutableCallSite(C), Loc);
  }

and many others. Also, the the generic wrapper:

  ModRefInfo getModRefInfo(const Instruction *I, const MemoryLocation &Loc) {

all in include/llvm/Analysis/AliasAnalysis.h.


http://reviews.llvm.org/D17279





More information about the llvm-commits mailing list