[llvm-commits] [llvm] r106031 - in /llvm/trunk: lib/Target/X86/X86FastISel.cpp test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll

Chris Lattner sabre at nondot.org
Tue Jun 15 12:08:40 PDT 2010


Author: lattner
Date: Tue Jun 15 14:08:40 2010
New Revision: 106031

URL: http://llvm.org/viewvc/llvm-project?rev=106031&view=rev
Log:
fix fastisel to handle GS and FS relative pointers.  Patch by
Nelson Elhage!

Added:
    llvm/trunk/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll
Modified:
    llvm/trunk/lib/Target/X86/X86FastISel.cpp

Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=106031&r1=106030&r2=106031&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Tue Jun 15 14:08:40 2010
@@ -349,6 +349,11 @@
     U = C;
   }
 
+  if (const PointerType *Ty = dyn_cast<PointerType>(V->getType()))
+    if (Ty->getAddressSpace() > 255)
+      // Fast instruction selection doesn't support pointers through %fs or %gs
+      return false;
+
   switch (Opcode) {
   default: break;
   case Instruction::BitCast:

Added: llvm/trunk/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll?rev=106031&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll Tue Jun 15 14:08:40 2010
@@ -0,0 +1,6 @@
+; RUN: llc -fast-isel -march=x86 < %s | grep %fs:
+
+define i32 @test1(i32 addrspace(257)* %arg) nounwind {
+       %tmp = load i32 addrspace(257)* %arg
+       ret i32 %tmp
+}





More information about the llvm-commits mailing list