Skip to content
  • Evan Cheng's avatar
    Fix a x86-64 codegen deficiency. Allow gv + offset when using rip addressing mode. · a20a7736
    Evan Cheng authored
    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
    
    llvm-svn: 46850
    a20a7736
Loading