[llvm-commits] [llvm] r170141 - in /llvm/trunk/lib/Target/PowerPC: PPC.h PPCISelLowering.cpp PPCInstr64Bit.td PPCMCInstLower.cpp
Bill Schmidt
wschmidt at linux.vnet.ibm.com
Thu Dec 13 10:45:54 PST 2012
Author: wschmidt
Date: Thu Dec 13 12:45:54 2012
New Revision: 170141
URL: http://llvm.org/viewvc/llvm-project?rev=170141&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/PowerPC/PPC.h
llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td
llvm/trunk/lib/Target/PowerPC/PPCMCInstLower.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPC.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPC.h?rev=170141&r1=170140&r2=170141&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPC.h (original)
+++ llvm/trunk/lib/Target/PowerPC/PPC.h Thu Dec 13 12:45:54 2012
@@ -72,9 +72,7 @@
MO_HA16 = 2 << 5,
MO_TPREL16_HA = 3 << 5,
- MO_TPREL16_LO = 4 << 5,
- MO_GOT_TPREL16_DS = 5 << 5,
- MO_TLS = 6 << 5
+ MO_TPREL16_LO = 4 << 5
};
} // end namespace PPCII
Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=170141&r1=170140&r2=170141&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Thu Dec 13 12:45:54 2012
@@ -1351,15 +1351,11 @@
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) {
Modified: llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td?rev=170141&r1=170140&r2=170141&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCInstr64Bit.td Thu Dec 13 12:45:54 2012
@@ -384,7 +384,7 @@
// ADD8 has a special form: reg = ADD8(reg, sym at tls) for use by the
// initial-exec thread-local storage model.
def ADD8TLS : XOForm_1<31, 266, 0, (outs G8RC:$rT), (ins G8RC:$rA, tlsreg:$rB),
- "add $rT, $rA, $rB", IntSimple,
+ "add $rT, $rA, $rB at tls", IntSimple,
[(set G8RC:$rT, (add G8RC:$rA, tglobaltlsaddr:$rB))]>;
let Defs = [CARRY] in {
Modified: llvm/trunk/lib/Target/PowerPC/PPCMCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCMCInstLower.cpp?rev=170141&r1=170140&r2=170141&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCMCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCMCInstLower.cpp Thu Dec 13 12:45:54 2012
@@ -114,12 +114,6 @@
break;
case PPCII::MO_TPREL16_LO: RefKind = MCSymbolRefExpr::VK_PPC_TPREL16_LO;
break;
- case PPCII::MO_GOT_TPREL16_DS:
- RefKind = MCSymbolRefExpr::VK_PPC_GOT_TPREL16_DS;
- break;
- case PPCII::MO_TLS:
- RefKind = MCSymbolRefExpr::VK_PPC_TLS;
- break;
}
// FIXME: This isn't right, but we don't have a good way to express this in
More information about the llvm-commits
mailing list