xref: /llvm-project/llvm/test/CodeGen/X86/pr37820.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o - | FileCheck %s
3
4@a = external dso_local local_unnamed_addr global i64, align 8
5@c = external dso_local local_unnamed_addr global i64, align 8
6@b = external dso_local local_unnamed_addr global i64, align 8
7
8; Should generate a 16-bit load
9
10define void @foo() {
11; CHECK-LABEL: foo:
12; CHECK:       # %bb.0: # %entry
13; CHECK-NEXT:    movzwl a+6(%rip), %eax
14; CHECK-NEXT:    movq %rax, b(%rip)
15; CHECK-NEXT:    retq
16entry:
17  %0 = load i64, ptr @a, align 8
18  %1 = load i64, ptr @c, align 8
19  %and = and i64 %1, -16384
20  %add = add nsw i64 %and, 4503359447364223024
21  %shr = lshr i64 %0, %add
22  %conv1 = and i64 %shr, 4294967295
23  store i64 %conv1, ptr @b, align 8
24  ret void
25}
26