Nirav Dave | cd55888 | 2018-06-20 15:36:29 +0000 | [diff] [blame] | 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 | |
| 10 | define void @foo() { |
| 11 | ; CHECK-LABEL: foo: |
| 12 | ; CHECK: # %bb.0: # %entry |
| 13 | ; CHECK-NEXT: movzwl a+{{.*}}(%rip), %eax |
| 14 | ; CHECK-NEXT: movq %rax, {{.*}}(%rip) |
| 15 | ; CHECK-NEXT: retq |
| 16 | entry: |
| 17 | %0 = load i64, i64* @a, align 8 |
| 18 | %1 = load i64, i64* @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, i64* @b, align 8 |
| 24 | ret void |
| 25 | } |