mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-24 13:15:36 +00:00
add some method variants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23142 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
15055733f8
commit
e3f1026683
@ -112,6 +112,22 @@ public:
|
|||||||
getRegister(Reg, N.getValueType()), N);
|
getRegister(Reg, N.getValueType()), N);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This version of the getCopyToReg method takes an extra operand, which
|
||||||
|
// indicates that there is potentially an incoming flag value (if Flag is not
|
||||||
|
// null) and that there should be a flag result.
|
||||||
|
SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N,
|
||||||
|
SDOperand Flag) {
|
||||||
|
std::vector<MVT::ValueType> VTs;
|
||||||
|
VTs.push_back(MVT::Other);
|
||||||
|
VTs.push_back(MVT::Flag);
|
||||||
|
std::vector<SDOperand> Ops;
|
||||||
|
Ops.push_back(Chain);
|
||||||
|
Ops.push_back(getRegister(Reg, N.getValueType()));
|
||||||
|
Ops.push_back(N);
|
||||||
|
if (Flag.Val) Ops.push_back(Flag);
|
||||||
|
return getNode(ISD::CopyToReg, VTs, Ops);
|
||||||
|
}
|
||||||
|
|
||||||
SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT) {
|
SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT) {
|
||||||
std::vector<MVT::ValueType> ResultTys;
|
std::vector<MVT::ValueType> ResultTys;
|
||||||
ResultTys.push_back(VT);
|
ResultTys.push_back(VT);
|
||||||
@ -122,6 +138,22 @@ public:
|
|||||||
return getNode(ISD::CopyFromReg, ResultTys, Ops);
|
return getNode(ISD::CopyFromReg, ResultTys, Ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This version of the getCopyFromReg method takes an extra operand, which
|
||||||
|
// indicates that there is potentially an incoming flag value (if Flag is not
|
||||||
|
// null) and that there should be a flag result.
|
||||||
|
SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT,
|
||||||
|
SDOperand Flag) {
|
||||||
|
std::vector<MVT::ValueType> ResultTys;
|
||||||
|
ResultTys.push_back(VT);
|
||||||
|
ResultTys.push_back(MVT::Other);
|
||||||
|
ResultTys.push_back(MVT::Flag);
|
||||||
|
std::vector<SDOperand> Ops;
|
||||||
|
Ops.push_back(Chain);
|
||||||
|
Ops.push_back(getRegister(Reg, VT));
|
||||||
|
if (Flag.Val) Ops.push_back(Flag);
|
||||||
|
return getNode(ISD::CopyFromReg, ResultTys, Ops);
|
||||||
|
}
|
||||||
|
|
||||||
SDOperand getImplicitDef(SDOperand Chain, unsigned Reg, MVT::ValueType VT) {
|
SDOperand getImplicitDef(SDOperand Chain, unsigned Reg, MVT::ValueType VT) {
|
||||||
return getNode(ISD::ImplicitDef, MVT::Other, Chain, getRegister(Reg, VT));
|
return getNode(ISD::ImplicitDef, MVT::Other, Chain, getRegister(Reg, VT));
|
||||||
}
|
}
|
||||||
@ -277,6 +309,13 @@ public:
|
|||||||
std::vector<SDOperand> &Ops) {
|
std::vector<SDOperand> &Ops) {
|
||||||
return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops);
|
return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops);
|
||||||
}
|
}
|
||||||
|
SDOperand getTargetNode(unsigned Opcode, MVT::ValueType VT1,
|
||||||
|
MVT::ValueType VT2, std::vector<SDOperand> &Ops) {
|
||||||
|
std::vector<MVT::ValueType> ResultTys;
|
||||||
|
ResultTys.push_back(VT1);
|
||||||
|
ResultTys.push_back(VT2);
|
||||||
|
return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops);
|
||||||
|
}
|
||||||
|
|
||||||
/// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
|
/// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
|
||||||
/// This can cause recursive merging of nodes in the DAG. Use the first
|
/// This can cause recursive merging of nodes in the DAG. Use the first
|
||||||
|
Loading…
x
Reference in New Issue
Block a user