Page MenuHomePhabricator

llvm.noalias - CaptureTracking needs to look through them
AcceptedPublic

Authored by hfinkel on Apr 30 2015, 8:41 AM.

Details

Summary

This is part of the series started by D9375, and teaches CaptureTracking to look through calls to llvm.noalias.

P.S. One reason why llvm.noalias is not itself marked with nocapture is because it requires this special handling anyway.

Diff Detail

Event Timeline

hfinkel updated this revision to Diff 24720.Apr 30 2015, 8:41 AM
hfinkel retitled this revision from to llvm.noalias - CaptureTracking needs to look through them.
hfinkel updated this object.
hfinkel edited the test plan for this revision. (Show Details)
hfinkel added reviewers: chandlerc, reames.
hfinkel added a subscriber: Unknown Object (MLST).
reames edited edge metadata.May 12 2015, 3:49 PM

LGTM w.r.t. code.

I would prefer the intrinsic definition be marked nocapture if it's legal to do so. There's too much chance of someone checking only an attribute somewhere. Better to be complete as we can.

Also, I don't believe the parameter on stripPointerCasts is still needed per discussion in another thread right?

reames accepted this revision.May 12 2015, 3:49 PM
reames edited edge metadata.
This revision is now accepted and ready to land.May 12 2015, 3:49 PM
hfinkel updated this revision to Diff 63341.Jul 8 2016, 3:52 PM
hfinkel edited edge metadata.

Rebased.

majnemer accepted this revision.Jul 10 2016, 12:44 AM
majnemer added a reviewer: majnemer.
majnemer added a subscriber: majnemer.

LGTM

lib/Analysis/CaptureTracking.cpp
259

auto *II

hfinkel updated this revision to Diff 73359.Oct 3 2016, 3:33 PM
hfinkel edited edge metadata.

Rebased (and addressed reviewer feedback)

Maybe 'passthrough' should return a boolean, indicating that we need to stop or not. (see code comment)
The places where it is called could become something like: 'if (passthrough()) return;

lib/Analysis/CaptureTracking.cpp
244

Moving this piece of code with a 'return' into a lambda results in a behavior change: instead of directly breaking the outer while loop when the Threshold is reached, it will now keep doing work with whatever is on the worklist. I don't think this change in behavior was intended.

hfinkel added inline comments.Dec 4 2016, 6:35 PM
lib/Analysis/CaptureTracking.cpp
244

You're right, thanks!

troyj added a subscriber: troyj.Aug 22 2018, 9:30 AM