1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-linux-gnu | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s --check-prefix=X64
5 define i32 @fn(i32 %a0, i32 %a1) {
7 ; X86: # %bb.0: # %entry
9 ; X86-NEXT: .cfi_def_cfa_offset 8
10 ; X86-NEXT: .cfi_offset %ebx, -8
11 ; X86-NEXT: xorl %eax, %eax
12 ; X86-NEXT: cmpl $1, {{[0-9]+}}(%esp)
15 ; X86-NEXT: cmpl $1, {{[0-9]+}}(%esp)
18 ; X86-NEXT: addb %cl, %cl
19 ; X86-NEXT: movl %eax, %ebx
20 ; X86-NEXT: shll %cl, %ebx
21 ; X86-NEXT: addb %dl, %dl
22 ; X86-NEXT: movl %edx, %ecx
23 ; X86-NEXT: shll %cl, %eax
24 ; X86-NEXT: .p2align 4, 0x90
25 ; X86-NEXT: .LBB0_1: # %bb1
26 ; X86-NEXT: # =>This Inner Loop Header: Depth=1
27 ; X86-NEXT: testl %ebx, %ebx
28 ; X86-NEXT: je .LBB0_1
29 ; X86-NEXT: # %bb.2: # %bb2
31 ; X86-NEXT: .cfi_def_cfa_offset 4
35 ; X64: # %bb.0: # %entry
36 ; X64-NEXT: xorl %eax, %eax
37 ; X64-NEXT: cmpl $1, %edi
40 ; X64-NEXT: cmpl $1, %esi
43 ; X64-NEXT: addb %cl, %cl
44 ; X64-NEXT: movl %eax, %esi
45 ; X64-NEXT: shll %cl, %esi
46 ; X64-NEXT: addb %dl, %dl
47 ; X64-NEXT: movl %edx, %ecx
48 ; X64-NEXT: shll %cl, %eax
49 ; X64-NEXT: .p2align 4, 0x90
50 ; X64-NEXT: .LBB0_1: # %bb1
51 ; X64-NEXT: # =>This Inner Loop Header: Depth=1
52 ; X64-NEXT: testl %esi, %esi
53 ; X64-NEXT: je .LBB0_1
54 ; X64-NEXT: # %bb.2: # %bb2
57 %cmp1 = icmp ne i32 %a0, 1
58 %cmp2 = icmp eq i32 %a1, 1
59 %sel1 = select i1 %cmp1, i32 0, i32 2
60 %sel2 = select i1 %cmp2, i32 2, i32 0
61 %sext = sext i1 %cmp1 to i32
62 %shl1 = shl i32 %sext, %sel1
63 %shl2 = shl i32 %sext, %sel2
64 %tobool = icmp eq i32 %shl1, 0
67 bb1: ; preds = %bb1, %entry
68 br i1 %tobool, label %bb1, label %bb2