[PATCH] D50730: [AST] Generalize argument specific aliasing

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 12:43:17 PDT 2018


reames created this revision.
reames added reviewers: mkazantsev, anna, hfinkel.
Herald added subscribers: llvm-commits, bollu, mcrosier.

AliasSetTracker has special case handling for memset, memcpy and memmove which pre-existed argmemonly on functions and readonly and writeonly on arguments.  This patch generalizes it using the AA infrastructure to any call correctly annotated.

The motivation here is to cut down on confusion, not performance per se.  For most instructions, there is a direct mapping to alias set.  However, this is not guaranteed by the interface and was not in fact true for these three intrinsics *and only these three intrinsics*.  I kept getting myself confused about this invariant, so I figured it would be good to clearly distinguish between a instructions and alias sets.  Calls happened to be an easy target.

The nice side effect is that custom implementations of memset/memcpy/memmove - including wrappers discovered by IPO - can now be optimized the same as builts by LICM.


Repository:
  rL LLVM

https://reviews.llvm.org/D50730

Files:
  include/llvm/Analysis/AliasSetTracker.h
  include/llvm/Analysis/MemoryLocation.h
  lib/Analysis/AliasAnalysis.cpp
  lib/Analysis/AliasSetTracker.cpp
  lib/Analysis/MemoryLocation.cpp
  test/Transforms/LICM/argmemonly-call.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50730.160668.patch
Type: text/x-patch
Size: 7720 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180814/15cecef1/attachment.bin>


More information about the llvm-commits mailing list