64bit atomic ops on 32bit platforms

Hi all,
there was a commit a while ago that effectively forces all LLVM projects
to use libatomics on 32bit platforms. It is completely necessary for
clang and LLVM, of limited usefulness for libc++ (<atomics> test cases)
and necessary for LLDB right now. The only instance in LLDB is
include/Utility/Timer.h for nanosecond-precise time accounting. While
the code is correct, it will be secretly using a mutex in the
implementation and therefore not be wait-free. This feels like somewhat
of a bad idea for an accounting tool, so I would like to:

(a) Make the mutex explicit if 64bit operations are not lock-free.


(b) Weaken the consistency constraints to provide eventually-consistent
times by splitting the field into explicit 32bit chunks. This makes the
write side get predictable timings at the expensive of the summaries
being potentially off a bit in the case of races.


Ping? Given that this is a pretty annoying regression, I would like to
address this for 5.0, but that means knowing how much effort I need to
invest in different LLVM projects...


A bit late to the party, but I think (b) sounds fine. I take it the
timings will be off only when the operation overflows the lower 32 bit
value, and the summary is printed before the higher 32 bits are

An option (c) I can offer is to switch to microsecond timers on 32-bit
platforms, and accept the fact that the timers will wrap around after
an hour or so.