Fix a x86-64 codegen deficiency. Allow gv + offset when using rip addressing mode.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 7 Feb 2008 08:53:49 +0000 (08:53 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 7 Feb 2008 08:53:49 +0000 (08:53 +0000)
commitbe3bf423315394f15f0c71afdaed26e5cfbcad4a
tree781ebfc62c878741f13ed48ea718b559797a9948
parent15246738f2db3f63a20c1f2b9b19b08e21acffd9
Fix a x86-64 codegen deficiency. Allow gv + offset when using rip addressing mode.
Before:
_main:
        subq    $8, %rsp
        leaq    _X(%rip), %rax
        movsd   8(%rax), %xmm1
        movss   _X(%rip), %xmm0
        call    _t
        xorl    %ecx, %ecx
        movl    %ecx, %eax
        addq    $8, %rsp
        ret
Now:
_main:
        subq    $8, %rsp
        movsd   _X+8(%rip), %xmm1
        movss   _X(%rip), %xmm0
        call    _t
        xorl    %ecx, %ecx
        movl    %ecx, %eax
        addq    $8, %rsp
        ret

Notice there is another idiotic codegen issue that needs to be fixed asap:
xorl    %ecx, %ecx
movl    %ecx, %eax

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46850 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/X86/X86Instr64bit.td
lib/Target/X86/X86InstrInfo.td
lib/Target/X86/X86Subtarget.cpp
lib/Target/X86/X86Subtarget.h
test/CodeGen/X86/pic_jumptable.ll
test/CodeGen/X86/x86-64-gv-offset.ll [new file with mode: 0644]