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
7 ; X86: # %bb.0: # %entry
8 ; X86-NEXT: xorl %eax, %eax
9 ; X86-NEXT: cmpl $1, %eax
13 ; X86-NEXT: addb %cl, %cl
14 ; X86-NEXT: shll %cl, %eax
15 ; X86-NEXT: .p2align 4, 0x90
16 ; X86-NEXT: .LBB0_1: # %bb1
17 ; X86-NEXT: # =>This Inner Loop Header: Depth=1
18 ; X86-NEXT: testl %eax, %eax
19 ; X86-NEXT: je .LBB0_1
20 ; X86-NEXT: # %bb.2: # %bb2
24 ; X64: # %bb.0: # %entry
25 ; X64-NEXT: xorl %eax, %eax
26 ; X64-NEXT: cmpl $1, %eax
30 ; X64-NEXT: addb %cl, %cl
31 ; X64-NEXT: shll %cl, %eax
32 ; X64-NEXT: .p2align 4, 0x90
33 ; X64-NEXT: .LBB0_1: # %bb1
34 ; X64-NEXT: # =>This Inner Loop Header: Depth=1
35 ; X64-NEXT: testl %eax, %eax
36 ; X64-NEXT: je .LBB0_1
37 ; X64-NEXT: # %bb.2: # %bb2
40 %cmp1 = icmp ne i32 undef, 1
41 %cmp2 = icmp eq i32 undef, 1
42 %sel1 = select i1 %cmp1, i32 0, i32 2
43 %sel2 = select i1 %cmp2, i32 2, i32 0
44 %sext = sext i1 %cmp1 to i32
45 %shl1 = shl i32 %sext, %sel1
46 %shl2 = shl i32 %sext, %sel2
47 %tobool = icmp eq i32 %shl1, 0
50 bb1: ; preds = %bb1, %entry
51 br i1 %tobool, label %bb1, label %bb2