mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-10 16:24:04 +00:00
add a new TargetFrameIndex node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23035 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
89532c7db0
commit
afb2dd43de
@ -99,6 +99,7 @@ public:
|
|||||||
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 getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
|
||||||
SDOperand getFrameIndex(int FI, MVT::ValueType VT);
|
SDOperand getFrameIndex(int FI, MVT::ValueType VT);
|
||||||
|
SDOperand getTargetFrameIndex(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);
|
||||||
SDOperand getExternalSymbol(const char *Sym, MVT::ValueType VT);
|
SDOperand getExternalSymbol(const char *Sym, MVT::ValueType VT);
|
||||||
@ -307,7 +308,7 @@ private:
|
|||||||
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;
|
||||||
std::map<int, SDNode*> FrameIndices;
|
std::map<int, SDNode*> FrameIndices, TargetFrameIndices;
|
||||||
std::map<unsigned, SDNode*> ConstantPoolIndices;
|
std::map<unsigned, SDNode*> ConstantPoolIndices;
|
||||||
std::map<MachineBasicBlock *, SDNode*> BBNodes;
|
std::map<MachineBasicBlock *, SDNode*> BBNodes;
|
||||||
std::vector<SDNode*> ValueTypeNodes;
|
std::vector<SDNode*> ValueTypeNodes;
|
||||||
|
@ -65,6 +65,7 @@ namespace ISD {
|
|||||||
// anything else with this node, and this is valid in the target-specific
|
// anything else with this node, and this is valid in the target-specific
|
||||||
// dag, turning into a GlobalAddress operand.
|
// dag, turning into a GlobalAddress operand.
|
||||||
TargetGlobalAddress,
|
TargetGlobalAddress,
|
||||||
|
TargetFrameIndex,
|
||||||
|
|
||||||
// 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.
|
||||||
@ -812,15 +813,16 @@ class FrameIndexSDNode : public SDNode {
|
|||||||
int FI;
|
int FI;
|
||||||
protected:
|
protected:
|
||||||
friend class SelectionDAG;
|
friend class SelectionDAG;
|
||||||
FrameIndexSDNode(int fi, MVT::ValueType VT)
|
FrameIndexSDNode(int fi, MVT::ValueType VT, bool isTarg)
|
||||||
: SDNode(ISD::FrameIndex, VT), FI(fi) {}
|
: SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex, VT), FI(fi) {}
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int getIndex() const { return FI; }
|
int getIndex() const { return FI; }
|
||||||
|
|
||||||
static bool classof(const FrameIndexSDNode *) { return true; }
|
static bool classof(const FrameIndexSDNode *) { return true; }
|
||||||
static bool classof(const SDNode *N) {
|
static bool classof(const SDNode *N) {
|
||||||
return N->getOpcode() == ISD::FrameIndex;
|
return N->getOpcode() == ISD::FrameIndex ||
|
||||||
|
N->getOpcode() == ISD::TargetFrameIndex;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -261,6 +261,9 @@ void SelectionDAG::RemoveNodeFromCSEMaps(SDNode *N) {
|
|||||||
case ISD::FrameIndex:
|
case ISD::FrameIndex:
|
||||||
FrameIndices.erase(cast<FrameIndexSDNode>(N)->getIndex());
|
FrameIndices.erase(cast<FrameIndexSDNode>(N)->getIndex());
|
||||||
break;
|
break;
|
||||||
|
case ISD::TargetFrameIndex:
|
||||||
|
TargetFrameIndices.erase(cast<FrameIndexSDNode>(N)->getIndex());
|
||||||
|
break;
|
||||||
case ISD::ConstantPool:
|
case ISD::ConstantPool:
|
||||||
ConstantPoolIndices.erase(cast<ConstantPoolSDNode>(N)->getIndex());
|
ConstantPoolIndices.erase(cast<ConstantPoolSDNode>(N)->getIndex());
|
||||||
break;
|
break;
|
||||||
@ -433,7 +436,15 @@ SDOperand SelectionDAG::getTargetGlobalAddress(const GlobalValue *GV,
|
|||||||
SDOperand SelectionDAG::getFrameIndex(int FI, MVT::ValueType VT) {
|
SDOperand SelectionDAG::getFrameIndex(int FI, MVT::ValueType VT) {
|
||||||
SDNode *&N = FrameIndices[FI];
|
SDNode *&N = FrameIndices[FI];
|
||||||
if (N) return SDOperand(N, 0);
|
if (N) return SDOperand(N, 0);
|
||||||
N = new FrameIndexSDNode(FI, VT);
|
N = new FrameIndexSDNode(FI, VT, false);
|
||||||
|
AllNodes.push_back(N);
|
||||||
|
return SDOperand(N, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDOperand SelectionDAG::getTargetFrameIndex(int FI, MVT::ValueType VT) {
|
||||||
|
SDNode *&N = TargetFrameIndices[FI];
|
||||||
|
if (N) return SDOperand(N, 0);
|
||||||
|
N = new FrameIndexSDNode(FI, VT, true);
|
||||||
AllNodes.push_back(N);
|
AllNodes.push_back(N);
|
||||||
return SDOperand(N, 0);
|
return SDOperand(N, 0);
|
||||||
}
|
}
|
||||||
@ -2071,6 +2082,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
|
|||||||
case ISD::GlobalAddress: return "GlobalAddress";
|
case ISD::GlobalAddress: return "GlobalAddress";
|
||||||
case ISD::TargetGlobalAddress: return "TargetGlobalAddress";
|
case ISD::TargetGlobalAddress: return "TargetGlobalAddress";
|
||||||
case ISD::FrameIndex: return "FrameIndex";
|
case ISD::FrameIndex: return "FrameIndex";
|
||||||
|
case ISD::TargetFrameIndex: return "TargetFrameIndex";
|
||||||
case ISD::BasicBlock: return "BasicBlock";
|
case ISD::BasicBlock: return "BasicBlock";
|
||||||
case ISD::Register: return "Register";
|
case ISD::Register: return "Register";
|
||||||
case ISD::ExternalSymbol: return "ExternalSymbol";
|
case ISD::ExternalSymbol: return "ExternalSymbol";
|
||||||
|
Loading…
Reference in New Issue
Block a user