r212173 - X86: inline all atomic operations up to 128-bits.

Ed Schouten ed at 80386.nl
Sat Jan 10 06:01:34 PST 2015


Hi Tim,

2014-07-02 12:25 GMT+02:00 Tim Northover <tnorthover at apple.com>:
> The backend *can* cope with all of these now, so Clang should give it the
> chance. On CPUs without cmpxchg16b (e.g. the original athlon64) LLVM can reform
> the libcalls.

Sorry for the late response. This commit was already ages ago, but I
only noticed the fallout a short time ago.

I've noticed that this causes Clang to emit calls to __sync_*16()
functions. This is a unusual, as the intent is that Clang never emits
__sync_*() calls for C11 atomics. It always generates __atomic_*
calls.

In other words, this code will need to be patched in such a way that
it only sets MaxAtomicPromoteWidth and MaxAtomicInlineWidth to 128 in
case the backend is going to generate code that uses cmpxchg16b.

In general I think it's a bit weird that all of the C11 __atomic_*
bits are implemented in Clang itself and are expected to shadow the
__sync_* calls generated by LLVM.

-- 
Ed Schouten <ed at 80386.nl>



More information about the cfe-commits mailing list