[llvm-commits] [llvm] r74691 - in /llvm/trunk: lib/Target/X86/X86FastISel.cpp test/CodeGen/X86/fast-isel-gv.ll

Chris Lattner sabre at nondot.org
Wed Jul 1 21:22:02 PDT 2009


Author: lattner
Date: Wed Jul  1 23:22:01 2009
New Revision: 74691

URL: http://llvm.org/viewvc/llvm-project?rev=74691&view=rev
Log:
@GOTPCREL is also rip-relative.  Fix fast-isel to do the right thing.
This fixes an llvm-gcc bootstrap problem I introduced.

Modified:
    llvm/trunk/lib/Target/X86/X86FastISel.cpp
    llvm/trunk/test/CodeGen/X86/fast-isel-gv.ll

Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=74691&r1=74690&r2=74691&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Wed Jul  1 23:22:01 2009
@@ -478,8 +478,10 @@
         Opc = X86::MOV64rm;
         RC  = X86::GR64RegisterClass;
         
-        if (TM.getRelocationModel() != Reloc::Static)
+        if (TM.getRelocationModel() != Reloc::Static) {
           StubAM.GVOpFlags = X86II::MO_GOTPCREL;
+          StubAM.Base.Reg = X86::RIP;
+        }
       }
 
       unsigned ResultReg = createResultReg(RC);

Modified: llvm/trunk/test/CodeGen/X86/fast-isel-gv.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-gv.ll?rev=74691&r1=74690&r2=74691&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/X86/fast-isel-gv.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fast-isel-gv.ll Wed Jul  1 23:22:01 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -fast-isel | grep {_kill at GOTPCREL}
+; RUN: llvm-as < %s | llc -fast-isel | grep {_kill at GOTPCREL(%rip)}
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
 target triple = "x86_64-apple-darwin10.0"
 @f = global i8 (...)* @kill		; <i8 (...)**> [#uses=1]





More information about the llvm-commits mailing list