diff options
author | Dan Gohman <gohman@apple.com> | 2009-03-14 02:33:41 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-03-14 02:33:41 +0000 |
commit | 72bb0a64afe5cd9b046030591e1fce71f1fde45a (patch) | |
tree | 227b33ed291dc290aa8bcb1480f7538d51cfbb96 /test/CodeGen/X86/rip-rel-address.ll | |
parent | 9a49d31b6f94febb408b5d25d3e768c04292cf10 (diff) | |
download | llvm-72bb0a64afe5cd9b046030591e1fce71f1fde45a.tar.gz llvm-72bb0a64afe5cd9b046030591e1fce71f1fde45a.tar.bz2 llvm-72bb0a64afe5cd9b046030591e1fce71f1fde45a.tar.xz |
Use %rip-relative addressing on x86-64 whenever practical, as
it has a smaller encoding than absolute addressing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/rip-rel-address.ll')
-rw-r--r-- | test/CodeGen/X86/rip-rel-address.ll | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CodeGen/X86/rip-rel-address.ll b/test/CodeGen/X86/rip-rel-address.ll new file mode 100644 index 0000000000..2c0926a654 --- /dev/null +++ b/test/CodeGen/X86/rip-rel-address.ll @@ -0,0 +1,7 @@ +; RUN: llvm-as < %s | llc -march=x86-64 -relocation-model=static | grep {a(%rip)} + +@a = internal global double 3.4 +define double @foo() nounwind { + %a = load double* @a + ret double %a +} |