This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] AANoCapture: Regard a comparison to null as nocapture
AbandonedPublic

Authored by uenoku on Mar 10 2020, 8:12 AM.

Details

Summary

This patch treats a pointer comparison to constant null as no capture instruction when null pointer is not defined in AANoCapture.

Diff Detail

Event Timeline

uenoku created this revision.Mar 10 2020, 8:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2020, 8:12 AM

I have missed to check the dereferenceability of the pointer. I'll fix it later.
So now the tests are broken.

jdoerfert added inline comments.Mar 10 2020, 9:29 AM
llvm/lib/Transforms/IPO/Attributor.cpp
4361

I think we have enough use cases of this hideous construct by now that we can make a helper function.

uenoku abandoned this revision.Mar 11 2020, 1:08 AM
uenoku marked 2 inline comments as done.

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.

llvm/lib/Transforms/IPO/Attributor.cpp
4361

I'll add some helper function for this.

llvm/test/Transforms/Attributor/nocapture-2.ll
14–42

Based on the discussion in D60047, %p can't have nocapture in both functions.