[PowerPC] Recommit r314244 with refactoring and off by default
[llvm-core.git] / test / CodeGen / X86 / pr31045.ll
blob2cd594850481bd65d59e5f772370fdbad3d65957
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
4 %struct.c.2.6.10.14.38.70.74.90.94.98.106.122.362 = type { i8, %struct.b.1.5.9.13.37.69.73.89.93.97.105.121.361, i24, i24 }
5 %struct.b.1.5.9.13.37.69.73.89.93.97.105.121.361 = type { %struct.a.0.4.8.12.36.68.72.88.92.96.104.120.360, %struct.a.0.4.8.12.36.68.72.88.92.96.104.120.360, i8 }
6 %struct.a.0.4.8.12.36.68.72.88.92.96.104.120.360 = type <{ i8, i16 }>
7 %struct.d.3.7.11.15.39.71.75.91.95.99.107.123.363 = type <{ %struct.c.2.6.10.14.38.70.74.90.94.98.106.122.362, %struct.c.2.6.10.14.38.70.74.90.94.98.106.122.362, i8, i8 }>
9 @var_46 = external local_unnamed_addr global i8, align 1
10 @var_44 = external local_unnamed_addr global i8, align 1
11 @var_163 = external local_unnamed_addr global i8, align 1
12 @struct_obj_12 = external local_unnamed_addr global %struct.c.2.6.10.14.38.70.74.90.94.98.106.122.362, align 2
13 @struct_obj_3 = external local_unnamed_addr global %struct.d.3.7.11.15.39.71.75.91.95.99.107.123.363, align 2
14 @struct_obj_8 = external local_unnamed_addr global %struct.d.3.7.11.15.39.71.75.91.95.99.107.123.363, align 2
15 @var_49 = external local_unnamed_addr constant i8, align 1
17 ; Function Attrs: norecurse nounwind uwtable
18 define void @_Z1av() local_unnamed_addr #0 {
19 ; CHECK-LABEL: _Z1av:
20 ; CHECK:       # BB#0: # %entry
21 ; CHECK-NEXT:    movl struct_obj_3+{{.*}}(%rip), %eax
22 ; CHECK-NEXT:    movsbl {{.*}}(%rip), %ecx
23 ; CHECK-NEXT:    movzbl {{.*}}(%rip), %edx
24 ; CHECK-NEXT:    movzbl {{.*}}(%rip), %esi
25 ; CHECK-NEXT:    andl $1, %eax
26 ; CHECK-NEXT:    leal (%rax,%rax), %edi
27 ; CHECK-NEXT:    subl %ecx, %edi
28 ; CHECK-NEXT:    subl %edx, %edi
29 ; CHECK-NEXT:    movl %edi, %ecx
30 ; CHECK-NEXT:    notl %ecx
31 ; CHECK-NEXT:    movzbl %cl, %ecx
32 ; CHECK-NEXT:    movw %cx, struct_obj_12+{{.*}}(%rip)
33 ; CHECK-NEXT:    xorl %ecx, %ecx
34 ; CHECK-NEXT:    testb %al, %al
35 ; CHECK-NEXT:    cmovel %eax, %ecx
36 ; CHECK-NEXT:    andl struct_obj_8+{{.*}}(%rip), %ecx
37 ; CHECK-NEXT:    andl $1, %ecx
38 ; CHECK-NEXT:    negl %ecx
39 ; CHECK-NEXT:    andl %esi, %ecx
40 ; CHECK-NEXT:    negl %ecx
41 ; CHECK-NEXT:    andl %eax, %ecx
42 ; CHECK-NEXT:    negl %ecx
43 ; CHECK-NEXT:    testl %ecx, %edi
44 ; CHECK-NEXT:    setne {{.*}}(%rip)
45 ; CHECK-NEXT:    retq
46 entry:
47   %bf.load = load i32, i32* bitcast (i24* getelementptr inbounds (%struct.d.3.7.11.15.39.71.75.91.95.99.107.123.363, %struct.d.3.7.11.15.39.71.75.91.95.99.107.123.363* @struct_obj_3, i64 0, i32 0, i32 2) to i32*), align 2
48   %tmp = load i8, i8* @var_46, align 1
49   %conv1 = sext i8 %tmp to i32
50   %tmp1 = load i8, i8* @var_49, align 1
51   %tmp2 = zext i8 %tmp1 to i32
52   %tmp3 = shl i32 %bf.load, 1
53   %factor = and i32 %tmp3, 2
54   %sub = sub nsw i32 %factor, %conv1
55   %sub8 = sub nsw i32 %sub, %tmp2
56   %add = add nsw i32 %sub8, 0
57   %tmp4 = load i8, i8* @var_44, align 1
58   %tmp5 = zext i8 %tmp4 to i32
59   %xor = xor i32 %add, 255
60   %xor20 = xor i32 %xor, 0
61   %neg = xor i32 %xor20, 0
62   %or = or i32 0, %neg
63   %or55 = or i32 %or, 0
64   %conv56 = trunc i32 %or55 to i16
65   %bf.value = and i16 %conv56, 255
66   %bf.set = or i16 %bf.value, 0
67   store i16 %bf.set, i16* getelementptr inbounds (%struct.c.2.6.10.14.38.70.74.90.94.98.106.122.362, %struct.c.2.6.10.14.38.70.74.90.94.98.106.122.362* @struct_obj_12, i64 0, i32 1, i32 1, i32 1), align 1
68   %lnot = icmp eq i8 undef, 0
69   %bf.load65 = load i32, i32* bitcast (i24* getelementptr inbounds (%struct.d.3.7.11.15.39.71.75.91.95.99.107.123.363, %struct.d.3.7.11.15.39.71.75.91.95.99.107.123.363* @struct_obj_8, i64 0, i32 0, i32 2) to i32*), align 2
70   %tmp6 = and i32 %bf.load65, 1
71   %tmp7 = select i1 %lnot, i32 undef, i32 0
72   %mul69 = and i32 %tmp6, %tmp7
73   %tmp8 = sub nsw i32 0, %mul69
74   %mul75 = and i32 %tmp5, %tmp8
75   %tmp9 = and i32 %bf.load, 1
76   %tmp10 = sub nsw i32 0, %mul75
77   %mul80 = and i32 %tmp9, %tmp10
78   %factor109 = shl nuw nsw i32 %tmp9, 1
79   %sub86 = sub nsw i32 %factor109, %conv1
80   %sub94 = sub nsw i32 %sub86, %tmp2
81   %tmp11 = sub nsw i32 0, %mul80
82   %mul95 = and i32 %sub94, %tmp11
83   %tobool96 = icmp ne i32 %mul95, 0
84   %frombool = zext i1 %tobool96 to i8
85   store i8 %frombool, i8* @var_163, align 1
86   ret void
89 attributes #0 = { norecurse nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "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"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }