aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-07-27 11:29:54 +0200
committerNikita Popov <npopov@redhat.com>2022-08-09 16:04:46 +0200
commitf5ed0cb217a9988f97b55f2ccb053bca7b41cc0c (patch)
tree143c19e17e1d2d9e89b9bff1a2f02be9a513ad93 /lldb/source/Plugins/ScriptInterpreter/Python
parent6da3f90195e32d9fd36a5794b6b397360fc0e1e4 (diff)
downloadllvm-f5ed0cb217a9988f97b55f2ccb053bca7b41cc0c.zip
llvm-f5ed0cb217a9988f97b55f2ccb053bca7b41cc0c.tar.gz
llvm-f5ed0cb217a9988f97b55f2ccb053bca7b41cc0c.tar.bz2
[RISCV] Add target feature to force-enable atomics
This adds a +forced-atomics target feature with the same semantics as +atomics-32 on ARM (D130480). For RISCV targets without the +a extension, this forces LLVM to assume that lock-free atomics (up to 32/64 bits for riscv32/64 respectively) are available. This means that atomic load/store are lowered to a simple load/store (and fence as necessary), as these are guaranteed to be atomic (as long as they're aligned). Atomic RMW/CAS are lowered to __sync (rather than __atomic) libcalls. Responsibility for providing the __sync libcalls lies with the user (for privileged single-core code they can be implemented by disabling interrupts). Code using +forced-atomics and -forced-atomics are not ABI compatible if atomic variables cross the ABI boundary. For context, the difference between __sync and __atomic is that the former are required to be lock-free, while the latter requires a shared global lock provided by a shared object library. See https://llvm.org/docs/Atomics.html#libcalls-atomic for a detailed discussion on the topic. This target feature will be used by Rust's riscv32i target family to support the use of atomic load/store without atomic RMW/CAS. Differential Revision: https://reviews.llvm.org/D130621
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
0 files changed, 0 insertions, 0 deletions