
XCore does not appear to have any support for atomicrmw or cmpxchg. This will result in all atomic operations getting expanded to __atomic_* libcalls via AtomicExpandPass, which matches what Clang already does in the frontend. Additionally, remove the code which handles atomic load/store, as it will no longer be used.
44 lines
881 B
LLVM
44 lines
881 B
LLVM
; RUN: llc < %s -march=xcore | FileCheck %s
|
|
|
|
; CHECK-LABEL: atomic_fence
|
|
; CHECK: #MEMBARRIER
|
|
; CHECK: #MEMBARRIER
|
|
; CHECK: #MEMBARRIER
|
|
; CHECK: #MEMBARRIER
|
|
; CHECK: retsp 0
|
|
define void @atomic_fence() nounwind {
|
|
entry:
|
|
fence acquire
|
|
fence release
|
|
fence acq_rel
|
|
fence seq_cst
|
|
ret void
|
|
}
|
|
|
|
@pool = external global i64
|
|
|
|
define void @atomicloadstore() nounwind {
|
|
entry:
|
|
; CHECK-LABEL: atomicloadstore
|
|
|
|
; CHECK: __atomic_load_4
|
|
%0 = load atomic i32, ptr @pool seq_cst, align 4
|
|
|
|
; CHECK: __atomic_load_2
|
|
%1 = load atomic i16, ptr @pool seq_cst, align 2
|
|
|
|
; CHECK: __atomic_load_1
|
|
%2 = load atomic i8, ptr @pool seq_cst, align 1
|
|
|
|
; CHECK: __atomic_store_4
|
|
store atomic i32 %0, ptr @pool seq_cst, align 4
|
|
|
|
; CHECK: __atomic_store_2
|
|
store atomic i16 %1, ptr @pool seq_cst, align 2
|
|
|
|
; CHECK: __atomic_store_1
|
|
store atomic i8 %2, ptr @pool seq_cst, align 1
|
|
|
|
ret void
|
|
}
|