File: 0032-x86-fast-isel-fs-load.patch

package info (click to toggle)
llvm-2.7 2.7-6
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 59,992 kB
  • ctags: 49,499
  • sloc: cpp: 373,792; ansic: 16,885; sh: 12,614; asm: 6,809; ada: 3,083; ml: 2,942; python: 2,671; perl: 2,404; makefile: 1,691; pascal: 1,235; exp: 399; objc: 291; lisp: 184; csh: 117; xml: 38; f90: 36
file content (28 lines) | stat: -rw-r--r-- 828 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
 b/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll |    6 ++++++
 lib/Target/X86/X86FastISel.cpp                     |    5 +++++
 2 files changed, 11 insertions(+)

--- /dev/null
+++ b/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll
@@ -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
+}
--- a/lib/Target/X86/X86FastISel.cpp
+++ b/lib/Target/X86/X86FastISel.cpp
@@ -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: