1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc %s -O2 -mtriple=i686-unknown-linux-gnu -o - | FileCheck %s
4 @f = global i8* zeroinitializer
6 ; PR39391 - The load of %v1 should be scheduled before the zeroing of the A-D registers.
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: pushl %ebp
12 ; CHECK-NEXT: .cfi_def_cfa_offset 8
13 ; CHECK-NEXT: .cfi_offset %ebp, -8
14 ; CHECK-NEXT: movl %esp, %ebp
15 ; CHECK-NEXT: .cfi_def_cfa_register %ebp
16 ; CHECK-NEXT: pushl %ebx
17 ; CHECK-NEXT: pushl %esi
18 ; CHECK-NEXT: subl $16, %esp
19 ; CHECK-NEXT: .cfi_offset %esi, -16
20 ; CHECK-NEXT: .cfi_offset %ebx, -12
21 ; CHECK-NEXT: movl f, %esi
22 ; CHECK-NEXT: movb (%esi), %al
23 ; CHECK-NEXT: movb %al, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Spill
24 ; CHECK-NEXT: xorl %eax, %eax
25 ; CHECK-NEXT: xorl %edx, %edx
26 ; CHECK-NEXT: xorl %ecx, %ecx
27 ; CHECK-NEXT: xorl %ebx, %ebx
28 ; CHECK-NEXT: lock cmpxchg8b (%esi)
29 ; CHECK-NEXT: cmpb $0, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Folded Reload
30 ; CHECK-NEXT: jne .LBB0_1
31 ; CHECK-NEXT: # %bb.2: # %k.end
32 ; CHECK-NEXT: .LBB0_1: # %.
35 %p = load i8*, i8** @f
36 %v1 = load atomic i8, i8* %p monotonic, align 1
37 %d.h.h.h.h.h = bitcast i8* %p to i64*
38 %v2 = load atomic i64, i64* %d.h.h.h.h.h monotonic, align 8
39 %j.h = icmp eq i8 %v1, 0
40 br i1 %j.h, label %k.end, label %.
46 k.end: ; preds = %entry
52 attributes #0 = { "no-frame-pointer-elim-non-leaf" }