diff options
Diffstat (limited to 'test/CodeGen/X86/fast-isel-fold-mem.ll')
-rw-r--r-- | test/CodeGen/X86/fast-isel-fold-mem.ll | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fast-isel-fold-mem.ll b/test/CodeGen/X86/fast-isel-fold-mem.ll new file mode 100644 index 0000000..a945779 --- /dev/null +++ b/test/CodeGen/X86/fast-isel-fold-mem.ll @@ -0,0 +1,12 @@ +; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s +; RUN: llc < %s -fast-isel -fast-isel-abort -mtriple=x86_64-apple-darwin | FileCheck %s + +define i64 @fold_load(i64* %a, i64 %b) { +; CHECK-LABEL: fold_load +; CHECK: addq (%rdi), %rsi +; CHECK-NEXT: movq %rsi, %rax + %1 = load i64* %a, align 8 + %2 = add i64 %1, %b + ret i64 %2 +} + |