1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-macosx | FileCheck %s
4 ; Cmp lowering should not look past the truncate unless the high bits are known
8 define void @foo(i8 %arg4, i32 %arg5, i32* %arg14) nounwind {
10 ; CHECK: ## %bb.0: ## %bb
11 ; CHECK-NEXT: andl $32, %edi
12 ; CHECK-NEXT: orl $1601159181, %edi ## imm = 0x5F6FC00D
13 ; CHECK-NEXT: andl %edi, %esi
14 ; CHECK-NEXT: xorb $-14, %dil
15 ; CHECK-NEXT: addb $82, %dil
16 ; CHECK-NEXT: shrl $5, %esi
17 ; CHECK-NEXT: movzbl %dil, %eax
18 ; CHECK-NEXT: testb %sil, %sil
19 ; CHECK-NEXT: movl $1, %ecx
20 ; CHECK-NEXT: cmovnel %eax, %ecx
21 ; CHECK-NEXT: xorb $81, %cl
22 ; CHECK-NEXT: movzbl %cl, %eax
23 ; CHECK-NEXT: addl $2062143348, %eax ## imm = 0x7AE9CF74
24 ; CHECK-NEXT: movl %eax, (%rdx)
27 %tmp48 = zext i8 %arg4 to i32
28 %tmp49 = and i32 %tmp48, 32
29 %tmp50 = add i32 %tmp49, 1593371643
30 %tmp55 = sub i32 %tmp50, 0
31 %tmp56 = add i32 %tmp55, 7787538
32 %tmp57 = xor i32 %tmp56, 1601159181
33 %tmp58 = xor i32 %arg5, 1601159181
34 %tmp59 = and i32 %tmp57, %tmp58
35 %tmp60 = add i32 %tmp59, -1263900958
36 %tmp67 = sub i32 %tmp60, 0
37 %tmp103 = xor i32 %tmp56, 13
38 %tmp104 = trunc i32 %tmp103 to i8
39 %tmp105 = sub i8 0, %tmp104
40 %tmp106 = add i8 %tmp105, -103
41 %tmp113 = sub i8 %tmp106, 0
42 %tmp114 = add i8 %tmp113, -72
43 %tmp141 = icmp ne i32 %tmp67, -1263900958
44 %tmp142 = select i1 %tmp141, i8 %tmp114, i8 1
45 %tmp143 = xor i8 %tmp142, 81
46 %tmp144 = zext i8 %tmp143 to i32
47 %tmp145 = add i32 %tmp144, 2062143348
48 %tmp152 = sub i32 %tmp145, 0
49 store i32 %tmp152, i32* %arg14