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.
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?