1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -fast-isel-sink-local-values -O0 -mtriple=x86_64-unknown -mcpu=skx -o - %s | FileCheck %s --check-prefix=X86-O0
3 ; RUN: llc -fast-isel-sink-local-values -mtriple=x86_64-unknown -mcpu=skx -o - %s | FileCheck %s --check-prefix=X64
4 ; RUN: llc -fast-isel-sink-local-values -O0 -mtriple=i686-unknown -mcpu=skx -o - %s | FileCheck %s --check-prefix=686-O0
5 ; RUN: llc -fast-isel-sink-local-values -mtriple=i686-unknown -mcpu=skx -o - %s | FileCheck %s --check-prefix=686
7 @c = external constant i8, align 1
11 ; X86-O0: # %bb.0: # %entry
12 ; X86-O0-NEXT: xorl %eax, %eax
13 ; X86-O0-NEXT: movl %eax, %ecx
14 ; X86-O0-NEXT: xorl %eax, %eax
15 ; X86-O0-NEXT: movzbl c, %edx
16 ; X86-O0-NEXT: subl %edx, %eax
17 ; X86-O0-NEXT: movslq %eax, %rsi
18 ; X86-O0-NEXT: subq %rsi, %rcx
19 ; X86-O0-NEXT: # kill: def $cl killed $cl killed $rcx
20 ; X86-O0-NEXT: cmpb $0, %cl
21 ; X86-O0-NEXT: setne %cl
22 ; X86-O0-NEXT: andb $1, %cl
23 ; X86-O0-NEXT: movb %cl, -{{[0-9]+}}(%rsp)
24 ; X86-O0-NEXT: cmpb $0, c
25 ; X86-O0-NEXT: setne %cl
26 ; X86-O0-NEXT: xorb $-1, %cl
27 ; X86-O0-NEXT: xorb $-1, %cl
28 ; X86-O0-NEXT: andb $1, %cl
29 ; X86-O0-NEXT: movzbl %cl, %eax
30 ; X86-O0-NEXT: movzbl c, %edx
31 ; X86-O0-NEXT: cmpl %edx, %eax
32 ; X86-O0-NEXT: setle %cl
33 ; X86-O0-NEXT: andb $1, %cl
34 ; X86-O0-NEXT: movzbl %cl, %eax
35 ; X86-O0-NEXT: movl %eax, -{{[0-9]+}}(%rsp)
39 ; X64: # %bb.0: # %entry
40 ; X64-NEXT: movzbl {{.*}}(%rip), %eax
41 ; X64-NEXT: xorl %ecx, %ecx
42 ; X64-NEXT: testl %eax, %eax
44 ; X64-NEXT: testb %al, %al
45 ; X64-NEXT: setne -{{[0-9]+}}(%rsp)
46 ; X64-NEXT: xorl %edx, %edx
47 ; X64-NEXT: cmpl %eax, %ecx
49 ; X64-NEXT: movl %edx, -{{[0-9]+}}(%rsp)
53 ; 686-O0: # %bb.0: # %entry
54 ; 686-O0-NEXT: subl $8, %esp
55 ; 686-O0-NEXT: .cfi_def_cfa_offset 12
56 ; 686-O0-NEXT: movb c, %al
57 ; 686-O0-NEXT: cmpb $0, %al
58 ; 686-O0-NEXT: setne %al
59 ; 686-O0-NEXT: andb $1, %al
60 ; 686-O0-NEXT: movb %al, {{[0-9]+}}(%esp)
61 ; 686-O0-NEXT: cmpb $0, c
62 ; 686-O0-NEXT: setne %al
63 ; 686-O0-NEXT: xorb $-1, %al
64 ; 686-O0-NEXT: xorb $-1, %al
65 ; 686-O0-NEXT: andb $1, %al
66 ; 686-O0-NEXT: movzbl %al, %ecx
67 ; 686-O0-NEXT: movzbl c, %edx
68 ; 686-O0-NEXT: cmpl %edx, %ecx
69 ; 686-O0-NEXT: setle %al
70 ; 686-O0-NEXT: andb $1, %al
71 ; 686-O0-NEXT: movzbl %al, %ecx
72 ; 686-O0-NEXT: movl %ecx, (%esp)
73 ; 686-O0-NEXT: addl $8, %esp
74 ; 686-O0-NEXT: .cfi_def_cfa_offset 4
78 ; 686: # %bb.0: # %entry
79 ; 686-NEXT: subl $8, %esp
80 ; 686-NEXT: .cfi_def_cfa_offset 12
81 ; 686-NEXT: movzbl c, %eax
82 ; 686-NEXT: xorl %ecx, %ecx
83 ; 686-NEXT: testl %eax, %eax
84 ; 686-NEXT: setne {{[0-9]+}}(%esp)
86 ; 686-NEXT: xorl %edx, %edx
87 ; 686-NEXT: cmpl %eax, %ecx
89 ; 686-NEXT: movl %edx, {{[0-9]+}}(%esp)
90 ; 686-NEXT: addl $8, %esp
91 ; 686-NEXT: .cfi_def_cfa_offset 4
94 %a = alloca i8, align 1
95 %b = alloca i32, align 4
96 %0 = load i8, i8* @c, align 1
97 %conv = zext i8 %0 to i32
98 %sub = sub nsw i32 0, %conv
99 %conv1 = sext i32 %sub to i64
100 %sub2 = sub nsw i64 0, %conv1
101 %conv3 = trunc i64 %sub2 to i8
102 %tobool = icmp ne i8 %conv3, 0
103 %frombool = zext i1 %tobool to i8
104 store i8 %frombool, i8* %a, align 1
105 %1 = load i8, i8* @c, align 1
106 %tobool4 = icmp ne i8 %1, 0
107 %lnot = xor i1 %tobool4, true
108 %lnot5 = xor i1 %lnot, true
109 %conv6 = zext i1 %lnot5 to i32
110 %2 = load i8, i8* @c, align 1
111 %conv7 = zext i8 %2 to i32
112 %cmp = icmp sle i32 %conv6, %conv7
113 %conv8 = zext i1 %cmp to i32
114 store i32 %conv8, i32* %b, align 4
118 @var_5 = external global i32, align 4
119 @var_57 = external global i64, align 8
120 @_ZN8struct_210member_2_0E = external global i64, align 8
124 ; X86-O0: # %bb.0: # %entry
125 ; X86-O0-NEXT: movslq var_5, %rax
126 ; X86-O0-NEXT: movabsq $8381627093, %rcx # imm = 0x1F3957AD5
127 ; X86-O0-NEXT: addq %rcx, %rax
128 ; X86-O0-NEXT: cmpq $0, %rax
129 ; X86-O0-NEXT: setne %dl
130 ; X86-O0-NEXT: andb $1, %dl
131 ; X86-O0-NEXT: movb %dl, -{{[0-9]+}}(%rsp)
132 ; X86-O0-NEXT: movl var_5, %esi
133 ; X86-O0-NEXT: xorl $-1, %esi
134 ; X86-O0-NEXT: cmpl $0, %esi
135 ; X86-O0-NEXT: setne %dl
136 ; X86-O0-NEXT: xorb $-1, %dl
137 ; X86-O0-NEXT: andb $1, %dl
138 ; X86-O0-NEXT: movzbl %dl, %esi
139 ; X86-O0-NEXT: movl %esi, %eax
140 ; X86-O0-NEXT: movslq var_5, %rcx
141 ; X86-O0-NEXT: addq $7093, %rcx # imm = 0x1BB5
142 ; X86-O0-NEXT: cmpq %rcx, %rax
143 ; X86-O0-NEXT: setg %dl
144 ; X86-O0-NEXT: andb $1, %dl
145 ; X86-O0-NEXT: movzbl %dl, %esi
146 ; X86-O0-NEXT: movl %esi, %eax
147 ; X86-O0-NEXT: movq %rax, var_57
148 ; X86-O0-NEXT: movl var_5, %esi
149 ; X86-O0-NEXT: xorl $-1, %esi
150 ; X86-O0-NEXT: cmpl $0, %esi
151 ; X86-O0-NEXT: setne %dl
152 ; X86-O0-NEXT: xorb $-1, %dl
153 ; X86-O0-NEXT: andb $1, %dl
154 ; X86-O0-NEXT: movzbl %dl, %esi
155 ; X86-O0-NEXT: movl %esi, %eax
156 ; X86-O0-NEXT: movq %rax, _ZN8struct_210member_2_0E
160 ; X64: # %bb.0: # %entry
161 ; X64-NEXT: movslq {{.*}}(%rip), %rax
162 ; X64-NEXT: movabsq $-8381627093, %rcx # imm = 0xFFFFFFFE0C6A852B
163 ; X64-NEXT: cmpq %rcx, %rax
164 ; X64-NEXT: setne -{{[0-9]+}}(%rsp)
165 ; X64-NEXT: xorl %ecx, %ecx
166 ; X64-NEXT: cmpq $-1, %rax
168 ; X64-NEXT: xorl %edx, %edx
169 ; X64-NEXT: cmpl $-1, %eax
171 ; X64-NEXT: addq $7093, %rax # imm = 0x1BB5
172 ; X64-NEXT: xorl %esi, %esi
173 ; X64-NEXT: cmpq %rax, %rdx
174 ; X64-NEXT: setg %sil
175 ; X64-NEXT: movq %rsi, {{.*}}(%rip)
176 ; X64-NEXT: movq %rcx, {{.*}}(%rip)
180 ; 686-O0: # %bb.0: # %entry
181 ; 686-O0-NEXT: pushl %ebp
182 ; 686-O0-NEXT: .cfi_def_cfa_offset 8
183 ; 686-O0-NEXT: pushl %ebx
184 ; 686-O0-NEXT: .cfi_def_cfa_offset 12
185 ; 686-O0-NEXT: pushl %edi
186 ; 686-O0-NEXT: .cfi_def_cfa_offset 16
187 ; 686-O0-NEXT: pushl %esi
188 ; 686-O0-NEXT: .cfi_def_cfa_offset 20
189 ; 686-O0-NEXT: subl $1, %esp
190 ; 686-O0-NEXT: .cfi_def_cfa_offset 21
191 ; 686-O0-NEXT: .cfi_offset %esi, -20
192 ; 686-O0-NEXT: .cfi_offset %edi, -16
193 ; 686-O0-NEXT: .cfi_offset %ebx, -12
194 ; 686-O0-NEXT: .cfi_offset %ebp, -8
195 ; 686-O0-NEXT: movl var_5, %eax
196 ; 686-O0-NEXT: movl %eax, %ecx
197 ; 686-O0-NEXT: sarl $31, %ecx
198 ; 686-O0-NEXT: xorl $208307499, %eax # imm = 0xC6A852B
199 ; 686-O0-NEXT: xorl $-2, %ecx
200 ; 686-O0-NEXT: orl %ecx, %eax
201 ; 686-O0-NEXT: setne (%esp)
202 ; 686-O0-NEXT: movl var_5, %ecx
203 ; 686-O0-NEXT: movl %ecx, %edx
204 ; 686-O0-NEXT: sarl $31, %edx
205 ; 686-O0-NEXT: movl %ecx, %esi
206 ; 686-O0-NEXT: subl $-1, %esi
207 ; 686-O0-NEXT: sete %bl
208 ; 686-O0-NEXT: movzbl %bl, %edi
209 ; 686-O0-NEXT: addl $7093, %ecx # imm = 0x1BB5
210 ; 686-O0-NEXT: adcl $0, %edx
211 ; 686-O0-NEXT: subl %edi, %ecx
212 ; 686-O0-NEXT: sbbl $0, %edx
213 ; 686-O0-NEXT: setl %bl
214 ; 686-O0-NEXT: movzbl %bl, %edi
215 ; 686-O0-NEXT: movl %edi, var_57
216 ; 686-O0-NEXT: movl $0, var_57+4
217 ; 686-O0-NEXT: movl var_5, %edi
218 ; 686-O0-NEXT: subl $-1, %edi
219 ; 686-O0-NEXT: sete %bl
220 ; 686-O0-NEXT: movzbl %bl, %ebp
221 ; 686-O0-NEXT: movl %ebp, _ZN8struct_210member_2_0E
222 ; 686-O0-NEXT: movl $0, _ZN8struct_210member_2_0E+4
223 ; 686-O0-NEXT: addl $1, %esp
224 ; 686-O0-NEXT: .cfi_def_cfa_offset 20
225 ; 686-O0-NEXT: popl %esi
226 ; 686-O0-NEXT: .cfi_def_cfa_offset 16
227 ; 686-O0-NEXT: popl %edi
228 ; 686-O0-NEXT: .cfi_def_cfa_offset 12
229 ; 686-O0-NEXT: popl %ebx
230 ; 686-O0-NEXT: .cfi_def_cfa_offset 8
231 ; 686-O0-NEXT: popl %ebp
232 ; 686-O0-NEXT: .cfi_def_cfa_offset 4
236 ; 686: # %bb.0: # %entry
237 ; 686-NEXT: pushl %esi
238 ; 686-NEXT: .cfi_def_cfa_offset 8
239 ; 686-NEXT: subl $1, %esp
240 ; 686-NEXT: .cfi_def_cfa_offset 9
241 ; 686-NEXT: .cfi_offset %esi, -8
242 ; 686-NEXT: movl var_5, %edx
243 ; 686-NEXT: movl %edx, %eax
244 ; 686-NEXT: xorl $208307499, %eax # imm = 0xC6A852B
245 ; 686-NEXT: movl %edx, %esi
246 ; 686-NEXT: sarl $31, %esi
247 ; 686-NEXT: movl %esi, %ecx
248 ; 686-NEXT: xorl $-2, %ecx
249 ; 686-NEXT: orl %eax, %ecx
250 ; 686-NEXT: setne (%esp)
251 ; 686-NEXT: movl %edx, %ecx
252 ; 686-NEXT: andl %esi, %ecx
253 ; 686-NEXT: xorl %eax, %eax
254 ; 686-NEXT: cmpl $-1, %ecx
256 ; 686-NEXT: xorl %ecx, %ecx
257 ; 686-NEXT: cmpl $-1, %edx
259 ; 686-NEXT: addl $7093, %edx # imm = 0x1BB5
260 ; 686-NEXT: adcl $0, %esi
261 ; 686-NEXT: cmpl %ecx, %edx
262 ; 686-NEXT: sbbl $0, %esi
264 ; 686-NEXT: movzbl %cl, %ecx
265 ; 686-NEXT: movl %ecx, var_57
266 ; 686-NEXT: movl $0, var_57+4
267 ; 686-NEXT: movl %eax, _ZN8struct_210member_2_0E
268 ; 686-NEXT: movl $0, _ZN8struct_210member_2_0E+4
269 ; 686-NEXT: addl $1, %esp
270 ; 686-NEXT: .cfi_def_cfa_offset 8
271 ; 686-NEXT: popl %esi
272 ; 686-NEXT: .cfi_def_cfa_offset 4
275 %a = alloca i8, align 1
276 %0 = load i32, i32* @var_5, align 4
277 %conv = sext i32 %0 to i64
278 %add = add nsw i64 %conv, 8381627093
279 %tobool = icmp ne i64 %add, 0
280 %frombool = zext i1 %tobool to i8
281 store i8 %frombool, i8* %a, align 1
282 %1 = load i32, i32* @var_5, align 4
283 %neg = xor i32 %1, -1
284 %tobool1 = icmp ne i32 %neg, 0
285 %lnot = xor i1 %tobool1, true
286 %conv2 = zext i1 %lnot to i64
287 %2 = load i32, i32* @var_5, align 4
288 %conv3 = sext i32 %2 to i64
289 %add4 = add nsw i64 %conv3, 7093
290 %cmp = icmp sgt i64 %conv2, %add4
291 %conv5 = zext i1 %cmp to i64
292 store i64 %conv5, i64* @var_57, align 8
293 %3 = load i32, i32* @var_5, align 4
294 %neg6 = xor i32 %3, -1
295 %tobool7 = icmp ne i32 %neg6, 0
296 %lnot8 = xor i1 %tobool7, true
297 %conv9 = zext i1 %lnot8 to i64
298 store i64 %conv9, i64* @_ZN8struct_210member_2_0E, align 8
303 @var_7 = external global i8, align 1
307 ; X86-O0: # %bb.0: # %entry
308 ; X86-O0-NEXT: movzbl var_7, %eax
309 ; X86-O0-NEXT: cmpb $0, var_7
310 ; X86-O0-NEXT: setne %cl
311 ; X86-O0-NEXT: xorb $-1, %cl
312 ; X86-O0-NEXT: andb $1, %cl
313 ; X86-O0-NEXT: movzbl %cl, %edx
314 ; X86-O0-NEXT: xorl %edx, %eax
315 ; X86-O0-NEXT: # kill: def $ax killed $ax killed $eax
316 ; X86-O0-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
317 ; X86-O0-NEXT: movzbl var_7, %edx
318 ; X86-O0-NEXT: # kill: def $dx killed $dx killed $edx
319 ; X86-O0-NEXT: cmpw $0, %dx
320 ; X86-O0-NEXT: setne %cl
321 ; X86-O0-NEXT: xorb $-1, %cl
322 ; X86-O0-NEXT: andb $1, %cl
323 ; X86-O0-NEXT: movzbl %cl, %esi
324 ; X86-O0-NEXT: movzbl var_7, %edi
325 ; X86-O0-NEXT: cmpl %edi, %esi
326 ; X86-O0-NEXT: sete %cl
327 ; X86-O0-NEXT: andb $1, %cl
328 ; X86-O0-NEXT: movzbl %cl, %esi
329 ; X86-O0-NEXT: # kill: def $si killed $si killed $esi
330 ; X86-O0-NEXT: # implicit-def: $r8
331 ; X86-O0-NEXT: movw %si, (%r8)
335 ; X64: # %bb.0: # %entry
336 ; X64-NEXT: movzbl {{.*}}(%rip), %eax
337 ; X64-NEXT: xorl %ecx, %ecx
338 ; X64-NEXT: testl %eax, %eax
340 ; X64-NEXT: xorl %eax, %ecx
341 ; X64-NEXT: movw %cx, -{{[0-9]+}}(%rsp)
342 ; X64-NEXT: xorl %ecx, %ecx
343 ; X64-NEXT: testb %al, %al
345 ; X64-NEXT: xorl %edx, %edx
346 ; X64-NEXT: cmpl %eax, %ecx
348 ; X64-NEXT: movw %dx, (%rax)
352 ; 686-O0: # %bb.0: # %entry
353 ; 686-O0-NEXT: pushl %edi
354 ; 686-O0-NEXT: .cfi_def_cfa_offset 8
355 ; 686-O0-NEXT: pushl %esi
356 ; 686-O0-NEXT: .cfi_def_cfa_offset 12
357 ; 686-O0-NEXT: subl $2, %esp
358 ; 686-O0-NEXT: .cfi_def_cfa_offset 14
359 ; 686-O0-NEXT: .cfi_offset %esi, -12
360 ; 686-O0-NEXT: .cfi_offset %edi, -8
361 ; 686-O0-NEXT: movzbl var_7, %eax
362 ; 686-O0-NEXT: cmpb $0, var_7
363 ; 686-O0-NEXT: setne %cl
364 ; 686-O0-NEXT: xorb $-1, %cl
365 ; 686-O0-NEXT: andb $1, %cl
366 ; 686-O0-NEXT: movzbl %cl, %edx
367 ; 686-O0-NEXT: xorl %edx, %eax
368 ; 686-O0-NEXT: # kill: def $ax killed $ax killed $eax
369 ; 686-O0-NEXT: movw %ax, (%esp)
370 ; 686-O0-NEXT: movzbl var_7, %edx
371 ; 686-O0-NEXT: # kill: def $dx killed $dx killed $edx
372 ; 686-O0-NEXT: cmpw $0, %dx
373 ; 686-O0-NEXT: setne %cl
374 ; 686-O0-NEXT: xorb $-1, %cl
375 ; 686-O0-NEXT: andb $1, %cl
376 ; 686-O0-NEXT: movzbl %cl, %esi
377 ; 686-O0-NEXT: movzbl var_7, %edi
378 ; 686-O0-NEXT: cmpl %edi, %esi
379 ; 686-O0-NEXT: sete %cl
380 ; 686-O0-NEXT: andb $1, %cl
381 ; 686-O0-NEXT: movzbl %cl, %esi
382 ; 686-O0-NEXT: # kill: def $si killed $si killed $esi
383 ; 686-O0-NEXT: # implicit-def: $edi
384 ; 686-O0-NEXT: movw %si, (%edi)
385 ; 686-O0-NEXT: addl $2, %esp
386 ; 686-O0-NEXT: .cfi_def_cfa_offset 12
387 ; 686-O0-NEXT: popl %esi
388 ; 686-O0-NEXT: .cfi_def_cfa_offset 8
389 ; 686-O0-NEXT: popl %edi
390 ; 686-O0-NEXT: .cfi_def_cfa_offset 4
394 ; 686: # %bb.0: # %entry
395 ; 686-NEXT: subl $2, %esp
396 ; 686-NEXT: .cfi_def_cfa_offset 6
397 ; 686-NEXT: movzbl var_7, %eax
398 ; 686-NEXT: xorl %ecx, %ecx
399 ; 686-NEXT: testl %eax, %eax
401 ; 686-NEXT: xorl %eax, %ecx
402 ; 686-NEXT: movw %cx, (%esp)
403 ; 686-NEXT: xorl %ecx, %ecx
404 ; 686-NEXT: testb %al, %al
406 ; 686-NEXT: xorl %edx, %edx
407 ; 686-NEXT: cmpl %eax, %ecx
409 ; 686-NEXT: movw %dx, (%eax)
410 ; 686-NEXT: addl $2, %esp
411 ; 686-NEXT: .cfi_def_cfa_offset 4
414 %a = alloca i16, align 2
415 %0 = load i8, i8* @var_7, align 1
416 %conv = zext i8 %0 to i32
417 %1 = load i8, i8* @var_7, align 1
418 %tobool = icmp ne i8 %1, 0
419 %lnot = xor i1 %tobool, true
420 %conv1 = zext i1 %lnot to i32
421 %xor = xor i32 %conv, %conv1
422 %conv2 = trunc i32 %xor to i16
423 store i16 %conv2, i16* %a, align 2
424 %2 = load i8, i8* @var_7, align 1
425 %conv3 = zext i8 %2 to i16
426 %tobool4 = icmp ne i16 %conv3, 0
427 %lnot5 = xor i1 %tobool4, true
428 %conv6 = zext i1 %lnot5 to i32
429 %3 = load i8, i8* @var_7, align 1
430 %conv7 = zext i8 %3 to i32
431 %cmp = icmp eq i32 %conv6, %conv7
432 %conv8 = zext i1 %cmp to i32
433 %conv9 = trunc i32 %conv8 to i16
434 store i16 %conv9, i16* undef, align 2
439 @var_13 = external global i32, align 4
440 @var_16 = external global i32, align 4
441 @var_46 = external global i32, align 4
443 define void @f3() #0 {
445 ; X86-O0: # %bb.0: # %entry
446 ; X86-O0-NEXT: movl var_13, %eax
447 ; X86-O0-NEXT: xorl $-1, %eax
448 ; X86-O0-NEXT: movl %eax, %eax
449 ; X86-O0-NEXT: movl %eax, %ecx
450 ; X86-O0-NEXT: cmpl $0, var_13
451 ; X86-O0-NEXT: setne %dl
452 ; X86-O0-NEXT: xorb $-1, %dl
453 ; X86-O0-NEXT: andb $1, %dl
454 ; X86-O0-NEXT: movzbl %dl, %eax
455 ; X86-O0-NEXT: movl %eax, %esi
456 ; X86-O0-NEXT: movl var_13, %eax
457 ; X86-O0-NEXT: xorl $-1, %eax
458 ; X86-O0-NEXT: xorl var_16, %eax
459 ; X86-O0-NEXT: movl %eax, %eax
460 ; X86-O0-NEXT: movl %eax, %edi
461 ; X86-O0-NEXT: andq %rdi, %rsi
462 ; X86-O0-NEXT: orq %rsi, %rcx
463 ; X86-O0-NEXT: movq %rcx, -{{[0-9]+}}(%rsp)
464 ; X86-O0-NEXT: movl var_13, %eax
465 ; X86-O0-NEXT: xorl $-1, %eax
466 ; X86-O0-NEXT: movl %eax, %eax
467 ; X86-O0-NEXT: movl %eax, %ecx
468 ; X86-O0-NEXT: cmpl $0, var_13
469 ; X86-O0-NEXT: setne %dl
470 ; X86-O0-NEXT: xorb $-1, %dl
471 ; X86-O0-NEXT: andb $1, %dl
472 ; X86-O0-NEXT: movzbl %dl, %eax
473 ; X86-O0-NEXT: movl %eax, %esi
474 ; X86-O0-NEXT: andq $0, %rsi
475 ; X86-O0-NEXT: orq %rsi, %rcx
476 ; X86-O0-NEXT: # kill: def $ecx killed $ecx killed $rcx
477 ; X86-O0-NEXT: movl %ecx, var_46
481 ; X64: # %bb.0: # %entry
482 ; X64-NEXT: movl {{.*}}(%rip), %eax
483 ; X64-NEXT: xorl %ecx, %ecx
484 ; X64-NEXT: testl %eax, %eax
485 ; X64-NEXT: notl %eax
487 ; X64-NEXT: movl {{.*}}(%rip), %edx
488 ; X64-NEXT: xorl %eax, %edx
489 ; X64-NEXT: andl %edx, %ecx
490 ; X64-NEXT: orl %eax, %ecx
491 ; X64-NEXT: movq %rcx, -{{[0-9]+}}(%rsp)
492 ; X64-NEXT: movl %eax, {{.*}}(%rip)
496 ; 686-O0: # %bb.0: # %entry
497 ; 686-O0-NEXT: pushl %ebp
498 ; 686-O0-NEXT: .cfi_def_cfa_offset 8
499 ; 686-O0-NEXT: .cfi_offset %ebp, -8
500 ; 686-O0-NEXT: movl %esp, %ebp
501 ; 686-O0-NEXT: .cfi_def_cfa_register %ebp
502 ; 686-O0-NEXT: pushl %edi
503 ; 686-O0-NEXT: pushl %esi
504 ; 686-O0-NEXT: andl $-8, %esp
505 ; 686-O0-NEXT: subl $8, %esp
506 ; 686-O0-NEXT: .cfi_offset %esi, -16
507 ; 686-O0-NEXT: .cfi_offset %edi, -12
508 ; 686-O0-NEXT: movl var_13, %eax
509 ; 686-O0-NEXT: movl %eax, %ecx
510 ; 686-O0-NEXT: notl %ecx
511 ; 686-O0-NEXT: testl %eax, %eax
512 ; 686-O0-NEXT: sete %dl
513 ; 686-O0-NEXT: movzbl %dl, %eax
514 ; 686-O0-NEXT: movl var_16, %esi
515 ; 686-O0-NEXT: movl %ecx, %edi
516 ; 686-O0-NEXT: xorl %esi, %edi
517 ; 686-O0-NEXT: andl %edi, %eax
518 ; 686-O0-NEXT: orl %eax, %ecx
519 ; 686-O0-NEXT: movl %ecx, (%esp)
520 ; 686-O0-NEXT: movl $0, {{[0-9]+}}(%esp)
521 ; 686-O0-NEXT: movl var_13, %eax
522 ; 686-O0-NEXT: notl %eax
523 ; 686-O0-NEXT: movl %eax, var_46
524 ; 686-O0-NEXT: leal -8(%ebp), %esp
525 ; 686-O0-NEXT: popl %esi
526 ; 686-O0-NEXT: popl %edi
527 ; 686-O0-NEXT: popl %ebp
528 ; 686-O0-NEXT: .cfi_def_cfa %esp, 4
532 ; 686: # %bb.0: # %entry
533 ; 686-NEXT: pushl %ebp
534 ; 686-NEXT: .cfi_def_cfa_offset 8
535 ; 686-NEXT: .cfi_offset %ebp, -8
536 ; 686-NEXT: movl %esp, %ebp
537 ; 686-NEXT: .cfi_def_cfa_register %ebp
538 ; 686-NEXT: andl $-8, %esp
539 ; 686-NEXT: subl $8, %esp
540 ; 686-NEXT: movl var_13, %ecx
541 ; 686-NEXT: xorl %eax, %eax
542 ; 686-NEXT: testl %ecx, %ecx
543 ; 686-NEXT: notl %ecx
545 ; 686-NEXT: movl var_16, %edx
546 ; 686-NEXT: xorl %ecx, %edx
547 ; 686-NEXT: andl %eax, %edx
548 ; 686-NEXT: orl %ecx, %edx
549 ; 686-NEXT: movl %edx, (%esp)
550 ; 686-NEXT: movl $0, {{[0-9]+}}(%esp)
551 ; 686-NEXT: movl %ecx, var_46
552 ; 686-NEXT: movl %ebp, %esp
553 ; 686-NEXT: popl %ebp
554 ; 686-NEXT: .cfi_def_cfa %esp, 4
557 %a = alloca i64, align 8
558 %0 = load i32, i32* @var_13, align 4
559 %neg = xor i32 %0, -1
560 %conv = zext i32 %neg to i64
561 %1 = load i32, i32* @var_13, align 4
562 %tobool = icmp ne i32 %1, 0
563 %lnot = xor i1 %tobool, true
564 %conv1 = zext i1 %lnot to i64
565 %2 = load i32, i32* @var_13, align 4
566 %neg2 = xor i32 %2, -1
567 %3 = load i32, i32* @var_16, align 4
568 %xor = xor i32 %neg2, %3
569 %conv3 = zext i32 %xor to i64
570 %and = and i64 %conv1, %conv3
571 %or = or i64 %conv, %and
572 store i64 %or, i64* %a, align 8
573 %4 = load i32, i32* @var_13, align 4
574 %neg4 = xor i32 %4, -1
575 %conv5 = zext i32 %neg4 to i64
576 %5 = load i32, i32* @var_13, align 4
577 %tobool6 = icmp ne i32 %5, 0
578 %lnot7 = xor i1 %tobool6, true
579 %conv8 = zext i1 %lnot7 to i64
580 %and9 = and i64 %conv8, 0
581 %or10 = or i64 %conv5, %and9
582 %conv11 = trunc i64 %or10 to i32
583 store i32 %conv11, i32* @var_46, align 4