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: ## kill: def $edi killed $edi def $rdi
12 ; CHECK-NEXT: andl $32, %edi
13 ; CHECK-NEXT: leal 13(%rdi), %eax
14 ; CHECK-NEXT: xorb $-14, %al
15 ; CHECK-NEXT: addb $82, %al
16 ; CHECK-NEXT: movzbl %al, %eax
17 ; CHECK-NEXT: testl %esi, %edi
18 ; CHECK-NEXT: movl $1, %ecx
19 ; CHECK-NEXT: cmovnel %eax, %ecx
20 ; CHECK-NEXT: xorb $81, %cl
21 ; CHECK-NEXT: movzbl %cl, %eax
22 ; CHECK-NEXT: addl $2062143348, %eax ## imm = 0x7AE9CF74
23 ; CHECK-NEXT: movl %eax, (%rdx)
26 %tmp48 = zext i8 %arg4 to i32
27 %tmp49 = and i32 %tmp48, 32
28 %tmp50 = add i32 %tmp49, 1593371643
29 %tmp55 = sub i32 %tmp50, 0
30 %tmp56 = add i32 %tmp55, 7787538
31 %tmp57 = xor i32 %tmp56, 1601159181
32 %tmp58 = xor i32 %arg5, 1601159181
33 %tmp59 = and i32 %tmp57, %tmp58
34 %tmp60 = add i32 %tmp59, -1263900958
35 %tmp67 = sub i32 %tmp60, 0
36 %tmp103 = xor i32 %tmp56, 13
37 %tmp104 = trunc i32 %tmp103 to i8
38 %tmp105 = sub i8 0, %tmp104
39 %tmp106 = add i8 %tmp105, -103
40 %tmp113 = sub i8 %tmp106, 0
41 %tmp114 = add i8 %tmp113, -72
42 %tmp141 = icmp ne i32 %tmp67, -1263900958
43 %tmp142 = select i1 %tmp141, i8 %tmp114, i8 1
44 %tmp143 = xor i8 %tmp142, 81
45 %tmp144 = zext i8 %tmp143 to i32
46 %tmp145 = add i32 %tmp144, 2062143348
47 %tmp152 = sub i32 %tmp145, 0
48 store i32 %tmp152, i32* %arg14