]> granicus.if.org Git - clang/commit
Add support for optimized (non-generic) atomic libcalls.
authorEd Schouten <ed@80386.nl>
Fri, 31 May 2013 19:27:59 +0000 (19:27 +0000)
committerEd Schouten <ed@80386.nl>
Fri, 31 May 2013 19:27:59 +0000 (19:27 +0000)
commite469249726840b8baa2df008ca891e213cc5c661
treefabbe5bcfcb76245294add3d030e534620723a42
parentab79f4120d479600c25a7cf82997385dccfb48f7
Add support for optimized (non-generic) atomic libcalls.

For integer types of sizes 1, 2, 4 and 8, libcompiler-rt (and libgcc)
provide atomic functions that pass parameters by value and return
results directly.

libgcc and libcompiler-rt only provide optimized libcalls for
__atomic_fetch_*, as generic libcalls on non-integer types would make
little sense. This means that we can finally make __atomic_fetch_* work
on architectures for which we don't provide these operations as builtins
(e.g. ARM).

This should fix the dreaded "cannot compile this atomic library call
yet" error that would pop up once every while.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183033 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGAtomic.cpp
test/CodeGen/atomics-inlining.c