From 281b55ebeccd3f0d723888c1bb9ec6e476f708f1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 27 Jan 2006 23:34:02 +0000 Subject: [PATCH] Use PPCISD::CALL instead of ISD::CALL git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25717 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 3 +-- lib/Target/PowerPC/PPCISelLowering.cpp | 9 ++++++--- lib/Target/PowerPC/PPCISelLowering.h | 5 ++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp index a859d0acb6f..f6683c2ef0e 100644 --- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -821,8 +821,7 @@ SDOperand PPCDAGToDAGISel::Select(SDOperand Op) { case ISD::ADD_PARTS: return SelectADD_PARTS(Op); case ISD::SUB_PARTS: return SelectSUB_PARTS(Op); case ISD::SETCC: return SelectSETCC(Op); - case ISD::CALL: return SelectCALL(Op); - case ISD::TAILCALL: return SelectCALL(Op); + case PPCISD::CALL: return SelectCALL(Op); case PPCISD::GlobalBaseReg: return getGlobalBaseReg(); case ISD::FrameIndex: { diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index b8094d72486..2b0cbcd1957 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -666,7 +666,7 @@ PPCTargetLowering::LowerCallTo(SDOperand Chain, unsigned CallingConv, bool isTailCall, SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG) { - // args_to_use will accumulate outgoing args for the ISD::CALL case in + // args_to_use will accumulate outgoing args for the PPCISD::CALL case in // SelectExpr to use to put the arguments in the appropriate registers. std::vector args_to_use; @@ -844,8 +844,11 @@ PPCTargetLowering::LowerCallTo(SDOperand Chain, if (GlobalAddressSDNode *G = dyn_cast(Callee)) Callee = DAG.getTargetGlobalAddress(G->getGlobal(), MVT::i32); - SDOperand TheCall = SDOperand(DAG.getCall(RetVals, - Chain, Callee, args_to_use), 0); + std::vector Ops; + Ops.push_back(Chain); + Ops.push_back(Callee); + Ops.insert(Ops.end(), args_to_use.begin(), args_to_use.end()); + SDOperand TheCall = DAG.getNode(PPCISD::CALL, RetVals, Ops); Chain = TheCall.getValue(RetTyVT != MVT::isVoid); Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain, DAG.getConstant(NumBytes, getPointerTy())); diff --git a/lib/Target/PowerPC/PPCISelLowering.h b/lib/Target/PowerPC/PPCISelLowering.h index 9170514b27f..9f6b77beec6 100644 --- a/lib/Target/PowerPC/PPCISelLowering.h +++ b/lib/Target/PowerPC/PPCISelLowering.h @@ -59,9 +59,12 @@ namespace llvm { /// code. SRL, SRA, SHL, + /// CALL - A function call. + CALL, + /// Return with a flag operand, matched by 'blr' RET_FLAG, -}; + }; } class PPCTargetLowering : public TargetLowering {