clang and atomic instructions

Hello,

Is there any documentation (besides code) describing when clang emits atomic instructions such as cmpxchg or atomicrmw? In particular, a benchmark with c examples where clang emits such instructions would be very valuable.

Kind regards,
Marcelo