1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s -check-prefix=X64
3 ; RUN: llc < %s -mtriple=i686-apple-darwin | FileCheck %s -check-prefix=X32
7 ; In 32-bit the partial register stall would degrade performance.
9 define zeroext i16 @test1(i16 zeroext %c, i16 zeroext %k) nounwind ssp {
11 ; X64: ## %bb.0: ## %entry
12 ; X64-NEXT: movl %esi, %eax
14 ; X64-NEXT: cmpw %di, %si
15 ; X64-NEXT: jne LBB0_2
16 ; X64-NEXT: ## %bb.1: ## %bb
17 ; X64-NEXT: pushq %rbx
18 ; X64-NEXT: movzwl %ax, %ebx
19 ; X64-NEXT: movl %ebx, %edi
20 ; X64-NEXT: callq _foo
21 ; X64-NEXT: movl %ebx, %eax
24 ; X64-NEXT: LBB0_2: ## %bb1
25 ; X64-NEXT: movzwl %ax, %eax
29 ; X32: ## %bb.0: ## %entry
30 ; X32-NEXT: pushl %esi
31 ; X32-NEXT: subl $8, %esp
32 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
33 ; X32-NEXT: movl %ecx, %eax
35 ; X32-NEXT: cmpw {{[0-9]+}}(%esp), %cx
36 ; X32-NEXT: jne LBB0_2
37 ; X32-NEXT: ## %bb.1: ## %bb
38 ; X32-NEXT: movzwl %ax, %esi
39 ; X32-NEXT: movl %esi, (%esp)
40 ; X32-NEXT: calll _foo
41 ; X32-NEXT: movl %esi, %eax
42 ; X32-NEXT: jmp LBB0_3
43 ; X32-NEXT: LBB0_2: ## %bb1
44 ; X32-NEXT: movzwl %ax, %eax
45 ; X32-NEXT: LBB0_3: ## %bb1
46 ; X32-NEXT: addl $8, %esp
50 %0 = icmp eq i16 %k, %c
52 br i1 %0, label %bb, label %bb1
55 tail call void @foo(i16 zeroext %1) nounwind
62 define zeroext i16 @test2(i16 zeroext %c, i16 zeroext %k) nounwind ssp {
64 ; X64: ## %bb.0: ## %entry
65 ; X64-NEXT: movl %esi, %eax
67 ; X64-NEXT: cmpw %di, %si
68 ; X64-NEXT: jne LBB1_2
69 ; X64-NEXT: ## %bb.1: ## %bb
70 ; X64-NEXT: pushq %rbx
71 ; X64-NEXT: movzwl %ax, %ebx
72 ; X64-NEXT: movl %ebx, %edi
73 ; X64-NEXT: callq _foo
74 ; X64-NEXT: movl %ebx, %eax
77 ; X64-NEXT: LBB1_2: ## %bb1
78 ; X64-NEXT: movzwl %ax, %eax
82 ; X32: ## %bb.0: ## %entry
83 ; X32-NEXT: pushl %esi
84 ; X32-NEXT: subl $8, %esp
85 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
86 ; X32-NEXT: movl %ecx, %eax
88 ; X32-NEXT: cmpw {{[0-9]+}}(%esp), %cx
89 ; X32-NEXT: jne LBB1_2
90 ; X32-NEXT: ## %bb.1: ## %bb
91 ; X32-NEXT: movzwl %ax, %esi
92 ; X32-NEXT: movl %esi, (%esp)
93 ; X32-NEXT: calll _foo
94 ; X32-NEXT: movl %esi, %eax
95 ; X32-NEXT: jmp LBB1_3
96 ; X32-NEXT: LBB1_2: ## %bb1
97 ; X32-NEXT: movzwl %ax, %eax
98 ; X32-NEXT: LBB1_3: ## %bb1
99 ; X32-NEXT: addl $8, %esp
100 ; X32-NEXT: popl %esi
103 %0 = icmp eq i16 %k, %c
105 br i1 %0, label %bb, label %bb1
108 tail call void @foo(i16 zeroext %1) nounwind
115 declare void @foo(i16 zeroext)
117 define zeroext i16 @test3(i16 zeroext %c, i16 zeroext %k) nounwind ssp {
119 ; X64: ## %bb.0: ## %entry
120 ; X64-NEXT: movl %esi, %eax
121 ; X64-NEXT: addl $2, %eax
122 ; X64-NEXT: cmpw %di, %si
123 ; X64-NEXT: jne LBB2_2
124 ; X64-NEXT: ## %bb.1: ## %bb
125 ; X64-NEXT: pushq %rbx
126 ; X64-NEXT: movzwl %ax, %ebx
127 ; X64-NEXT: movl %ebx, %edi
128 ; X64-NEXT: callq _foo
129 ; X64-NEXT: movl %ebx, %eax
130 ; X64-NEXT: popq %rbx
132 ; X64-NEXT: LBB2_2: ## %bb1
133 ; X64-NEXT: movzwl %ax, %eax
137 ; X32: ## %bb.0: ## %entry
138 ; X32-NEXT: pushl %esi
139 ; X32-NEXT: subl $8, %esp
140 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
141 ; X32-NEXT: movl %ecx, %eax
142 ; X32-NEXT: addl $2, %eax
143 ; X32-NEXT: cmpw {{[0-9]+}}(%esp), %cx
144 ; X32-NEXT: jne LBB2_2
145 ; X32-NEXT: ## %bb.1: ## %bb
146 ; X32-NEXT: movzwl %ax, %esi
147 ; X32-NEXT: movl %esi, (%esp)
148 ; X32-NEXT: calll _foo
149 ; X32-NEXT: movl %esi, %eax
150 ; X32-NEXT: jmp LBB2_3
151 ; X32-NEXT: LBB2_2: ## %bb1
152 ; X32-NEXT: movzwl %ax, %eax
153 ; X32-NEXT: LBB2_3: ## %bb1
154 ; X32-NEXT: addl $8, %esp
155 ; X32-NEXT: popl %esi
159 %1 = icmp eq i16 %k, %c
160 br i1 %1, label %bb, label %bb1
163 tail call void @foo(i16 zeroext %0) nounwind
170 define zeroext i16 @test4(i16 zeroext %c, i16 zeroext %k) nounwind ssp {
172 ; X64: ## %bb.0: ## %entry
173 ; X64-NEXT: movl %esi, %eax
174 ; X64-NEXT: addl %edi, %eax
175 ; X64-NEXT: cmpw %di, %si
176 ; X64-NEXT: jne LBB3_2
177 ; X64-NEXT: ## %bb.1: ## %bb
178 ; X64-NEXT: pushq %rbx
179 ; X64-NEXT: movzwl %ax, %ebx
180 ; X64-NEXT: movl %ebx, %edi
181 ; X64-NEXT: callq _foo
182 ; X64-NEXT: movl %ebx, %eax
183 ; X64-NEXT: popq %rbx
185 ; X64-NEXT: LBB3_2: ## %bb1
186 ; X64-NEXT: movzwl %ax, %eax
190 ; X32: ## %bb.0: ## %entry
191 ; X32-NEXT: pushl %esi
192 ; X32-NEXT: subl $8, %esp
193 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
194 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
195 ; X32-NEXT: movl %edx, %eax
196 ; X32-NEXT: addl %ecx, %eax
197 ; X32-NEXT: cmpw %cx, %dx
198 ; X32-NEXT: jne LBB3_2
199 ; X32-NEXT: ## %bb.1: ## %bb
200 ; X32-NEXT: movzwl %ax, %esi
201 ; X32-NEXT: movl %esi, (%esp)
202 ; X32-NEXT: calll _foo
203 ; X32-NEXT: movl %esi, %eax
204 ; X32-NEXT: jmp LBB3_3
205 ; X32-NEXT: LBB3_2: ## %bb1
206 ; X32-NEXT: movzwl %ax, %eax
207 ; X32-NEXT: LBB3_3: ## %bb1
208 ; X32-NEXT: addl $8, %esp
209 ; X32-NEXT: popl %esi
213 %1 = icmp eq i16 %k, %c
214 br i1 %1, label %bb, label %bb1
217 tail call void @foo(i16 zeroext %0) nounwind