summaryrefslogtreecommitdiff
path: root/gnu/llvm
diff options
context:
space:
mode:
authorgkoehler <gkoehler@cvs.openbsd.org>2020-06-04 22:33:18 +0000
committergkoehler <gkoehler@cvs.openbsd.org>2020-06-04 22:33:18 +0000
commit80cdfdd01fd174eb6187ccc915dbd6a4eefae532 (patch)
tree48ace7cce9fedc5b6dd42a0d8e5b489af77af639 /gnu/llvm
parentcf20b1bb625718ce3524340601834657df7df343 (diff)
Set max atomic size for PowerPC.
32-bit PowerPC doesn't have instructions for lock-free atomic ops on 8-byte values, and needs libcalls like __atomic_fetch_add_8(). In code like "_Atomic long long a; a++;", clang doesn't emit a libcall. This was causing linker errors on symbols like __sync_fetch_and_add_8. Now that LLVM knows the max atomic size, its AtomicExpandPass changes these 8-byte ops into libcalls. ok mortimer@
Diffstat (limited to 'gnu/llvm')
-rw-r--r--gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 60fa5e4afef..8fd8548b99d 100644
--- a/gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -1034,7 +1034,10 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
setOperationAction(ISD::READCYCLECOUNTER, MVT::i64, isPPC64 ? Legal : Custom);
- if (!isPPC64) {
+ if (isPPC64)
+ setMaxAtomicSizeInBitsSupported(64);
+ else {
+ setMaxAtomicSizeInBitsSupported(32);
setOperationAction(ISD::ATOMIC_LOAD, MVT::i64, Expand);
setOperationAction(ISD::ATOMIC_STORE, MVT::i64, Expand);
}