Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -mtriple=i386-apple-darwin -mcpu=corei7 | FileCheck %s
      2 ; rdar://r7512579
      3 
      4 ; PHI defs in the atomic loop should be used by the add / adc
      5 ; instructions. They should not be dead.
      6 
      7 define void @t(i64* nocapture %p) nounwind ssp {
      8 entry:
      9 ; CHECK-LABEL: t:
     10 ; CHECK: movl ([[REG:%[a-z]+]]), %eax
     11 ; CHECK: movl 4([[REG]]), %edx
     12 ; CHECK: LBB0_1:
     13 ; CHECK: movl %eax, %ebx
     14 ; CHECK: addl $1, %ebx
     15 ; CHECK: movl %edx, %ecx
     16 ; CHECK: adcl $0, %ecx
     17 ; CHECK: lock cmpxchg8b ([[REG]])
     18 ; CHECK-NEXT: jne
     19   %0 = atomicrmw add i64* %p, i64 1 seq_cst
     20   ret void
     21 }
     22