Page MenuHomePhabricator

Update CaptureTracker so psub does not capture operands if possible
AbandonedPublic

Authored by aqjune on Jan 11 2019, 8:02 AM.

Details

Summary

This is a patch that shows how llvm.psub intrinsic function (https://reviews.llvm.org/D56598) can make CaptureTracker smarter.

If two pointers p1 and p2 (which are given to llvm.psub call) are both from logical pointers, meaning that neither of them are based on inttoptr cast, CaptureTracker can assume that the call captures neither of its operands.

Diff Detail

Event Timeline

aqjune created this revision.Jan 11 2019, 8:02 AM

I may not be the best to approve this change. Here are some high-level comments though.

include/llvm/Analysis/CaptureTracking.h
64

This is a fairly extensive API change.
If TLI was set to default to nullptr here, will you still need to change all callsites to achieve your goal for psub intrinsics?

lib/Analysis/ValueTracking.cpp
1868

If the only current call to isGuaranteedToBeLogicalPointer sets LI to nullptr, I would remove it from the signature, and pass nullptr to GetUnderlyingObjects.

aqjune abandoned this revision.Jan 23 2019, 10:18 AM

Abandon this patch; will a new patch be uploaded later