[Attributor] Improve noalias preservation using reachability
authorPankaj Gode <pgode@codeaurora.org>
Fri, 13 Mar 2020 15:39:08 +0000 (21:09 +0530)
committerPankaj Gode <pgode@codeaurora.org>
Fri, 13 Mar 2020 15:39:08 +0000 (21:09 +0530)
commitbf990530ae0f8d7bae77a9c94f4e57fc7fa42b2e
treef5f42fa20827c5299b96dd5a35e06cfe9114df9d
parent846c614f54a55dff48025453cad2387816a8e10d
[Attributor] Improve noalias preservation using reachability

Resolution for below fixme:
(ii) Check whether the value is captured in the scope using AANoCapture.
FIXME: This is conservative though, it is better to look at CFG and
             check only uses possibly executed before this callsite.

Propagates caller argument's noalias attribute to callee.

Reviewed by: jdoerfert, uenoku

Reviewers: jdoerfert, sstefan1, uenoku

Subscribers: uenoku, sstefan1, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D71617
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/test/Transforms/Attributor/noalias.ll
llvm/test/Transforms/Attributor/nonnull.ll