[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri May 13 11:44:00 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.121 -> 1.122
SelectionDAG.cpp updated: 1.110 -> 1.111
---
Log message:

Handle TAILCALL node


---
Diffs of the changes:  (+10 -3)

 LegalizeDAG.cpp  |   12 +++++++++---
 SelectionDAG.cpp |    1 +
 2 files changed, 10 insertions(+), 3 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.121 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.122
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.121	Fri May 13 00:17:00 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Fri May 13 13:43:43 2005
@@ -361,6 +361,7 @@
     AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
     return Result.getValue(Op.ResNo);
 
+  case ISD::TAILCALL:
   case ISD::CALL: {
     Tmp1 = LegalizeOp(Node->getOperand(0));  // Legalize the chain.
     Tmp2 = LegalizeOp(Node->getOperand(1));  // Legalize the callee.
@@ -377,7 +378,8 @@
       RetTyVTs.reserve(Node->getNumValues());
       for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i)
         RetTyVTs.push_back(Node->getValueType(i));
-      Result = SDOperand(DAG.getCall(RetTyVTs, Tmp1, Tmp2, Ops), 0);
+      Result = SDOperand(DAG.getCall(RetTyVTs, Tmp1, Tmp2, Ops,
+                                     Node->getOpcode() == ISD::TAILCALL), 0);
     } else {
       Result = Result.getValue(0);
     }
@@ -1689,6 +1691,7 @@
     Tmp3 = PromoteOp(Node->getOperand(2));   // Legalize the op1
     Result = DAG.getNode(ISD::SELECT, NVT, Tmp1, Tmp2, Tmp3);
     break;
+  case ISD::TAILCALL:
   case ISD::CALL: {
     Tmp1 = LegalizeOp(Node->getOperand(0));  // Legalize the chain.
     Tmp2 = LegalizeOp(Node->getOperand(1));  // Legalize the callee.
@@ -1703,7 +1706,8 @@
     RetTyVTs.reserve(2);
     RetTyVTs.push_back(NVT);
     RetTyVTs.push_back(MVT::Other);
-    SDNode *NC = DAG.getCall(RetTyVTs, Tmp1, Tmp2, Ops);
+    SDNode *NC = DAG.getCall(RetTyVTs, Tmp1, Tmp2, Ops,
+                             Node->getOpcode() == ISD::TAILCALL);
     Result = SDOperand(NC, 0);
 
     // Insert the new chain mapping.
@@ -2341,6 +2345,7 @@
       std::swap(Lo, Hi);
     break;
   }
+  case ISD::TAILCALL:
   case ISD::CALL: {
     SDOperand Chain  = LegalizeOp(Node->getOperand(0));  // Legalize the chain.
     SDOperand Callee = LegalizeOp(Node->getOperand(1));  // Legalize the callee.
@@ -2360,7 +2365,8 @@
     RetTyVTs.push_back(NVT);
     RetTyVTs.push_back(NVT);
     RetTyVTs.push_back(MVT::Other);
-    SDNode *NC = DAG.getCall(RetTyVTs, Chain, Callee, Ops);
+    SDNode *NC = DAG.getCall(RetTyVTs, Chain, Callee, Ops,
+                             Node->getOpcode() == ISD::TAILCALL);
     Lo = SDOperand(NC, 0);
     Hi = SDOperand(NC, 1);
 


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.110 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.111
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.110	Thu May 12 18:51:40 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Fri May 13 13:43:43 2005
@@ -1690,6 +1690,7 @@
   case ISD::BRCONDTWOWAY:  return "brcondtwoway";
   case ISD::RET:     return "ret";
   case ISD::CALL:    return "call";
+  case ISD::TAILCALL:return "tailcall";
   case ISD::CALLSEQ_START:  return "callseq_start";
   case ISD::CALLSEQ_END:    return "callseq_end";
 






More information about the llvm-commits mailing list