2012-09-20 03:34:04 +00:00
|
|
|
; RUN: llc < %s -mtriple=i386-apple-darwin -mcpu=corei7 | FileCheck %s
|
2010-01-08 23:41:50 +00:00
|
|
|
; 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: t:
|
2012-09-20 03:06:15 +00:00
|
|
|
; CHECK: movl ([[REG:%[a-z]+]]), %eax
|
|
|
|
; CHECK: movl 4([[REG]]), %edx
|
2010-04-17 16:29:15 +00:00
|
|
|
; CHECK: LBB0_1:
|
2012-11-12 06:49:17 +00:00
|
|
|
; CHECK: movl %eax, %ebx
|
|
|
|
; CHECK: addl {{%[a-z]+}}, %ebx
|
|
|
|
; CHECK: movl %edx, %ecx
|
|
|
|
; CHECK: adcl {{%[a-z]+}}, %ecx
|
2010-01-08 23:41:50 +00:00
|
|
|
; CHECK: lock
|
2012-09-20 03:06:15 +00:00
|
|
|
; CHECK-NEXT: cmpxchg8b ([[REG]])
|
|
|
|
; CHECK-NEXT: jne
|
2011-09-26 23:15:09 +00:00
|
|
|
%0 = atomicrmw add i64* %p, i64 1 seq_cst
|
2010-01-08 23:41:50 +00:00
|
|
|
ret void
|
|
|
|
}
|