[PowerPC] Recommit r314244 with refactoring and off by default
[llvm-core.git] / test / CodeGen / X86 / pr32420.ll
blobd48129459005ba4f0b110bba3297e7113d95dc7d
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s | FileCheck %s
4 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-apple-macosx10.12.0"
7 @a = common local_unnamed_addr global i16 0, align 4
8 @b = common local_unnamed_addr global i16 0, align 4
10 define i32 @PR32420() {
11 ; CHECK-LABEL: PR32420:
12 ; CHECK:       ## BB#0:
13 ; 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
19 ; CHECK-NEXT:    movl %ecx, %esi
20 ; 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