mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
X86 TLS: Implement review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36318 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,7 +19,6 @@
|
|||||||
#ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
|
#ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
|
||||||
#define LLVM_CODEGEN_SELECTIONDAGNODES_H
|
#define LLVM_CODEGEN_SELECTIONDAGNODES_H
|
||||||
|
|
||||||
#include "llvm/GlobalVariable.h"
|
|
||||||
#include "llvm/Value.h"
|
#include "llvm/Value.h"
|
||||||
#include "llvm/ADT/FoldingSet.h"
|
#include "llvm/ADT/FoldingSet.h"
|
||||||
#include "llvm/ADT/GraphTraits.h"
|
#include "llvm/ADT/GraphTraits.h"
|
||||||
@@ -1166,16 +1165,7 @@ class GlobalAddressSDNode : public SDNode {
|
|||||||
protected:
|
protected:
|
||||||
friend class SelectionDAG;
|
friend class SelectionDAG;
|
||||||
GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
|
GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
|
||||||
int o = 0)
|
int o = 0);
|
||||||
: 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);
|
|
||||||
}
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
GlobalValue *getGlobal() const { return TheGlobal; }
|
GlobalValue *getGlobal() const { return TheGlobal; }
|
||||||
|
@@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#include "llvm/CodeGen/SelectionDAG.h"
|
#include "llvm/CodeGen/SelectionDAG.h"
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/GlobalValue.h"
|
|
||||||
#include "llvm/GlobalVariable.h"
|
#include "llvm/GlobalVariable.h"
|
||||||
#include "llvm/Intrinsics.h"
|
#include "llvm/Intrinsics.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
@@ -2573,6 +2572,17 @@ HandleSDNode::~HandleSDNode() {
|
|||||||
MorphNodeTo(ISD::HANDLENODE, VTs, 0, 0); // Drops operand uses.
|
MorphNodeTo(ISD::HANDLENODE, VTs, 0, 0); // Drops operand uses.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GlobalAddressSDNode::GlobalAddressSDNode(bool isTarget, const GlobalValue *GA,
|
||||||
|
MVT::ValueType VT, int o)
|
||||||
|
: SDNode(isa<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);
|
||||||
|
}
|
||||||
|
|
||||||
/// Profile - Gather unique data for the node.
|
/// Profile - Gather unique data for the node.
|
||||||
///
|
///
|
||||||
|
@@ -3004,8 +3004,9 @@ LowerToTLSExecModel(GlobalAddressSDNode *GA, SelectionDAG &DAG,
|
|||||||
SDOperand
|
SDOperand
|
||||||
X86TargetLowering::LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG) {
|
X86TargetLowering::LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG) {
|
||||||
// TODO: implement the "local dynamic" model
|
// TODO: implement the "local dynamic" model
|
||||||
// TODO: implement the "initial exec"model for pic executables
|
// TODO: implement the "initial exec"model for pic executables
|
||||||
assert(!Subtarget->is64Bit() && "TLS not implemented for X86_64");
|
assert(!Subtarget->is64Bit() && Subtarget->isTargetELF() &&
|
||||||
|
"TLS not implemented for non-ELF and 64-bit targets");
|
||||||
GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
|
GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(Op);
|
||||||
// If the relocation model is PIC, use the "General Dynamic" TLS Model,
|
// If the relocation model is PIC, use the "General Dynamic" TLS Model,
|
||||||
// otherwise use the "Local Exec"TLS Model
|
// otherwise use the "Local Exec"TLS Model
|
||||||
|
Reference in New Issue
Block a user