mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Add a new getNode() method that takes a pointer to an already-intern'd list
of value-type nodes. This avoids having to do mallocs for std::vectors of valuetypes when a node returns more than one type. llvm-svn: 29685
This commit is contained in:
parent
91349ea154
commit
8e8d9a3358
@ -155,29 +155,23 @@ public:
|
|||||||
// null) and that there should be a flag result.
|
// null) and that there should be a flag result.
|
||||||
SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N,
|
SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N,
|
||||||
SDOperand Flag) {
|
SDOperand Flag) {
|
||||||
std::vector<MVT::ValueType> VTs;
|
const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
|
||||||
VTs.push_back(MVT::Other);
|
|
||||||
VTs.push_back(MVT::Flag);
|
|
||||||
SDOperand Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag };
|
SDOperand Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag };
|
||||||
return getNode(ISD::CopyToReg, VTs, Ops, Flag.Val ? 4 : 3);
|
return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Similar to last getCopyToReg() except parameter Reg is a SDOperand
|
// Similar to last getCopyToReg() except parameter Reg is a SDOperand
|
||||||
SDOperand getCopyToReg(SDOperand Chain, SDOperand Reg, SDOperand N,
|
SDOperand getCopyToReg(SDOperand Chain, SDOperand Reg, SDOperand N,
|
||||||
SDOperand Flag) {
|
SDOperand Flag) {
|
||||||
std::vector<MVT::ValueType> VTs;
|
const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
|
||||||
VTs.push_back(MVT::Other);
|
|
||||||
VTs.push_back(MVT::Flag);
|
|
||||||
SDOperand Ops[] = { Chain, Reg, N, Flag };
|
SDOperand Ops[] = { Chain, Reg, N, Flag };
|
||||||
return getNode(ISD::CopyToReg, VTs, Ops, Flag.Val ? 4 : 3);
|
return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT) {
|
SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other);
|
||||||
ResultTys.push_back(VT);
|
|
||||||
ResultTys.push_back(MVT::Other);
|
|
||||||
SDOperand Ops[] = { Chain, getRegister(Reg, VT) };
|
SDOperand Ops[] = { Chain, getRegister(Reg, VT) };
|
||||||
return getNode(ISD::CopyFromReg, ResultTys, Ops, 2);
|
return getNode(ISD::CopyFromReg, VTs, 2, Ops, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This version of the getCopyFromReg method takes an extra operand, which
|
// This version of the getCopyFromReg method takes an extra operand, which
|
||||||
@ -185,12 +179,9 @@ public:
|
|||||||
// null) and that there should be a flag result.
|
// null) and that there should be a flag result.
|
||||||
SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT,
|
SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT,
|
||||||
SDOperand Flag) {
|
SDOperand Flag) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other, MVT::Flag);
|
||||||
ResultTys.push_back(VT);
|
|
||||||
ResultTys.push_back(MVT::Other);
|
|
||||||
ResultTys.push_back(MVT::Flag);
|
|
||||||
SDOperand Ops[] = { Chain, getRegister(Reg, VT), Flag };
|
SDOperand Ops[] = { Chain, getRegister(Reg, VT), Flag };
|
||||||
return getNode(ISD::CopyFromReg, ResultTys, Ops, Flag.Val ? 3 : 2);
|
return getNode(ISD::CopyFromReg, VTs, 3, Ops, Flag.Val ? 3 : 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDOperand getCondCode(ISD::CondCode Cond);
|
SDOperand getCondCode(ISD::CondCode Cond);
|
||||||
@ -202,11 +193,9 @@ public:
|
|||||||
/// getCALLSEQ_START - Return a new CALLSEQ_START node, which always must have
|
/// getCALLSEQ_START - Return a new CALLSEQ_START node, which always must have
|
||||||
/// a flag result (to ensure it's not CSE'd).
|
/// a flag result (to ensure it's not CSE'd).
|
||||||
SDOperand getCALLSEQ_START(SDOperand Chain, SDOperand Op) {
|
SDOperand getCALLSEQ_START(SDOperand Chain, SDOperand Op) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
|
||||||
ResultTys.push_back(MVT::Other);
|
|
||||||
ResultTys.push_back(MVT::Flag);
|
|
||||||
SDOperand Ops[] = { Chain, Op };
|
SDOperand Ops[] = { Chain, Op };
|
||||||
return getNode(ISD::CALLSEQ_START, ResultTys, Ops, 2);
|
return getNode(ISD::CALLSEQ_START, VTs, 2, Ops, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getNode - Gets or creates the specified node.
|
/// getNode - Gets or creates the specified node.
|
||||||
@ -226,6 +215,8 @@ public:
|
|||||||
const SDOperand *Ops, unsigned NumOps);
|
const SDOperand *Ops, unsigned NumOps);
|
||||||
SDOperand getNode(unsigned Opcode, std::vector<MVT::ValueType> &ResultTys,
|
SDOperand getNode(unsigned Opcode, std::vector<MVT::ValueType> &ResultTys,
|
||||||
const SDOperand *Ops, unsigned NumOps);
|
const SDOperand *Ops, unsigned NumOps);
|
||||||
|
SDOperand getNode(unsigned Opcode, const MVT::ValueType *VTs, unsigned NumVTs,
|
||||||
|
const SDOperand *Ops, unsigned NumOps);
|
||||||
|
|
||||||
/// getSetCC - Helper function to make it easier to build SetCC's if you just
|
/// getSetCC - Helper function to make it easier to build SetCC's if you just
|
||||||
/// have an ISD::CondCode instead of an SDOperand.
|
/// have an ISD::CondCode instead of an SDOperand.
|
||||||
@ -240,8 +231,8 @@ public:
|
|||||||
///
|
///
|
||||||
SDOperand getSelectCC(SDOperand LHS, SDOperand RHS,
|
SDOperand getSelectCC(SDOperand LHS, SDOperand RHS,
|
||||||
SDOperand True, SDOperand False, ISD::CondCode Cond) {
|
SDOperand True, SDOperand False, ISD::CondCode Cond) {
|
||||||
MVT::ValueType VT = True.getValueType();
|
return getNode(ISD::SELECT_CC, True.getValueType(), LHS, RHS, True, False,
|
||||||
return getNode(ISD::SELECT_CC, VT, LHS, RHS, True, False,getCondCode(Cond));
|
getCondCode(Cond));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getVAArg - VAArg produces a result and token chain, and takes a pointer
|
/// getVAArg - VAArg produces a result and token chain, and takes a pointer
|
||||||
@ -443,6 +434,8 @@ private:
|
|||||||
void DeleteNodeNotInCSEMaps(SDNode *N);
|
void DeleteNodeNotInCSEMaps(SDNode *N);
|
||||||
MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1);
|
MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1);
|
||||||
MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2);
|
MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2);
|
||||||
|
MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2,
|
||||||
|
MVT::ValueType VT3);
|
||||||
MVT::ValueType *getNodeValueTypes(std::vector<MVT::ValueType> &RetVals);
|
MVT::ValueType *getNodeValueTypes(std::vector<MVT::ValueType> &RetVals);
|
||||||
|
|
||||||
|
|
||||||
|
@ -697,7 +697,7 @@ class SDNode {
|
|||||||
|
|
||||||
/// ValueList - The types of the values this node defines. SDNode's may
|
/// ValueList - The types of the values this node defines. SDNode's may
|
||||||
/// define multiple values simultaneously.
|
/// define multiple values simultaneously.
|
||||||
MVT::ValueType *ValueList;
|
const MVT::ValueType *ValueList;
|
||||||
|
|
||||||
/// NumOperands/NumValues - The number of entries in the Operand/Value list.
|
/// NumOperands/NumValues - The number of entries in the Operand/Value list.
|
||||||
unsigned short NumOperands, NumValues;
|
unsigned short NumOperands, NumValues;
|
||||||
@ -899,7 +899,7 @@ protected:
|
|||||||
NumOperands = 0;
|
NumOperands = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setValueTypes(MVT::ValueType *List, unsigned NumVal) {
|
void setValueTypes(const MVT::ValueType *List, unsigned NumVal) {
|
||||||
assert(NumValues == 0 && "Should not have values yet!");
|
assert(NumValues == 0 && "Should not have values yet!");
|
||||||
ValueList = List;
|
ValueList = List;
|
||||||
NumValues = NumVal;
|
NumValues = NumVal;
|
||||||
|
@ -1454,30 +1454,26 @@ SDOperand SelectionDAG::getVecLoad(unsigned Count, MVT::ValueType EVT,
|
|||||||
SDOperand SV) {
|
SDOperand SV) {
|
||||||
SDOperand Ops[] = { Chain, Ptr, SV, getConstant(Count, MVT::i32),
|
SDOperand Ops[] = { Chain, Ptr, SV, getConstant(Count, MVT::i32),
|
||||||
getValueType(EVT) };
|
getValueType(EVT) };
|
||||||
std::vector<MVT::ValueType> VTs;
|
// Add token chain.
|
||||||
VTs.reserve(2);
|
MVT::ValueType *VTs = getNodeValueTypes(MVT::Vector, MVT::Other);
|
||||||
VTs.push_back(MVT::Vector); VTs.push_back(MVT::Other); // Add token chain.
|
return getNode(ISD::VLOAD, VTs, 2, Ops, 5);
|
||||||
return getNode(ISD::VLOAD, VTs, Ops, 5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SDOperand SelectionDAG::getExtLoad(unsigned Opcode, MVT::ValueType VT,
|
SDOperand SelectionDAG::getExtLoad(unsigned Opcode, MVT::ValueType VT,
|
||||||
SDOperand Chain, SDOperand Ptr, SDOperand SV,
|
SDOperand Chain, SDOperand Ptr, SDOperand SV,
|
||||||
MVT::ValueType EVT) {
|
MVT::ValueType EVT) {
|
||||||
SDOperand Ops[] = { Chain, Ptr, SV, getValueType(EVT) };
|
SDOperand Ops[] = { Chain, Ptr, SV, getValueType(EVT) };
|
||||||
std::vector<MVT::ValueType> VTs;
|
MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other);
|
||||||
VTs.reserve(2);
|
return getNode(Opcode, VTs, 2, Ops, 4);
|
||||||
VTs.push_back(VT); VTs.push_back(MVT::Other); // Add token chain.
|
|
||||||
return getNode(Opcode, VTs, Ops, 4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SDOperand SelectionDAG::getVAArg(MVT::ValueType VT,
|
SDOperand SelectionDAG::getVAArg(MVT::ValueType VT,
|
||||||
SDOperand Chain, SDOperand Ptr,
|
SDOperand Chain, SDOperand Ptr,
|
||||||
SDOperand SV) {
|
SDOperand SV) {
|
||||||
SDOperand Ops[] = { Chain, Ptr, SV };
|
SDOperand Ops[] = { Chain, Ptr, SV };
|
||||||
std::vector<MVT::ValueType> VTs;
|
// Add token chain.
|
||||||
VTs.reserve(2);
|
MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other);
|
||||||
VTs.push_back(VT); VTs.push_back(MVT::Other); // Add token chain.
|
return getNode(ISD::VAARG, VTs, 2, Ops, 3);
|
||||||
return getNode(ISD::VAARG, VTs, Ops, 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
|
SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
|
||||||
@ -1552,29 +1548,36 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
|
|||||||
SDOperand SelectionDAG::getNode(unsigned Opcode,
|
SDOperand SelectionDAG::getNode(unsigned Opcode,
|
||||||
std::vector<MVT::ValueType> &ResultTys,
|
std::vector<MVT::ValueType> &ResultTys,
|
||||||
const SDOperand *Ops, unsigned NumOps) {
|
const SDOperand *Ops, unsigned NumOps) {
|
||||||
if (ResultTys.size() == 1)
|
return getNode(Opcode, getNodeValueTypes(ResultTys), ResultTys.size(),
|
||||||
return getNode(Opcode, ResultTys[0], Ops, NumOps);
|
Ops, NumOps);
|
||||||
|
}
|
||||||
|
|
||||||
|
SDOperand SelectionDAG::getNode(unsigned Opcode,
|
||||||
|
const MVT::ValueType *VTs, unsigned NumVTs,
|
||||||
|
const SDOperand *Ops, unsigned NumOps) {
|
||||||
|
if (NumVTs == 1)
|
||||||
|
return getNode(Opcode, VTs[0], Ops, NumOps);
|
||||||
|
|
||||||
switch (Opcode) {
|
switch (Opcode) {
|
||||||
case ISD::EXTLOAD:
|
case ISD::EXTLOAD:
|
||||||
case ISD::SEXTLOAD:
|
case ISD::SEXTLOAD:
|
||||||
case ISD::ZEXTLOAD: {
|
case ISD::ZEXTLOAD: {
|
||||||
MVT::ValueType EVT = cast<VTSDNode>(Ops[3])->getVT();
|
MVT::ValueType EVT = cast<VTSDNode>(Ops[3])->getVT();
|
||||||
assert(NumOps == 4 && ResultTys.size() == 2 && "Bad *EXTLOAD!");
|
assert(NumOps == 4 && NumVTs == 2 && "Bad *EXTLOAD!");
|
||||||
// If they are asking for an extending load from/to the same thing, return a
|
// If they are asking for an extending load from/to the same thing, return a
|
||||||
// normal load.
|
// normal load.
|
||||||
if (ResultTys[0] == EVT)
|
if (VTs[0] == EVT)
|
||||||
return getLoad(ResultTys[0], Ops[0], Ops[1], Ops[2]);
|
return getLoad(VTs[0], Ops[0], Ops[1], Ops[2]);
|
||||||
if (MVT::isVector(ResultTys[0])) {
|
if (MVT::isVector(VTs[0])) {
|
||||||
assert(EVT == MVT::getVectorBaseType(ResultTys[0]) &&
|
assert(EVT == MVT::getVectorBaseType(VTs[0]) &&
|
||||||
"Invalid vector extload!");
|
"Invalid vector extload!");
|
||||||
} else {
|
} else {
|
||||||
assert(EVT < ResultTys[0] &&
|
assert(EVT < VTs[0] &&
|
||||||
"Should only be an extending load, not truncating!");
|
"Should only be an extending load, not truncating!");
|
||||||
}
|
}
|
||||||
assert((Opcode == ISD::EXTLOAD || MVT::isInteger(ResultTys[0])) &&
|
assert((Opcode == ISD::EXTLOAD || MVT::isInteger(VTs[0])) &&
|
||||||
"Cannot sign/zero extend a FP/Vector load!");
|
"Cannot sign/zero extend a FP/Vector load!");
|
||||||
assert(MVT::isInteger(ResultTys[0]) == MVT::isInteger(EVT) &&
|
assert(MVT::isInteger(VTs[0]) == MVT::isInteger(EVT) &&
|
||||||
"Cannot convert from FP to Int or Int -> FP!");
|
"Cannot convert from FP to Int or Int -> FP!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1603,8 +1606,7 @@ SDOperand SelectionDAG::getNode(unsigned Opcode,
|
|||||||
|
|
||||||
// Memoize the node unless it returns a flag.
|
// Memoize the node unless it returns a flag.
|
||||||
SDNode *N;
|
SDNode *N;
|
||||||
MVT::ValueType *VTs = getNodeValueTypes(ResultTys);
|
if (VTs[NumVTs-1] != MVT::Flag) {
|
||||||
if (ResultTys.back() != MVT::Flag) {
|
|
||||||
SelectionDAGCSEMap::NodeID ID;
|
SelectionDAGCSEMap::NodeID ID;
|
||||||
ID.SetOpcode(Opcode);
|
ID.SetOpcode(Opcode);
|
||||||
ID.SetValueTypes(VTs);
|
ID.SetValueTypes(VTs);
|
||||||
@ -1613,11 +1615,11 @@ SDOperand SelectionDAG::getNode(unsigned Opcode,
|
|||||||
if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
|
if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
|
||||||
return SDOperand(E, 0);
|
return SDOperand(E, 0);
|
||||||
N = new SDNode(Opcode, Ops, NumOps);
|
N = new SDNode(Opcode, Ops, NumOps);
|
||||||
N->setValueTypes(VTs, ResultTys.size());
|
N->setValueTypes(VTs, NumVTs);
|
||||||
CSEMap.InsertNode(N, IP);
|
CSEMap.InsertNode(N, IP);
|
||||||
} else {
|
} else {
|
||||||
N = new SDNode(Opcode, Ops, NumOps);
|
N = new SDNode(Opcode, Ops, NumOps);
|
||||||
N->setValueTypes(VTs, ResultTys.size());
|
N->setValueTypes(VTs, NumVTs);
|
||||||
}
|
}
|
||||||
AllNodes.push_back(N);
|
AllNodes.push_back(N);
|
||||||
return SDOperand(N, 0);
|
return SDOperand(N, 0);
|
||||||
@ -1661,6 +1663,24 @@ MVT::ValueType *SelectionDAG::getNodeValueTypes(MVT::ValueType VT1,
|
|||||||
return &(*VTList.begin())[0];
|
return &(*VTList.begin())[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MVT::ValueType *SelectionDAG::getNodeValueTypes(MVT::ValueType VT1,
|
||||||
|
MVT::ValueType VT2,
|
||||||
|
MVT::ValueType VT3) {
|
||||||
|
for (std::list<std::vector<MVT::ValueType> >::iterator I = VTList.begin(),
|
||||||
|
E = VTList.end(); I != E; ++I) {
|
||||||
|
if (I->size() == 3 && (*I)[0] == VT1 && (*I)[1] == VT2 &&
|
||||||
|
(*I)[2] == VT3)
|
||||||
|
return &(*I)[0];
|
||||||
|
}
|
||||||
|
std::vector<MVT::ValueType> V;
|
||||||
|
V.push_back(VT1);
|
||||||
|
V.push_back(VT2);
|
||||||
|
V.push_back(VT3);
|
||||||
|
VTList.push_front(V);
|
||||||
|
return &(*VTList.begin())[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// UpdateNodeOperands - *Mutate* the specified node in-place to have the
|
/// UpdateNodeOperands - *Mutate* the specified node in-place to have the
|
||||||
/// specified operands. If the resultant node already exists in the DAG,
|
/// specified operands. If the resultant node already exists in the DAG,
|
||||||
/// this does not modify the specified node, instead it returns the node that
|
/// this does not modify the specified node, instead it returns the node that
|
||||||
@ -2151,123 +2171,95 @@ SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
|
|||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, SDOperand Op1) {
|
MVT::ValueType VT2, SDOperand Op1) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
|
||||||
ResultTys.push_back(VT1);
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, &Op1, 1).Val;
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, &Op1, 1).Val;
|
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, SDOperand Op1,
|
MVT::ValueType VT2, SDOperand Op1,
|
||||||
SDOperand Op2) {
|
SDOperand Op2) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
|
||||||
ResultTys.push_back(VT1);
|
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
SDOperand Ops[] = { Op1, Op2 };
|
SDOperand Ops[] = { Op1, Op2 };
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 2).Val;
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 2).Val;
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, SDOperand Op1,
|
MVT::ValueType VT2, SDOperand Op1,
|
||||||
SDOperand Op2, SDOperand Op3) {
|
SDOperand Op2, SDOperand Op3) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
|
||||||
ResultTys.push_back(VT1);
|
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
SDOperand Ops[] = { Op1, Op2, Op3 };
|
SDOperand Ops[] = { Op1, Op2, Op3 };
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 3).Val;
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 3).Val;
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, SDOperand Op1,
|
MVT::ValueType VT2, SDOperand Op1,
|
||||||
SDOperand Op2, SDOperand Op3,
|
SDOperand Op2, SDOperand Op3,
|
||||||
SDOperand Op4) {
|
SDOperand Op4) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
|
||||||
ResultTys.push_back(VT1);
|
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
SDOperand Ops[] = { Op1, Op2, Op3, Op4 };
|
SDOperand Ops[] = { Op1, Op2, Op3, Op4 };
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 4).Val;
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 4).Val;
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, SDOperand Op1,
|
MVT::ValueType VT2, SDOperand Op1,
|
||||||
SDOperand Op2, SDOperand Op3, SDOperand Op4,
|
SDOperand Op2, SDOperand Op3, SDOperand Op4,
|
||||||
SDOperand Op5) {
|
SDOperand Op5) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
|
||||||
ResultTys.push_back(VT1);
|
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 };
|
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 };
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 5).Val;
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 5).Val;
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, SDOperand Op1,
|
MVT::ValueType VT2, SDOperand Op1,
|
||||||
SDOperand Op2, SDOperand Op3, SDOperand Op4,
|
SDOperand Op2, SDOperand Op3, SDOperand Op4,
|
||||||
SDOperand Op5, SDOperand Op6) {
|
SDOperand Op5, SDOperand Op6) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
|
||||||
ResultTys.push_back(VT1);
|
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 };
|
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 };
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 6).Val;
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 6).Val;
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, SDOperand Op1,
|
MVT::ValueType VT2, SDOperand Op1,
|
||||||
SDOperand Op2, SDOperand Op3, SDOperand Op4,
|
SDOperand Op2, SDOperand Op3, SDOperand Op4,
|
||||||
SDOperand Op5, SDOperand Op6,
|
SDOperand Op5, SDOperand Op6,
|
||||||
SDOperand Op7) {
|
SDOperand Op7) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
|
||||||
ResultTys.push_back(VT1);
|
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 };
|
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 };
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 7).Val;
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 7).Val;
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, MVT::ValueType VT3,
|
MVT::ValueType VT2, MVT::ValueType VT3,
|
||||||
SDOperand Op1, SDOperand Op2) {
|
SDOperand Op1, SDOperand Op2) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3);
|
||||||
ResultTys.push_back(VT1);
|
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
ResultTys.push_back(VT3);
|
|
||||||
SDOperand Ops[] = { Op1, Op2 };
|
SDOperand Ops[] = { Op1, Op2 };
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 2).Val;
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 2).Val;
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, MVT::ValueType VT3,
|
MVT::ValueType VT2, MVT::ValueType VT3,
|
||||||
SDOperand Op1, SDOperand Op2,
|
SDOperand Op1, SDOperand Op2,
|
||||||
SDOperand Op3, SDOperand Op4,
|
SDOperand Op3, SDOperand Op4,
|
||||||
SDOperand Op5) {
|
SDOperand Op5) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3);
|
||||||
ResultTys.push_back(VT1);
|
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
ResultTys.push_back(VT3);
|
|
||||||
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 };
|
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 };
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 5).Val;
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 5).Val;
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, MVT::ValueType VT3,
|
MVT::ValueType VT2, MVT::ValueType VT3,
|
||||||
SDOperand Op1, SDOperand Op2,
|
SDOperand Op1, SDOperand Op2,
|
||||||
SDOperand Op3, SDOperand Op4, SDOperand Op5,
|
SDOperand Op3, SDOperand Op4, SDOperand Op5,
|
||||||
SDOperand Op6) {
|
SDOperand Op6) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3);
|
||||||
ResultTys.push_back(VT1);
|
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
ResultTys.push_back(VT3);
|
|
||||||
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 };
|
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 };
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 6).Val;
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 6).Val;
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2, MVT::ValueType VT3,
|
MVT::ValueType VT2, MVT::ValueType VT3,
|
||||||
SDOperand Op1, SDOperand Op2,
|
SDOperand Op1, SDOperand Op2,
|
||||||
SDOperand Op3, SDOperand Op4, SDOperand Op5,
|
SDOperand Op3, SDOperand Op4, SDOperand Op5,
|
||||||
SDOperand Op6, SDOperand Op7) {
|
SDOperand Op6, SDOperand Op7) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3);
|
||||||
ResultTys.push_back(VT1);
|
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
ResultTys.push_back(VT3);
|
|
||||||
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 };
|
SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 };
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 7).Val;
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 7).Val;
|
||||||
}
|
}
|
||||||
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
MVT::ValueType VT2,
|
MVT::ValueType VT2,
|
||||||
const SDOperand *Ops, unsigned NumOps) {
|
const SDOperand *Ops, unsigned NumOps) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2);
|
||||||
ResultTys.push_back(VT1);
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, NumOps).Val;
|
||||||
ResultTys.push_back(VT2);
|
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, NumOps).Val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
|
/// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user