[PATCH] ARM: allow inline atomics on Cortex M

Phoebe Buckheister llvm at quasiparticle.net
Mon Jun 16 15:20:29 PDT 2014


On Mon, 16 Jun 2014 15:36:00 -0600, Jonathan Roelofs wrote:
> > Thanks, I'll put it back. I had assumed that in those cases, clang
> > would just always generate inline atomics and let LLVM fix it up if
> > the actual hardware doesn't support it.
> I agree with your first suspicions though... this chunk of code isn't
> in exactly the right spot, and so isn't checking the right thing.

I'm totally confused about this now. Always enabling atomics on Windows
seems fine, if that'll only run on hardware that has atomic
instructions anyway. But if we forced atomics off for anything that
wasn't Linux, a BSD or Bitrig anyway, and then required the Arch
version to match - really, why check for the OS at all? If we're not
going to emit anything that would call into the OS ourselves, the check
seems unnecessarily restrictive. If we hard-enable inline atomics for
Linux and the others, we'll not emit libcalls for atomics on those at
all.

I really have no idea to fix this now. Could you clear up my
confusion?

> Jon



More information about the cfe-commits mailing list