Define CallSDNode, an SDNode subclass for use with ISD::CALL.
Currently it just holds the calling convention and flags
for isVarArgs and isTailCall.

And it has several utility methods, which eliminate magic
5+2*i and similar index computations in several places.

CallSDNodes are not CSE'd. Teach UpdateNodeOperands to handle
nodes that are not CSE'd gracefully.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56183 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index a95a50b..599f0dd 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -5325,9 +5325,6 @@
                             ArgListTy &Args, SelectionDAG &DAG) {
   SmallVector<SDValue, 32> Ops;
   Ops.push_back(Chain);   // Op#0 - Chain
-  Ops.push_back(DAG.getConstant(CallingConv, getPointerTy())); // Op#1 - CC
-  Ops.push_back(DAG.getConstant(isVarArg, getPointerTy()));    // Op#2 - VarArg
-  Ops.push_back(DAG.getConstant(isTailCall, getPointerTy()));  // Op#3 - Tail
   Ops.push_back(Callee);
   
   // Handle all of the outgoing arguments.
@@ -5412,10 +5409,10 @@
   LoweredRetTys.push_back(MVT::Other);  // Always has a chain.
   
   // Create the CALL node.
-  SDValue Res = DAG.getNode(ISD::CALL,
-                              DAG.getVTList(&LoweredRetTys[0],
-                                            LoweredRetTys.size()),
-                              &Ops[0], Ops.size());
+  SDValue Res = DAG.getCall(CallingConv, isVarArg, isTailCall,
+                            DAG.getVTList(&LoweredRetTys[0],
+                                          LoweredRetTys.size()),
+                            &Ops[0], Ops.size());
   Chain = Res.getValue(LoweredRetTys.size() - 1);
 
   // Gather up the call result into a single value.