/// getCall - Note that this destroys the vector of RetVals passed in.
///
SDNode *getCall(std::vector<MVT::ValueType> &RetVals, SDOperand Chain,
- SDOperand Callee) {
- SDNode *NN = new SDNode(ISD::CALL, Chain, Callee);
+ SDOperand Callee, bool isTailCall = false) {
+ SDNode *NN = new SDNode(isTailCall ? ISD::TAILCALL : ISD::CALL, Chain, Callee);
NN->setValueTypes(RetVals);
AllNodes.push_back(NN);
return NN;
/// where arguments are passed in physical registers. This destroys the
/// RetVals and ArgsInRegs vectors.
SDNode *getCall(std::vector<MVT::ValueType> &RetVals, SDOperand Chain,
- SDOperand Callee, std::vector<SDOperand> &ArgsInRegs) {
+ SDOperand Callee, std::vector<SDOperand> &ArgsInRegs, bool isTailCall = false) {
ArgsInRegs.insert(ArgsInRegs.begin(), Callee);
ArgsInRegs.insert(ArgsInRegs.begin(), Chain);
- SDNode *NN = new SDNode(ISD::CALL, ArgsInRegs);
+ SDNode *NN = new SDNode(isTailCall ? ISD::TAILCALL : ISD::CALL, ArgsInRegs);
NN->setValueTypes(RetVals);
AllNodes.push_back(NN);
return NN;
// CALL - Call to a function pointer. The first operand is the chain, the
// second is the destination function pointer (a GlobalAddress for a direct
// call). Arguments have already been lowered to explicit DAGs according to
- // the calling convention in effect here.
+ // the calling convention in effect here. TAILCALL is the same as CALL, but
+ // the callee is known not to access the stack of the caller.
CALL,
+ TAILCALL,
// MEMSET/MEMCPY/MEMMOVE - The first operand is the chain, and the rest
// correspond to the operands of the LLVM intrinsic functions. The only