[PATCH] D86127: [Attributor] Make AAMemoryLocationCallSite behavior sane

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 21:46:29 PDT 2020


jdoerfert created this revision.
jdoerfert added reviewers: sstefan1, uenoku, homerdin, baziotis, kuter, bbn, okura.
Herald added subscribers: bollu, hiraditya.
Herald added a project: LLVM.
jdoerfert requested review of this revision.

Before this patch AAMemoryLocationCallSite did basically mirror the
corresponding AAMemoryLocationFunction. This has multiple drawbacks:

- Things like the "ONLY_ARGMEMONLY" bit in the state mean different things for a store to an argument and a call since the latter is referring to the callee arguments.
- We duplicated all accesses of the callee in the call site AA even though this is neither helpful nor can should we look at the instructions and pointers pointers in the context of the caller.

The new behavior decouples the call site `argmemonly` and
`inaccessiblememorargmemonly` attributes from the state such that the
call site can represent memory locations with regards to the caller.  We
will only iterate over callee accesses to arguments and globals now and
we will use the call as the instruction that performs the access.  If
accesses have argument pointers we translate them to improve the result,
though that was happening in a weird way before as well.  Pointers to
globals are kept as well, if they were present. All other access kinds
are simply attributed to the call without any particular pointer
attachment.

Since we now track attributes wrt. the caller not callee we cannot
manifest the result easily. This can be revisited later.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86127

Files:
  llvm/lib/Transforms/IPO/AttributorAttributes.cpp
  llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
  llvm/test/Transforms/Attributor/align.ll
  llvm/test/Transforms/Attributor/depgraph.ll
  llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86127.286199.patch
Type: text/x-patch
Size: 17721 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200818/04c126bb/attachment.bin>


More information about the llvm-commits mailing list