freebsd-dev/contrib/llvm-project
Justin Hibbits 7b6b882fe4 [PowerPC] enable atomic.c in compiler_rt and do not check and forces
lock/lock_free decisions in compiled time

Summary:
Enables atomic.c in compiler_rt and forces clang to not emit a call for runtime
decision about lock/lock_free.  At compiling time, if clang can't decide if
atomic operation can be lock free, it emits calls to external functions  like
`__atomic_is_lock_free`, `__c11_atomic_is_lock_free` and
`__atomic_always_lock_free`, postponing decision to a runtime check.  According
to LLVM code documentation, the mechanism exists due to differences between
x86_64 processors that can't be decided at runtime.

On PowerPC and PowerPCSPE (32 bits), we already know in advance it can't be lock
free, so we force the decision at compile time and avoid having to implement it
in an external library.

This patch was made after 32 bit users testing the PowePC32 bit ISO reported
llvm could not be compiled with in-base llvm due to `__atomic_load8` not
implemented.

Submitted by:	alfredo.junior_eldorado.org.br
Reviewed by:	jhibbits, dim

Differential Revision:	https://reviews.freebsd.org/D22549
2019-12-26 23:06:28 +00:00
..
clang [PowerPC] enable atomic.c in compiler_rt and do not check and forces 2019-12-26 23:06:28 +00:00
compiler-rt [PowerPC] enable atomic.c in compiler_rt and do not check and forces 2019-12-26 23:06:28 +00:00
libcxx Merge commit f97936fab from llvm git (by Eric Fiselier): 2019-12-22 11:58:44 +00:00
libunwind Consolidate FREEBSD-Xlist files of different llvm sub-projects into one. 2019-12-20 21:42:10 +00:00
lld Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 2019-12-22 11:50:44 +00:00
lldb Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp 2019-12-22 11:50:44 +00:00
llvm Merge commit d3aeac8e2 from llvm git (by Justin Hibbits) 2019-12-26 21:20:45 +00:00
openmp Consolidate FREEBSD-Xlist files of different llvm sub-projects into one. 2019-12-20 21:42:10 +00:00
FREEBSD-Xlist Consolidate FREEBSD-Xlist files of different llvm sub-projects into one. 2019-12-20 21:42:10 +00:00