diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2012-12-13 18:45:54 +0000 |
---|---|---|
committer | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2012-12-13 18:45:54 +0000 |
commit | dfebc4cc4c267f797e823b781d73586cc6fc49c5 (patch) | |
tree | 61fefa1183e19c11bef174b68ebc499fb1d483e8 /lib/Target/PowerPC/PPCISelLowering.cpp | |
parent | 860e7cdab9d5eceda5ac52ae0ddfb4bdab0067f2 (diff) |
This is just a clean-up patch that simplifies the initial-exec TLS logic by
avoiding use of machine operand flags. No change in observable behavior, so
no new test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170141 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCISelLowering.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index 68f1bc6eae..0748bd53a8 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -1351,15 +1351,11 @@ SDValue PPCTargetLowering::LowerGlobalTLSAddress(SDValue Op, llvm_unreachable("only local-exec is currently supported for ppc32"); if (Model == TLSModel::InitialExec) { - SDValue GOTOffset = DAG.getTargetGlobalAddress(GV, dl, PtrVT, 0, - PPCII::MO_GOT_TPREL16_DS); - SDValue TPReg = DAG.getTargetGlobalAddress(GV, dl, PtrVT, 0, - PPCII::MO_TLS); - SDValue GOTReg = DAG.getRegister(is64bit ? PPC::X2 : PPC::R2, - is64bit ? MVT::i64 : MVT::i32); - SDValue TPOffset = DAG.getNode(PPCISD::LD_GOT_TPREL, dl, PtrVT, - GOTOffset, GOTReg); - return DAG.getNode(PPCISD::ADD_TLS, dl, PtrVT, TPOffset, TPReg); + SDValue TGA = DAG.getTargetGlobalAddress(GV, dl, PtrVT, 0, 0); + SDValue GOTReg = DAG.getRegister(PPC::X2, MVT::i64); + SDValue TPOffset = DAG.getNode(PPCISD::LD_GOT_TPREL, dl, + PtrVT, TGA, GOTReg); + return DAG.getNode(PPCISD::ADD_TLS, dl, PtrVT, TPOffset, TGA); } if (Model == TLSModel::GeneralDynamic) { |