1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -fast-isel -mtriple=i686-unknown-unknown -O0 -mcpu=skx | FileCheck %s
4 @c = external dso_local global i8, align 1
6 ; Function Attrs: noinline nounwind
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: subl $2, %esp
11 ; CHECK-NEXT: .cfi_def_cfa_offset 6
12 ; CHECK-NEXT: movb c, %cl
13 ; CHECK-NEXT: xorb $-1, %cl
14 ; CHECK-NEXT: xorl %eax, %eax
15 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
16 ; CHECK-NEXT: testb $1, %cl
17 ; CHECK-NEXT: movb %al, (%esp) # 1-byte Spill
18 ; CHECK-NEXT: jne .LBB0_1
19 ; CHECK-NEXT: jmp .LBB0_2
20 ; CHECK-NEXT: .LBB0_1: # %land.rhs
21 ; CHECK-NEXT: xorl %eax, %eax
22 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
23 ; CHECK-NEXT: movb %al, (%esp) # 1-byte Spill
24 ; CHECK-NEXT: jmp .LBB0_2
25 ; CHECK-NEXT: .LBB0_2: # %land.end
26 ; CHECK-NEXT: movb (%esp), %al # 1-byte Reload
27 ; CHECK-NEXT: andb $1, %al
28 ; CHECK-NEXT: movb %al, {{[0-9]+}}(%esp)
29 ; CHECK-NEXT: addl $2, %esp
30 ; CHECK-NEXT: .cfi_def_cfa_offset 4
33 %b = alloca i8, align 1
34 %0 = load i8, ptr @c, align 1
35 %tobool = trunc i8 %0 to i1
36 %lnot = xor i1 %tobool, true
37 br i1 %lnot, label %land.rhs, label %land.end
39 land.rhs: ; preds = %entry
42 land.end: ; preds = %land.rhs, %entry
43 %1 = phi i1 [ false, %entry ], [ false, %land.rhs ]
44 %conv = zext i1 %1 to i8
45 store i8 %conv, ptr %b, align 1