[cfe-dev] [libcxx] optimizing shared_ptr atomics in destructors

David Chisnall via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 19 01:52:39 PDT 2016

On 18 Jul 2016, at 19:09, Craig, Ben via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>         ldr     r1, [r0]  @bcraig note: it would be nice to combine this load with the ldrex

I believe that you will see this transformation if you do a non-atomic increment on the loaded value and then a weak compare and swap to write the result back (with a back branch to retry if it failed).  I’m not 100% sure though, because this will leave a ldrex that isn’t paired with a store / release in the case that the loaded value is 0 and some ARM cores don’t like it when that happens.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160719/3a096973/attachment.bin>

More information about the cfe-dev mailing list