aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-15 19:08:40 +0000
committerChris Lattner <sabre@nondot.org>2010-06-15 19:08:40 +0000
commit252763fb87f6470930ba1a281563e4ef1a383f9e (patch)
treec147221059bdbb2ac4eeb9f0b0acf453ec35abe5
parent52f4ff720cb1747339abafc668550f7b4094b0fc (diff)
downloadexternal_llvm-252763fb87f6470930ba1a281563e4ef1a383f9e.zip
external_llvm-252763fb87f6470930ba1a281563e4ef1a383f9e.tar.gz
external_llvm-252763fb87f6470930ba1a281563e4ef1a383f9e.tar.bz2
fix fastisel to handle GS and FS relative pointers. Patch by
Nelson Elhage! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106031 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/X86FastISel.cpp5
-rw-r--r--test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll6
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp
index 47ee820..553e9b1 100644
--- a/lib/Target/X86/X86FastISel.cpp
+++ b/lib/Target/X86/X86FastISel.cpp
@@ -349,6 +349,11 @@ bool X86FastISel::X86SelectAddress(const Value *V, X86AddressMode &AM) {
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:
diff --git a/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll b/test/CodeGen/X86/2010-06-14-fast-isel-fs-load.ll
new file mode 100644
index 0000000..b22a391
--- /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
+}