[llvm-branch-commits] [llvm-branch] r106789 - in /llvm/branches/Apple/Morbo: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll test/CodeGen/X86/2010-06-24-g-constraint-crash.ll

Dale Johannesen dalej at apple.com
Thu Jun 24 14:00:42 PDT 2010


Author: johannes
Date: Thu Jun 24 16:00:42 2010
New Revision: 106789

URL: http://llvm.org/viewvc/llvm-project?rev=106789&view=rev
Log:
--- Merging r106779 into '.':
A    test/CodeGen/X86/2010-06-24-g-constraint-crash.ll
U    test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
U    lib/Target/X86/X86ISelLowering.cpp


Added:
    llvm/branches/Apple/Morbo/test/CodeGen/X86/2010-06-24-g-constraint-crash.ll
      - copied unchanged from r106779, llvm/trunk/test/CodeGen/X86/2010-06-24-g-constraint-crash.ll
Modified:
    llvm/branches/Apple/Morbo/lib/Target/X86/X86ISelLowering.cpp
    llvm/branches/Apple/Morbo/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll

Modified: llvm/branches/Apple/Morbo/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/Target/X86/X86ISelLowering.cpp?rev=106789&r1=106788&r2=106789&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/Target/X86/X86ISelLowering.cpp Thu Jun 24 16:00:42 2010
@@ -10377,6 +10377,13 @@
       break;
     }
 
+    // In any sort of PIC mode addresses need to be computed at runtime by
+    // adding in a register or some sort of table lookup.  These can't
+    // be used as immediates.
+    if (Subtarget->isPICStyleGOT() || Subtarget->isPICStyleStubPIC() ||
+        Subtarget->isPICStyleRIPRel())
+      return;
+
     // If we are in non-pic codegen mode, we allow the address of a global (with
     // an optional displacement) to be used with 'i'.
     GlobalAddressSDNode *GA = 0;

Modified: llvm/branches/Apple/Morbo/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll?rev=106789&r1=106788&r2=106789&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll (original)
+++ llvm/branches/Apple/Morbo/test/CodeGen/X86/2007-11-04-rip-immediate-constant.ll Thu Jun 24 16:00:42 2010
@@ -1,7 +1,7 @@
-; RUN: llc < %s -relocation-model=static | grep {foo _str$}
+; RUN: llc < %s -relocation-model=static | grep {foo str$}
 ; PR1761
 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-darwin8"
+target triple = "x86_64-pc-linux"
 @str = internal constant [12 x i8] c"init/main.c\00"		; <[12 x i8]*> [#uses=1]
 
 define i32 @unknown_bootoption() {





More information about the llvm-branch-commits mailing list