]> granicus.if.org Git - llvm/commit
[Attributor][Fix] Manifest nocapture only in CSArgument or Argument
authorHideto Ueno <uenoku.tokotoko@gmail.com>
Wed, 11 Sep 2019 06:52:11 +0000 (06:52 +0000)
committerHideto Ueno <uenoku.tokotoko@gmail.com>
Wed, 11 Sep 2019 06:52:11 +0000 (06:52 +0000)
commit58dc7cdf01f4bdbad3ad08a1443c362b8b24ed58
tree4ed7c3741794383b05c6a5e1725f566ad08e323c
parent6a1542545bc2f38c0045589c0d072759e89b1c17
[Attributor][Fix] Manifest nocapture only in CSArgument or Argument

Summary:
We can query to Attributor whether the value is captured in the scope or not on the following way:

```
    const auto & NoCapAA = A.getAAFor<AANoCapture>(*this, IRPosition::value(V));
```
And if V is CallSiteReturned then `getDeducedAttribute` will add `nocatpure` to the callsite returned value. It is not valid.
This patch checks the position is an argument or call site argument.

This is tested in D67286.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67342

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371589 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/Attributor.cpp