1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=X64
5 define void @PR118934(i1 %b, ptr %f, ptr %k) {
7 ; X86: # %bb.0: # %entry
8 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
9 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
10 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %edx
11 ; X86-NEXT: andb $1, %dl
12 ; X86-NEXT: addb %dl, %dl
13 ; X86-NEXT: addb $-2, %dl
14 ; X86-NEXT: movsbl %dl, %edx
15 ; X86-NEXT: addl $-6, %edx
16 ; X86-NEXT: addl $6, %edx
17 ; X86-NEXT: movl %edx, (%ecx)
18 ; X86-NEXT: addl %edx, %edx
19 ; X86-NEXT: movl %edx, (%eax)
21 ; X64-LABEL: PR118934:
22 ; X64: # %bb.0: # %entry
23 ; X64-NEXT: andb $1, %dil
24 ; X64-NEXT: addb %dil, %dil
25 ; X64-NEXT: addb $-2, %dil
26 ; X64-NEXT: movsbl %dil, %eax
27 ; X64-NEXT: addl $-6, %eax
28 ; X64-NEXT: addl $6, %eax
29 ; X64-NEXT: movl %eax, (%rsi)
30 ; X64-NEXT: addl %eax, %eax
31 ; X64-NEXT: movl %eax, (%rdx)
33 %0 = select i1 %b, i8 0, i8 -2
37 %n.i.i = select i1 poison, i32 6, i32 7
38 %narrow = add nsw i8 %0, -6
39 %add2.i = sext i8 %narrow to i32
40 %conv5.i = add nsw i32 %n.i.i, %add2.i
41 store i32 %conv5.i, ptr %f, align 4
42 %add = shl nsw i32 %conv5.i, 1
43 store i32 %add, ptr %k, align 4