1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -fast-isel-sink-local-values -O0 -mtriple=x86_64-unknown-linux-gnu -fast-isel-abort=1 -o - %s | FileCheck %s -check-prefix=X64
4 @var_825 = external global i16, align 2
5 @var_32 = external global i16, align 2
6 @var_901 = external global i16, align 2
7 @var_826 = external global i64, align 8
8 @var_57 = external global i64, align 8
9 @var_900 = external global i16, align 2
10 @var_28 = external constant i64, align 8
11 @var_827 = external global i16, align 2
15 ; X64: # %bb.0: # %entry
16 ; X64-NEXT: xorl %eax, %eax
17 ; X64-NEXT: movl %eax, %ecx
18 ; X64-NEXT: movw $0, var_825
19 ; X64-NEXT: movzwl var_32, %eax
20 ; X64-NEXT: movzwl var_901, %edx
21 ; X64-NEXT: movl %eax, %esi
22 ; X64-NEXT: xorl %edx, %esi
23 ; X64-NEXT: movl %eax, %edx
24 ; X64-NEXT: xorl %esi, %edx
25 ; X64-NEXT: addl %eax, %edx
26 ; X64-NEXT: movslq %edx, %rdi
27 ; X64-NEXT: movq %rdi, var_826
28 ; X64-NEXT: movzwl var_32, %eax
29 ; X64-NEXT: movl %eax, %edi
30 ; X64-NEXT: movzwl var_901, %eax
31 ; X64-NEXT: xorl $51981, %eax # imm = 0xCB0D
32 ; X64-NEXT: movslq %eax, %r8
33 ; X64-NEXT: movabsq $-1142377792914660288, %r9 # imm = 0xF02575732E06E440
34 ; X64-NEXT: xorq %r9, %r8
35 ; X64-NEXT: movq %rdi, %r9
36 ; X64-NEXT: xorq %r8, %r9
37 ; X64-NEXT: xorq $-1, %r9
38 ; X64-NEXT: xorq %r9, %rdi
39 ; X64-NEXT: movq %rdi, %r8
40 ; X64-NEXT: orq var_57, %r8
41 ; X64-NEXT: orq %r8, %rdi
42 ; X64-NEXT: # kill: def $di killed $di killed $rdi
43 ; X64-NEXT: movw %di, var_900
44 ; X64-NEXT: cmpq var_28, %rcx
45 ; X64-NEXT: setne %r10b
46 ; X64-NEXT: andb $1, %r10b
47 ; X64-NEXT: movzbl %r10b, %eax
48 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
49 ; X64-NEXT: movw %ax, var_827
52 store i16 0, i16* @var_825, align 2
53 %v0 = load i16, i16* @var_32, align 2
54 %conv = zext i16 %v0 to i32
55 %v2 = load i16, i16* @var_901, align 2
56 %conv2 = zext i16 %v2 to i32
57 %xor = xor i32 %conv, %conv2
58 %xor3 = xor i32 %conv, %xor
59 %add = add nsw i32 %xor3, %conv
60 %conv5 = sext i32 %add to i64
61 store i64 %conv5, i64* @var_826, align 8
62 %v4 = load i16, i16* @var_32, align 2
63 %conv6 = zext i16 %v4 to i64
64 %v6 = load i16, i16* @var_901, align 2
65 %conv8 = zext i16 %v6 to i32
66 %xor9 = xor i32 51981, %conv8
67 %conv10 = sext i32 %xor9 to i64
68 %xor11 = xor i64 -1142377792914660288, %conv10
69 %xor12 = xor i64 %conv6, %xor11
70 %neg = xor i64 %xor12, -1
71 %xor13 = xor i64 %conv6, %neg
72 %v9 = load i16, i16* @var_901, align 2
73 %v10 = load i64, i64* @var_57, align 8
74 %or = or i64 %xor13, %v10
75 %or23 = or i64 %xor13, %or
76 %conv24 = trunc i64 %or23 to i16
77 store i16 %conv24, i16* @var_900, align 2
78 %v11 = load i64, i64* @var_28, align 8
79 %cmp = icmp ne i64 0, %v11
80 %conv25 = zext i1 %cmp to i16
81 store i16 %conv25, i16* @var_827, align 2