aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-20 21:38:10 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-20 21:38:10 +0000
commitb3a0417cad8b625acc3033bd5e24afb9ffd0b084 (patch)
treec691c028e9aa107d0cd0b091af7858a7f040b445 /include/llvm
parente3e31c22bf7ebed9e8e00ede4f4aa87ce2225528 (diff)
downloadexternal_llvm-b3a0417cad8b625acc3033bd5e24afb9ffd0b084.zip
external_llvm-b3a0417cad8b625acc3033bd5e24afb9ffd0b084.tar.gz
external_llvm-b3a0417cad8b625acc3033bd5e24afb9ffd0b084.tar.bz2
Implement "general dynamic", "initial exec" and "local exec" TLS models for
X86 32 bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36283 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h3
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h17
-rw-r--r--include/llvm/Target/TargetAsmInfo.h16
3 files changed, 31 insertions, 5 deletions
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index 253d574..0f17e69 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -398,6 +398,9 @@ public:
SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
MVT::ValueType VT2, MVT::ValueType VT3,
SDOperand Op1, SDOperand Op2);
+ SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, MVT::ValueType VT3,
+ SDOperand Op1, SDOperand Op2, SDOperand Op3);
SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
MVT::ValueType VT2, MVT::ValueType VT3,
const SDOperand *Ops, unsigned NumOps);
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 74f405f..77d607a 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -19,6 +19,7 @@
#ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
#define LLVM_CODEGEN_SELECTIONDAGNODES_H
+#include "llvm/GlobalVariable.h"
#include "llvm/Value.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/GraphTraits.h"
@@ -95,7 +96,8 @@ namespace ISD {
// Various leaf nodes.
STRING, BasicBlock, VALUETYPE, CONDCODE, Register,
Constant, ConstantFP,
- GlobalAddress, FrameIndex, JumpTable, ConstantPool, ExternalSymbol,
+ GlobalAddress, GlobalTLSAddress, FrameIndex,
+ JumpTable, ConstantPool, ExternalSymbol,
// The address of the GOT
GLOBAL_OFFSET_TABLE,
@@ -124,6 +126,7 @@ namespace ISD {
// anything else with this node, and this is valid in the target-specific
// dag, turning into a GlobalAddress operand.
TargetGlobalAddress,
+ TargetGlobalTLSAddress,
TargetFrameIndex,
TargetJumpTable,
TargetConstantPool,
@@ -1164,7 +1167,12 @@ protected:
friend class SelectionDAG;
GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
int o = 0)
- : SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress,
+ : SDNode(dyn_cast<GlobalVariable>(GA) &&
+ dyn_cast<GlobalVariable>(GA)->isThreadLocal() ?
+ // Thread Local
+ (isTarget ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress) :
+ // Non Thread Local
+ (isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress),
getSDVTList(VT)), Offset(o) {
TheGlobal = const_cast<GlobalValue*>(GA);
}
@@ -1176,11 +1184,12 @@ public:
static bool classof(const GlobalAddressSDNode *) { return true; }
static bool classof(const SDNode *N) {
return N->getOpcode() == ISD::GlobalAddress ||
- N->getOpcode() == ISD::TargetGlobalAddress;
+ N->getOpcode() == ISD::TargetGlobalAddress ||
+ N->getOpcode() == ISD::GlobalTLSAddress ||
+ N->getOpcode() == ISD::TargetGlobalTLSAddress;
}
};
-
class FrameIndexSDNode : public SDNode {
int FI;
virtual void ANCHOR(); // Out-of-line virtual method to give class a home.
diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h
index 04f9118..60de430 100644
--- a/include/llvm/Target/TargetAsmInfo.h
+++ b/include/llvm/Target/TargetAsmInfo.h
@@ -43,7 +43,15 @@ namespace llvm {
/// target doesn't support a BSS section.
///
const char *BSSSection; // Default to ".bss".
-
+
+ /// TLSDataSection - Section directive for Thread Local data.
+ ///
+ const char *TLSDataSection;// Defaults to ".section .tdata,"awT",@progbits".
+
+ /// TLSBSSSection - Section directive for Thread Local uninitialized data.
+ /// Null if this target doesn't support a BSS section.
+ ///
+ const char *TLSBSSSection;// Default to ".section .tbss,"awT",@nobits".
/// ZeroFillDirective - Directive for emitting a global to the ZeroFill
/// section on this target. Null if this target doesn't support zerofill.
const char *ZeroFillDirective; // Default is null.
@@ -362,6 +370,12 @@ namespace llvm {
const char *getBSSSection() const {
return BSSSection;
}
+ const char *getTLSDataSection() const {
+ return TLSDataSection;
+ }
+ const char *getTLSBSSSection() const {
+ return TLSBSSSection;
+ }
const char *getZeroFillDirective() const {
return ZeroFillDirective;
}