blob: e635c6835025666c5ffdb4190adf09ea99d7e330 [file] [log] [blame]
Nirav Dave472b5ef2017-03-28 17:09:49 +00001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s | FileCheck %s
3
4target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
5target triple = "x86_64-apple-macosx10.12.0"
6
7@a = common local_unnamed_addr global i16 0, align 4
8@b = common local_unnamed_addr global i16 0, align 4
9
10define i32 @PR32420() {
11; CHECK-LABEL: PR32420:
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000012; CHECK: ## %bb.0:
Nirav Dave472b5ef2017-03-28 17:09:49 +000013; CHECK-NEXT: movq _a@{{.*}}(%rip), %rax
14; CHECK-NEXT: movzwl (%rax), %eax
15; CHECK-NEXT: movl %eax, %ecx
16; CHECK-NEXT: shll $12, %ecx
17; CHECK-NEXT: sarw $12, %cx
18; CHECK-NEXT: movq _b@{{.*}}(%rip), %rdx
Nikolai Bozhenov84af99b2017-09-18 10:17:59 +000019; CHECK-NEXT: movl %ecx, %esi
Nirav Dave472b5ef2017-03-28 17:09:49 +000020; CHECK-NEXT: orw (%rdx), %si
21; CHECK-NEXT: andl %ecx, %esi
22; CHECK-NEXT: movw %si, (%rdx)
23; CHECK-NEXT: retq
24 %load2 = load i16, i16* @a, align 4
25 %shl3 = shl i16 %load2, 12
26 %ashr4 = ashr i16 %shl3, 12
27 %t2 = load volatile i16, i16* @b, align 4
28 %conv8 = or i16 %t2, %ashr4
29 %load9 = load i16, i16* @a, align 4
30 %shl10 = shl i16 %load9, 12
31 %ashr11 = ashr i16 %shl10, 12
32 %and = and i16 %conv8, %ashr11
33 store i16 %and, i16* @b, align 4
34 %cast1629 = zext i16 %load2 to i32
35 ret i32 %cast1629
36}