[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h

Chris Lattner lattner at cs.uiuc.edu
Fri May 13 11:40:33 PDT 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.24 -> 1.25
SelectionDAGNodes.h updated: 1.39 -> 1.40
---
Log message:

add TAILCALL node


---
Diffs of the changes:  (+7 -5)

 SelectionDAG.h      |    8 ++++----
 SelectionDAGNodes.h |    4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)


Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.24 llvm/include/llvm/CodeGen/SelectionDAG.h:1.25
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.24	Mon May  9 15:21:27 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h	Fri May 13 13:40:17 2005
@@ -129,8 +129,8 @@
   /// 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;
@@ -140,10 +140,10 @@
   /// 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;


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.39 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.40
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.39	Thu May 12 18:23:19 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Fri May 13 13:40:17 2005
@@ -234,8 +234,10 @@
     // 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






More information about the llvm-commits mailing list