diff options
author | Martin Storsjo <martin@martin.st> | 2017-12-04 09:08:55 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2017-12-04 09:08:55 +0000 |
commit | c85cc41801a8a9ae2d65c98f7ca50203d5db3811 (patch) | |
tree | 2d29a0114225743730e2de9f802807626fa1eae4 /llvm/lib | |
parent | 48c930cb1e3400d2bf8fcdf53d786e19b96bd833 (diff) | |
download | bcm5719-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')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 8 |
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) { |