aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86ISelLowering.cpp
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-22 22:50:52 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-22 22:50:52 +0000
commit7d2cc2b98364abc3637639ee9c10aa3ecbf6e028 (patch)
treed20cf32cc96489afa206eb2d0056b72e625b286d /lib/Target/X86/X86ISelLowering.cpp
parent032507d989163a89311847535a7e7c5d9a67229f (diff)
downloadexternal_llvm-7d2cc2b98364abc3637639ee9c10aa3ecbf6e028.zip
external_llvm-7d2cc2b98364abc3637639ee9c10aa3ecbf6e028.tar.gz
external_llvm-7d2cc2b98364abc3637639ee9c10aa3ecbf6e028.tar.bz2
X86 TLS: fix and optimize the implementation of "initial exec" model.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index ec86924..e63545d 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -2996,6 +2996,10 @@ LowerToTLSExecModel(GlobalAddressSDNode *GA, SelectionDAG &DAG,
GA->getValueType(0),
GA->getOffset());
SDOperand Offset = DAG.getNode(X86ISD::Wrapper, PtrVT, TGA);
+
+ if (GA->getGlobal()->isDeclaration()) // initial exec TLS model
+ Offset = DAG.getLoad(PtrVT, DAG.getEntryNode(), Offset, NULL, 0);
+
// The address of the thread local variable is the add of the thread
// pointer with the offset of the variable.
return DAG.getNode(ISD::ADD, PtrVT, ThreadPointer, Offset);