mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-10 01:10:48 +00:00
5c8b83eb7a
The logic for expanding atomics that aren't natively supported in terms of cmpxchg loops is much simpler to express at the IR level. It also allows the normal optimisations and CodeGen improvements to help out with atomics, instead of using a limited set of possible instructions.. rdar://problem/13496295 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212119 91177308-0d34-0410-b5e6-96231b3b80d8
23 lines
573 B
LLVM
23 lines
573 B
LLVM
; RUN: llc < %s -mtriple=i386-apple-darwin -mcpu=corei7 | FileCheck %s
|
|
; rdar://r7512579
|
|
|
|
; PHI defs in the atomic loop should be used by the add / adc
|
|
; instructions. They should not be dead.
|
|
|
|
define void @t(i64* nocapture %p) nounwind ssp {
|
|
entry:
|
|
; CHECK-LABEL: t:
|
|
; CHECK: movl ([[REG:%[a-z]+]]), %eax
|
|
; CHECK: movl 4([[REG]]), %edx
|
|
; CHECK: LBB0_1:
|
|
; CHECK: movl %eax, %ebx
|
|
; CHECK: addl $1, %ebx
|
|
; CHECK: movl %edx, %ecx
|
|
; CHECK: adcl $0, %ecx
|
|
; CHECK: lock
|
|
; CHECK-NEXT: cmpxchg8b ([[REG]])
|
|
; CHECK-NEXT: jne
|
|
%0 = atomicrmw add i64* %p, i64 1 seq_cst
|
|
ret void
|
|
}
|