Skip to content

Commit 09d73c0

Browse files
committed
Assert when TLS is not implemented.
llvm-svn: 39737
1 parent 03b2749 commit 09d73c0

File tree

6 files changed

+27
-0
lines changed

6 files changed

+27
-0
lines changed

llvm/lib/Target/Alpha/AlphaISelLowering.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ AlphaTargetLowering::AlphaTargetLowering(TargetMachine &TM) : TargetLowering(TM)
122122
setOperationAction(ISD::GlobalAddress, MVT::i64, Custom);
123123
setOperationAction(ISD::ConstantPool, MVT::i64, Custom);
124124
setOperationAction(ISD::ExternalSymbol, MVT::i64, Custom);
125+
setOperationAction(ISD::GlobalTLSAddress, MVT::i64, Custom);
125126

126127
setOperationAction(ISD::VASTART, MVT::Other, Custom);
127128
setOperationAction(ISD::VAEND, MVT::Other, Expand);
@@ -424,6 +425,8 @@ SDOperand AlphaTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
424425
SDOperand Lo = DAG.getNode(AlphaISD::GPRelLo, MVT::i64, CPI, Hi);
425426
return Lo;
426427
}
428+
case ISD::GlobalTLSAddress:
429+
assert(0 && "TLS not implemented for Alpha.");
427430
case ISD::GlobalAddress: {
428431
GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op);
429432
GlobalValue *GV = GSDN->getGlobal();

llvm/lib/Target/IA64/IA64ISelLowering.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ IA64TargetLowering::IA64TargetLowering(TargetMachine &TM)
108108
setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
109109
setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64, Expand);
110110

111+
// Thread Local Storage
112+
setOperationAction(ISD::GlobalTLSAddress, MVT::i64, Custom);
113+
111114
setStackPointerRegisterToSaveRestore(IA64::r12);
112115

113116
setJumpBufSize(704); // on ia64-linux, jmp_bufs are 704 bytes..
@@ -538,6 +541,8 @@ SDOperand IA64TargetLowering::
538541
LowerOperation(SDOperand Op, SelectionDAG &DAG) {
539542
switch (Op.getOpcode()) {
540543
default: assert(0 && "Should not custom lower this!");
544+
case ISD::GlobalTLSAddress:
545+
assert(0 && "TLS not implemented for IA64.");
541546
case ISD::RET: {
542547
SDOperand AR_PFSVal, Copy;
543548

llvm/lib/Target/Mips/MipsISelLowering.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ MipsTargetLowering(MipsTargetMachine &TM): TargetLowering(TM)
5959

6060
// Custom
6161
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
62+
setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
6263
setOperationAction(ISD::RET, MVT::Other, Custom);
6364

6465
// Load extented operations for i1 types must be promoted
@@ -115,6 +116,7 @@ LowerOperation(SDOperand Op, SelectionDAG &DAG)
115116
case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG);
116117
case ISD::RET: return LowerRET(Op, DAG);
117118
case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
119+
case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
118120
case ISD::RETURNADDR: return LowerRETURNADDR(Op, DAG);
119121
}
120122
return SDOperand();
@@ -162,6 +164,12 @@ LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG)
162164
return DAG.getNode(ISD::ADD, MVT::i32, Lo, Hi);
163165
}
164166

167+
SDOperand MipsTargetLowering::
168+
LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG)
169+
{
170+
assert(0 && "TLS not implemented for MIPS.");
171+
}
172+
165173
SDOperand MipsTargetLowering::
166174
LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG) {
167175
// Depths > 0 not supported yet!

llvm/lib/Target/Mips/MipsISelLowering.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ namespace llvm {
7575
SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG);
7676
SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG);
7777
SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG);
78+
SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG);
7879
SDOperand LowerRETURNADDR(SDOperand Op, SelectionDAG &DAG);
7980

8081
};

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,11 @@ PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM)
159159
// We want to legalize GlobalAddress and ConstantPool nodes into the
160160
// appropriate instructions to materialize the address.
161161
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
162+
setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
162163
setOperationAction(ISD::ConstantPool, MVT::i32, Custom);
163164
setOperationAction(ISD::JumpTable, MVT::i32, Custom);
164165
setOperationAction(ISD::GlobalAddress, MVT::i64, Custom);
166+
setOperationAction(ISD::GlobalTLSAddress, MVT::i64, Custom);
165167
setOperationAction(ISD::ConstantPool, MVT::i64, Custom);
166168
setOperationAction(ISD::JumpTable, MVT::i64, Custom);
167169

@@ -1014,6 +1016,10 @@ static SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG) {
10141016
return Lo;
10151017
}
10161018

1019+
static SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG) {
1020+
assert(0 && "TLS not implemented for PPC.");
1021+
}
1022+
10171023
static SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) {
10181024
MVT::ValueType PtrVT = Op.getValueType();
10191025
GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op);
@@ -2862,6 +2868,7 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {
28622868
default: assert(0 && "Wasn't expecting to be able to lower this!");
28632869
case ISD::ConstantPool: return LowerConstantPool(Op, DAG);
28642870
case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
2871+
case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
28652872
case ISD::JumpTable: return LowerJumpTable(Op, DAG);
28662873
case ISD::SETCC: return LowerSETCC(Op, DAG);
28672874
case ISD::VASTART:

llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ SparcTargetLowering::SparcTargetLowering(TargetMachine &TM)
141141

142142
// Custom legalize GlobalAddress nodes into LO/HI parts.
143143
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
144+
setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
144145
setOperationAction(ISD::ConstantPool , MVT::i32, Custom);
145146

146147
// Sparc doesn't have sext_inreg, replace them with shl/sra
@@ -700,6 +701,8 @@ SDOperand SparcTargetLowering::
700701
LowerOperation(SDOperand Op, SelectionDAG &DAG) {
701702
switch (Op.getOpcode()) {
702703
default: assert(0 && "Should not custom lower this!");
704+
case ISD::GlobalTLSAddress:
705+
assert(0 && "TLS not implemented for Sparc.");
703706
case ISD::GlobalAddress: {
704707
GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
705708
SDOperand GA = DAG.getTargetGlobalAddress(GV, MVT::i32);

0 commit comments

Comments
 (0)