This is an archive of the discontinued LLVM Phabricator instance.

Remove all of the legacy home-grown atomic operations LLVM provided except for CompareAndSwap. That is the only one still being used anywhere now that statistics have been moved onto std::atomic.
ClosedPublic

Authored by chandlerc on Jun 2 2016, 2:22 AM.

Details

Summary

Also, add a warning to the header that we shouldn't introduce more uses
of these old style atomics and instead should be using C++11's
std::atomic facilities.

Really hoping that we can hammer out the last couple of users here and
replace them with something more localized and/or principled, but
figured this was a pretty good start. =]

Note that this patch will need to be reverted if r271504 needs to be
reverted as that removes the last user of these. However, the biggest
risk for that patch was MSVC 2013 and at least one bot has already
passed where it would have failed there. I've tested MSVC 2015 using
their web interfaces and other platforms seem fine, so I'm optimistic.

Diff Detail

Repository
rL LLVM

Event Timeline

chandlerc updated this revision to Diff 59351.Jun 2 2016, 2:22 AM
chandlerc retitled this revision from to Remove all of the legacy home-grown atomic operations LLVM provided except for CompareAndSwap. That is the only one still being used anywhere now that statistics have been moved onto std::atomic..
chandlerc updated this object.
chandlerc added a subscriber: llvm-commits.
rnk accepted this revision.Jun 2 2016, 9:45 AM
rnk added a reviewer: rnk.
rnk added a subscriber: rnk.

lgtm, looks like r271504 stuck since last night.

This revision is now accepted and ready to land.Jun 2 2016, 9:45 AM
This revision was automatically updated to reflect the committed changes.
emaste added a subscriber: emaste.EditedJun 3 2016, 6:56 AM

As an aside it looks like there's some missing dependency data in the build; on FreeBSD my Clang build failed with lots of ../lib/CodeGen/TwoAddressInstructionPass.cpp:(.text+0x39ed): undefined reference to 'llvm::sys::AtomicIncrement(unsigned int volatile*)' but worked once I deleted TwoAddressInstructionPass.cpp.o and rebuilt.