llvm.org GIT mirror llvm / 2c5c111
X86 TLS: Implement review feedback. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36318 91177308-0d34-0410-b5e6-96231b3b80d8 Lauro Ramos Venancio 13 years ago
3 changed file(s) with 15 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
1818 #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
1919 #define LLVM_CODEGEN_SELECTIONDAGNODES_H
2020
21 #include "llvm/GlobalVariable.h"
2221 #include "llvm/Value.h"
2322 #include "llvm/ADT/FoldingSet.h"
2423 #include "llvm/ADT/GraphTraits.h"
11651164 protected:
11661165 friend class SelectionDAG;
11671166 GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
1168 int o = 0)
1169 : SDNode(dyn_cast(GA) &&
1170 dyn_cast(GA)->isThreadLocal() ?
1171 // Thread Local
1172 (isTarget ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress) :
1173 // Non Thread Local
1174 (isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress),
1175 getSDVTList(VT)), Offset(o) {
1176 TheGlobal = const_cast(GA);
1177 }
1167 int o = 0);
11781168 public:
11791169
11801170 GlobalValue *getGlobal() const { return TheGlobal; }
1212
1313 #include "llvm/CodeGen/SelectionDAG.h"
1414 #include "llvm/Constants.h"
15 #include "llvm/GlobalValue.h"
1615 #include "llvm/GlobalVariable.h"
1716 #include "llvm/Intrinsics.h"
1817 #include "llvm/Assembly/Writer.h"
25722571 MorphNodeTo(ISD::HANDLENODE, VTs, 0, 0); // Drops operand uses.
25732572 }
25742573
2574 GlobalAddressSDNode::GlobalAddressSDNode(bool isTarget, const GlobalValue *GA,
2575 MVT::ValueType VT, int o)
2576 : SDNode(isa(GA) &&
2577 dyn_cast(GA)->isThreadLocal() ?
2578 // Thread Local
2579 (isTarget ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress) :
2580 // Non Thread Local
2581 (isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress),
2582 getSDVTList(VT)), Offset(o) {
2583 TheGlobal = const_cast(GA);
2584 }
25752585
25762586 /// Profile - Gather unique data for the node.
25772587 ///
30033003 SDOperand
30043004 X86TargetLowering::LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG) {
30053005 // TODO: implement the "local dynamic" model
3006 // TODO: implement the "initial exec"model for pic executables
3007 assert(!Subtarget->is64Bit() && "TLS not implemented for X86_64");
3006 // TODO: implement the "initial exec"model for pic executables
3007 assert(!Subtarget->is64Bit() && Subtarget->isTargetELF() &&
3008 "TLS not implemented for non-ELF and 64-bit targets");
30083009 GlobalAddressSDNode *GA = cast(Op);
30093010 // If the relocation model is PIC, use the "General Dynamic" TLS Model,
30103011 // otherwise use the "Local Exec"TLS Model