1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=i386-apple-macosx10.13.0 -o - %s | FileCheck %s
4 target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
6 @c = external local_unnamed_addr global i32, align 4
7 @b = external local_unnamed_addr global [1 x i32], align 4
8 @d = external local_unnamed_addr global i32, align 4
10 define void @pr32610(i32 %a0, i32 %a1) #0 {
11 ; CHECK-LABEL: pr32610:
12 ; CHECK: ## %bb.0: ## %entry
13 ; CHECK-NEXT: pushl %ebp
14 ; CHECK-NEXT: movl %esp, %ebp
15 ; CHECK-NEXT: pushl %esi
16 ; CHECK-NEXT: movl 8(%ebp), %edx
17 ; CHECK-NEXT: movl L_b$non_lazy_ptr, %eax
18 ; CHECK-NEXT: movl (%eax), %eax
19 ; CHECK-NEXT: xorl %ecx, %ecx
20 ; CHECK-NEXT: cmpl %eax, %edx
21 ; CHECK-NEXT: sete %cl
22 ; CHECK-NEXT: xorl %esi, %esi
23 ; CHECK-NEXT: incl %esi
24 ; CHECK-NEXT: cmpl $0, 12(%ebp)
25 ; CHECK-NEXT: cmovel %esi, %ecx
26 ; CHECK-NEXT: cmpl %eax, %edx
27 ; CHECK-NEXT: cmovnel %esi, %ecx
28 ; CHECK-NEXT: movl L_c$non_lazy_ptr, %edx
29 ; CHECK-NEXT: movl %ecx, (%edx)
30 ; CHECK-NEXT: testl %eax, %eax
31 ; CHECK-NEXT: movl $2, %ecx
32 ; CHECK-NEXT: cmovnel %eax, %ecx
33 ; CHECK-NEXT: movl L_d$non_lazy_ptr, %eax
34 ; CHECK-NEXT: movl %ecx, (%eax)
35 ; CHECK-NEXT: popl %esi
36 ; CHECK-NEXT: popl %ebp
39 %0 = load i32, ptr getelementptr ([1 x i32], ptr @b, i32 0, i32 undef), align 4, !tbaa !1
40 %cmp = icmp eq i32 %a0, %0
41 %conv = zext i1 %cmp to i32
42 %tobool1.i = icmp ne i32 %a1, 0
43 %or.cond.i = and i1 %cmp, %tobool1.i
44 %cond.i = select i1 %or.cond.i, i32 %conv, i32 1
45 store i32 %cond.i, ptr @c, align 4, !tbaa !1
46 %1 = load i32, ptr @b, align 4
47 %tobool = icmp ne i32 %1, 0
48 %2 = select i1 %tobool, i32 %1, i32 2
49 store i32 %2, ptr @d, align 4, !tbaa !1
53 attributes #0 = { norecurse nounwind optsize ssp "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+fxsr,+mmx,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
57 !0 = !{!"clang version 5.0.0 (trunk 301507) (llvm/trunk 301505)"}
59 !2 = !{!"int", !3, i64 0}
60 !3 = !{!"omnipotent char", !4, i64 0}
61 !4 = !{!"Simple C/C++ TBAA"}