[llvm-commits] [llvm] r65341 - in /llvm/trunk: lib/Target/X86/X86FastISel.cpp test/CodeGen/X86/fast-isel-tls.ll
Dan Gohman
gohman at apple.com
Mon Feb 23 14:03:09 PST 2009
Author: djg
Date: Mon Feb 23 16:03:08 2009
New Revision: 65341
URL: http://llvm.org/viewvc/llvm-project?rev=65341&view=rev
Log:
Fast-isel can't do TLS yet, so it should fall back to SDISel
if it sees TLS addresses.
Added:
llvm/trunk/test/CodeGen/X86/fast-isel-tls.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=65341&r1=65340&r2=65341&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Mon Feb 23 16:03:08 2009
@@ -21,6 +21,7 @@
#include "X86TargetMachine.h"
#include "llvm/CallingConv.h"
#include "llvm/DerivedTypes.h"
+#include "llvm/GlobalVariable.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
#include "llvm/CodeGen/FastISel.h"
@@ -433,6 +434,11 @@
(AM.Base.Reg != 0 || AM.IndexReg != 0))
return false;
+ // Can't handle TLS yet.
+ if (GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV))
+ if (GVar->isThreadLocal())
+ return false;
+
// Set up the basic address.
AM.GV = GV;
if (!isCall &&
Added: llvm/trunk/test/CodeGen/X86/fast-isel-tls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-tls.ll?rev=65341&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fast-isel-tls.ll (added)
+++ llvm/trunk/test/CodeGen/X86/fast-isel-tls.ll Mon Feb 23 16:03:08 2009
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -relocation-model=pic -mtriple=i686-unknown-linux-gnu -fast-isel | grep __tls_get_addr
+; PR3654
+
+ at v = thread_local global i32 0
+define i32 @f() nounwind {
+entry:
+ %t = load i32* @v
+ %s = add i32 %t, 1
+ ret i32 %s
+}
More information about the llvm-commits
mailing list