Some of the cmake checks are obsolete and make bootstrapping an LLVM build painful: we only need to check for libatomic which we can do in pure C, no need for C++ <atomic>. That leads us to Atomic.h which we can get rid of.
This looks like a good simplification, but I think call_once could be simplified more.
Does anything else set LLVM_HAS_ATOMICS?
Not sure we still need the tsan hooks when using std::atomic.
Do we actually need thread fences here?