1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=X64
5 @s_0 = external dso_local local_unnamed_addr global i16, align 2
6 @s_2 = external dso_local local_unnamed_addr global i16, align 2
8 define void @func_6(i8 %uc_8, i64 %uli_10) nounwind {
10 ; X86: # %bb.0: # %entry
11 ; X86-NEXT: pushl %ebx
12 ; X86-NEXT: pushl %esi
13 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
14 ; X86-NEXT: movl $-1, %ecx
15 ; X86-NEXT: xorl %edx, %edx
16 ; X86-NEXT: xorl %ebx, %ebx
17 ; X86-NEXT: # implicit-def: $si
18 ; X86-NEXT: .p2align 4, 0x90
19 ; X86-NEXT: .LBB0_1: # %for.body612
20 ; X86-NEXT: # =>This Inner Loop Header: Depth=1
21 ; X86-NEXT: testb %dl, %dl
22 ; X86-NEXT: je .LBB0_2
23 ; X86-NEXT: # %bb.3: # %if.end1401
24 ; X86-NEXT: # in Loop: Header=BB0_1 Depth=1
25 ; X86-NEXT: addl %eax, %esi
26 ; X86-NEXT: movw %si, s_2
27 ; X86-NEXT: movw %bx, s_0
30 ; X86-NEXT: cmpw $73, %cx
31 ; X86-NEXT: jl .LBB0_1
32 ; X86-NEXT: # %bb.4: # %for.body1703
33 ; X86-NEXT: .LBB0_2: # %if.then671
36 ; X64: # %bb.0: # %entry
37 ; X64-NEXT: movl $23090, %eax # imm = 0x5A32
38 ; X64-NEXT: xorl %ecx, %ecx
39 ; X64-NEXT: # implicit-def: $dx
40 ; X64-NEXT: .p2align 4, 0x90
41 ; X64-NEXT: .LBB0_1: # %for.body612
42 ; X64-NEXT: # =>This Inner Loop Header: Depth=1
43 ; X64-NEXT: testb %cl, %cl
44 ; X64-NEXT: je .LBB0_2
45 ; X64-NEXT: # %bb.3: # %if.end1401
46 ; X64-NEXT: # in Loop: Header=BB0_1 Depth=1
47 ; X64-NEXT: addl %esi, %edx
48 ; X64-NEXT: movw %dx, s_2(%rip)
49 ; X64-NEXT: leal -23090(%rax), %edi
50 ; X64-NEXT: movw %di, s_0(%rip)
52 ; X64-NEXT: leal -23091(%rax), %edi
53 ; X64-NEXT: cmpw $73, %di
54 ; X64-NEXT: jl .LBB0_1
55 ; X64-NEXT: # %bb.4: # %for.body1703
56 ; X64-NEXT: .LBB0_2: # %if.then671
58 %conv649 = zext i8 %uc_8 to i64
59 %xor650 = xor i64 %conv649, 296357731680175678
60 %i = trunc i64 %uli_10 to i16
63 for.body612: ; preds = %for.inc1677, %entry
64 %i1 = phi i16 [ undef, %entry ], [ %conv1532, %for.inc1677 ]
65 %i2 = phi i16 [ -1, %entry ], [ %add1679, %for.inc1677 ]
68 if.then635: ; preds = %for.body612
69 %conv653 = sext i16 %i2 to i64
70 %cmp654.not = icmp eq i64 %xor650, %conv653
71 %conv653.op = xor i64 %conv653, 296357731680175678
72 %tobool670.not = icmp eq i64 undef, 0
73 br i1 %tobool670.not, label %if.end1401, label %if.then671
75 if.then671: ; preds = %if.then635
76 %cmp830 = icmp sgt i16 %i1, 21
79 if.end1401: ; preds = %if.then635
80 %conv1421 = sext i16 %i2 to i32
81 %or1422 = or i32 %conv1421, undef
84 if.end1510: ; preds = %if.end1401
85 br i1 undef, label %cond.false1514, label %cond.end1528
87 cond.false1514: ; preds = %if.end1510
88 %conv1525 = sext i16 %i2 to i64
89 %add1526 = add nsw i64 %conv1525, 23091
90 br label %cond.end1528
92 cond.end1528: ; preds = %cond.false1514, %if.end1510
93 %cond1529 = phi i64 [ %add1526, %cond.false1514 ], [ undef, %if.end1510 ]
94 %conv1532 = add i16 %i1, %i
95 store i16 %conv1532, ptr @s_2, align 2
98 for.inc1677: ; preds = %cond.end1528
99 %add1679 = add i16 %i2, 1
100 store i16 %add1679, ptr @s_0, align 2
101 %cmp610 = icmp slt i16 %add1679, 73
102 br i1 %cmp610, label %for.body612, label %for.body1703
104 for.body1703: ; preds = %for.inc1677