[CaptureTracking] Support atomicrmw and cmpxchg
authorPhilip Reames <listmail@philipreames.com>
Thu, 18 Feb 2016 19:23:27 +0000 (19:23 +0000)
committerPhilip Reames <listmail@philipreames.com>
Thu, 18 Feb 2016 19:23:27 +0000 (19:23 +0000)
commitbd09e86f82ae520b804f50068ab129f3f0b72ab8
tree98ee90733afba398793928839e7731b590b594ef
parent069a1073ddbd9fd605a98189edd682e3cc083fad
[CaptureTracking] Support atomicrmw and cmpxchg

These atomic operations are conceptually both a load and store from the same location. As such, we can treat them as the most conservative of those two components which in practice, means we can treat them like stores. An cmpxchg or atomicrmw captures the values, but not the locations accessed.

Note: We can probably be more aggressive about the comparison value in an cmpxhg since to have it be in memory, it must already be captured, but I figured it was better to avoid that for the moment.

Note 2: It turns out that since we don't actually support cmpxchg of pointer type, writing a negative test is impossible.

Differential Revision: http://reviews.llvm.org/D17400

llvm-svn: 261245
llvm/lib/Analysis/CaptureTracking.cpp
llvm/test/Transforms/FunctionAttrs/nocapture.ll