summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMISelLowering.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-12-04 09:08:55 +0000
committerMartin Storsjo <martin@martin.st>2017-12-04 09:08:55 +0000
commitc85cc41801a8a9ae2d65c98f7ca50203d5db3811 (patch)
tree2d29a0114225743730e2de9f802807626fa1eae4 /llvm/lib/Target/ARM/ARMISelLowering.cpp
parent48c930cb1e3400d2bf8fcdf53d786e19b96bd833 (diff)
downloadbcm5719-llvm-c85cc41801a8a9ae2d65c98f7ca50203d5db3811.tar.gz
bcm5719-llvm-c85cc41801a8a9ae2d65c98f7ca50203d5db3811.zip
[ARM] Allow using emulated tls on platforms other than ELF
This matches how it is done on X86. This allows using emulated tls on windows; in MinGW environments, native tls isn't supported at the moment. Differential Revision: https://reviews.llvm.org/D40769 llvm-svn: 319643
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index cee274080b2..d9893db3773 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -2956,6 +2956,10 @@ ARMTargetLowering::LowerToTLSExecModels(GlobalAddressSDNode *GA,
SDValue
ARMTargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const {
+ GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
+ if (DAG.getTarget().Options.EmulatedTLS)
+ return LowerToTLSEmulatedModel(GA, DAG);
+
if (Subtarget->isTargetDarwin())
return LowerGlobalTLSAddressDarwin(Op, DAG);
@@ -2964,10 +2968,6 @@ ARMTargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const {
// TODO: implement the "local dynamic" model
assert(Subtarget->isTargetELF() && "Only ELF implemented here");
- GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
- if (DAG.getTarget().Options.EmulatedTLS)
- return LowerToTLSEmulatedModel(GA, DAG);
-
TLSModel::Model model = getTargetMachine().getTLSModel(GA->getGlobal());
switch (model) {
OpenPOWER on IntegriCloud