[PATCH] D75924: [Attributor] AANoCapture: Regard a comparison to null as nocapture
Hideto Ueno via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 11 01:36:00 PDT 2020
uenoku abandoned this revision.
uenoku marked 2 inline comments as done.
uenoku added a comment.
I have misunderstood how CaptureTracker works. AANoCapture already has this functionality :) So I'd close it.
But I have thought some of FIXME in the test seems wrong.
================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:4361
+ F, U->get()->getType()->getPointerAddressSpace())
+ : true;
+ if (!NullPointerIsDefined &&
----------------
jdoerfert wrote:
> I think we have enough use cases of this hideous construct by now that we can make a helper function.
I'll add some helper function for this.
================
Comment at: llvm/test/Transforms/Attributor/nocapture-2.ll:14-42
-; FIXME: no-capture missing for %p
-; CHECK: define i32 @is_null_return(i32* nofree readnone %p)
+; CHECK: define i32 @is_null_return(i32* nocapture nofree readnone %p)
define i32 @is_null_return(i32* %p) #0 {
entry:
%cmp = icmp eq i32* %p, null
%conv = zext i1 %cmp to i32
ret i32 %conv
----------------
Based on the discussion in D60047, `%p` can't have `nocapture` in both functions.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75924/new/
https://reviews.llvm.org/D75924
More information about the llvm-commits
mailing list