mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-07 11:33:44 +00:00
ADd support for TargetGlobalAddress nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22939 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aaaa0b67dd
commit
f6b184981e
@ -97,6 +97,7 @@ public:
|
|||||||
SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT);
|
SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT);
|
||||||
SDOperand getConstantFP(double Val, MVT::ValueType VT);
|
SDOperand getConstantFP(double Val, MVT::ValueType VT);
|
||||||
SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
|
SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
|
||||||
|
SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
|
||||||
SDOperand getFrameIndex(int FI, MVT::ValueType VT);
|
SDOperand getFrameIndex(int FI, MVT::ValueType VT);
|
||||||
SDOperand getConstantPool(unsigned CPIdx, MVT::ValueType VT);
|
SDOperand getConstantPool(unsigned CPIdx, MVT::ValueType VT);
|
||||||
SDOperand getBasicBlock(MachineBasicBlock *MBB);
|
SDOperand getBasicBlock(MachineBasicBlock *MBB);
|
||||||
@ -288,6 +289,7 @@ private:
|
|||||||
SDNode *> Loads;
|
SDNode *> Loads;
|
||||||
|
|
||||||
std::map<const GlobalValue*, SDNode*> GlobalValues;
|
std::map<const GlobalValue*, SDNode*> GlobalValues;
|
||||||
|
std::map<const GlobalValue*, SDNode*> TargetGlobalValues;
|
||||||
std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> Constants;
|
std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> Constants;
|
||||||
std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> TargetConstants;
|
std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> TargetConstants;
|
||||||
std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> ConstantFPs;
|
std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> ConstantFPs;
|
||||||
|
@ -60,6 +60,11 @@ namespace ISD {
|
|||||||
// TargetConstant - Like Constant, but the DAG does not do any folding or
|
// TargetConstant - Like Constant, but the DAG does not do any folding or
|
||||||
// simplification of the constant. This is used by the DAG->DAG selector.
|
// simplification of the constant. This is used by the DAG->DAG selector.
|
||||||
TargetConstant,
|
TargetConstant,
|
||||||
|
|
||||||
|
// TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or
|
||||||
|
// anything else with this node, and this is valid in the target-specific
|
||||||
|
// dag, turning into a GlobalAddress operand.
|
||||||
|
TargetGlobalAddress,
|
||||||
|
|
||||||
// CopyToReg - This node has three operands: a chain, a register number to
|
// CopyToReg - This node has three operands: a chain, a register number to
|
||||||
// set to this value, and a value.
|
// set to this value, and a value.
|
||||||
@ -775,8 +780,8 @@ class GlobalAddressSDNode : public SDNode {
|
|||||||
GlobalValue *TheGlobal;
|
GlobalValue *TheGlobal;
|
||||||
protected:
|
protected:
|
||||||
friend class SelectionDAG;
|
friend class SelectionDAG;
|
||||||
GlobalAddressSDNode(const GlobalValue *GA, MVT::ValueType VT)
|
GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT)
|
||||||
: SDNode(ISD::GlobalAddress, VT) {
|
: SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress, VT) {
|
||||||
TheGlobal = const_cast<GlobalValue*>(GA);
|
TheGlobal = const_cast<GlobalValue*>(GA);
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
@ -785,7 +790,8 @@ public:
|
|||||||
|
|
||||||
static bool classof(const GlobalAddressSDNode *) { return true; }
|
static bool classof(const GlobalAddressSDNode *) { return true; }
|
||||||
static bool classof(const SDNode *N) {
|
static bool classof(const SDNode *N) {
|
||||||
return N->getOpcode() == ISD::GlobalAddress;
|
return N->getOpcode() == ISD::GlobalAddress ||
|
||||||
|
N->getOpcode() == ISD::TargetGlobalAddress;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user