mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Change CopyFromReg to take and produce a chain node, allowing it to be used
with physregs that are not live across the entire block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19560 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -99,21 +99,24 @@ public:
|
|||||||
SDOperand getCopyToReg(SDOperand Chain, SDOperand N, unsigned Reg) {
|
SDOperand getCopyToReg(SDOperand Chain, SDOperand N, unsigned Reg) {
|
||||||
// Note: these are auto-CSE'd because the caller doesn't make requests that
|
// Note: these are auto-CSE'd because the caller doesn't make requests that
|
||||||
// could cause duplicates to occur.
|
// could cause duplicates to occur.
|
||||||
SDNode *NN = new RegSDNode(ISD::CopyToReg, MVT::Other, Chain, N, Reg);
|
SDNode *NN = new RegSDNode(ISD::CopyToReg, Chain, N, Reg);
|
||||||
|
NN->setValueTypes(MVT::Other);
|
||||||
AllNodes.push_back(NN);
|
AllNodes.push_back(NN);
|
||||||
return SDOperand(NN, 0);
|
return SDOperand(NN, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDOperand getCopyFromReg(unsigned Reg, MVT::ValueType VT) {
|
SDOperand getCopyFromReg(unsigned Reg, MVT::ValueType VT, SDOperand Chain) {
|
||||||
// Note: These nodes are auto-CSE'd by the caller of this method.
|
// Note: These nodes are auto-CSE'd by the caller of this method.
|
||||||
SDNode *NN = new RegSDNode(ISD::CopyFromReg, VT, Reg);
|
SDNode *NN = new RegSDNode(ISD::CopyFromReg, Chain, Reg);
|
||||||
|
NN->setValueTypes(VT, MVT::Other);
|
||||||
AllNodes.push_back(NN);
|
AllNodes.push_back(NN);
|
||||||
return SDOperand(NN, 0);
|
return SDOperand(NN, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDOperand getImplicitDef(SDOperand Chain, unsigned Reg) {
|
SDOperand getImplicitDef(SDOperand Chain, unsigned Reg) {
|
||||||
// Note: These nodes are auto-CSE'd by the caller of this method.
|
// Note: These nodes are auto-CSE'd by the caller of this method.
|
||||||
SDNode *NN = new RegSDNode(ISD::ImplicitDef, MVT::Other, Chain, Reg);
|
SDNode *NN = new RegSDNode(ISD::ImplicitDef, Chain, Reg);
|
||||||
|
NN->setValueTypes(MVT::Other);
|
||||||
AllNodes.push_back(NN);
|
AllNodes.push_back(NN);
|
||||||
return SDOperand(NN, 0);
|
return SDOperand(NN, 0);
|
||||||
}
|
}
|
||||||
|
@@ -648,19 +648,11 @@ class RegSDNode : public SDNode {
|
|||||||
unsigned Reg;
|
unsigned Reg;
|
||||||
protected:
|
protected:
|
||||||
friend class SelectionDAG;
|
friend class SelectionDAG;
|
||||||
RegSDNode(unsigned Opc, MVT::ValueType VT, SDOperand Chain,
|
RegSDNode(unsigned Opc, SDOperand Chain, SDOperand Src, unsigned reg)
|
||||||
SDOperand Src, unsigned reg)
|
|
||||||
: SDNode(Opc, Chain, Src), Reg(reg) {
|
: SDNode(Opc, Chain, Src), Reg(reg) {
|
||||||
setValueTypes(VT);
|
|
||||||
}
|
|
||||||
RegSDNode(unsigned Opc, MVT::ValueType VT, SDOperand Chain,
|
|
||||||
unsigned reg)
|
|
||||||
: SDNode(Opc, Chain), Reg(reg) {
|
|
||||||
setValueTypes(VT);
|
|
||||||
}
|
|
||||||
RegSDNode(unsigned Opc, MVT::ValueType VT, unsigned reg)
|
|
||||||
: SDNode(Opc, VT), Reg(reg) {
|
|
||||||
}
|
}
|
||||||
|
RegSDNode(unsigned Opc, SDOperand Chain, unsigned reg)
|
||||||
|
: SDNode(Opc, Chain), Reg(reg) {}
|
||||||
public:
|
public:
|
||||||
|
|
||||||
unsigned getReg() const { return Reg; }
|
unsigned getReg() const { return Reg; }
|
||||||
@@ -714,10 +706,10 @@ class MVTSDNode : public SDNode {
|
|||||||
MVT::ValueType ExtraValueType;
|
MVT::ValueType ExtraValueType;
|
||||||
protected:
|
protected:
|
||||||
friend class SelectionDAG;
|
friend class SelectionDAG;
|
||||||
MVTSDNode(unsigned Opc, MVT::ValueType VT,
|
MVTSDNode(unsigned Opc, MVT::ValueType VT1, MVT::ValueType VT2,
|
||||||
SDOperand Op0, SDOperand Op1, MVT::ValueType EVT)
|
SDOperand Op0, SDOperand Op1, MVT::ValueType EVT)
|
||||||
: SDNode(Opc, Op0, Op1), ExtraValueType(EVT) {
|
: SDNode(Opc, Op0, Op1), ExtraValueType(EVT) {
|
||||||
setValueTypes(VT);
|
setValueTypes(VT1, VT2);
|
||||||
}
|
}
|
||||||
MVTSDNode(unsigned Opc, MVT::ValueType VT,
|
MVTSDNode(unsigned Opc, MVT::ValueType VT,
|
||||||
SDOperand Op0, SDOperand Op1, SDOperand Op2, MVT::ValueType EVT)
|
SDOperand Op0, SDOperand Op1, SDOperand Op2, MVT::ValueType EVT)
|
||||||
|
Reference in New Issue
Block a user