Use V8ISD::CALL instead of ISD::CALL
authorChris Lattner <sabre@nondot.org>
Fri, 27 Jan 2006 23:30:03 +0000 (23:30 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 27 Jan 2006 23:30:03 +0000 (23:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25716 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/Target/Sparc/SparcInstrInfo.td
lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
lib/Target/SparcV8/SparcV8InstrInfo.td

index 4a6eebb1e6b8003cf2acb5e1ad356565a19333ba..62062185201d0eefc1e6633d12b9c70a13bfa206 100644 (file)
@@ -46,6 +46,7 @@ namespace V8ISD {
     SELECT_ICC, // Select between two values using the current ICC flags.
     SELECT_FCC, // Select between two values using the current FCC flags.
     
+    CALL,       // A V8 call instruction.
     RET_FLAG,   // Return with a flag operand.
   };
 }
@@ -185,6 +186,7 @@ const char *SparcV8TargetLowering::getTargetNodeName(unsigned Opcode) const {
   case V8ISD::ITOF:       return "V8ISD::ITOF";
   case V8ISD::SELECT_ICC: return "V8ISD::SELECT_ICC";
   case V8ISD::SELECT_FCC: return "V8ISD::SELECT_FCC";
+  case V8ISD::CALL:       return "V8ISD::CALL";
   case V8ISD::RET_FLAG:   return "V8ISD::RET_FLAG";
   }
 }
@@ -526,10 +528,12 @@ SparcV8TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
   std::vector<MVT::ValueType> NodeTys;
   NodeTys.push_back(MVT::Other);   // Returns a chain
   NodeTys.push_back(MVT::Flag);    // Returns a flag for retval copy to use.
+  std::vector<SDOperand> Ops;
+  Ops.push_back(Chain);
+  Ops.push_back(Callee);
   if (InFlag.Val)
-    Chain = SDOperand(DAG.getCall(NodeTys, Chain, Callee, InFlag), 0);
-  else
-    Chain = SDOperand(DAG.getCall(NodeTys, Chain, Callee), 0);
+    Ops.push_back(InFlag);
+  Chain = DAG.getNode(V8ISD::CALL, NodeTys, Ops);
   InFlag = Chain.getValue(1);
   
   MVT::ValueType RetTyVT = getValueType(RetTy);
@@ -981,7 +985,7 @@ SDOperand SparcV8DAGToDAGISel::Select(SDOperand Op) {
     // The high part is in the Y register.
     return CurDAG->SelectNodeTo(N, V8::RDY, MVT::i32, Mul.getValue(1));
   }
-  case ISD::CALL:
+  case V8ISD::CALL:
     // FIXME: This is a workaround for a bug in tblgen.
   { // Pattern #47: (call:Flag (tglobaladdr:i32):$dst, ICC:Flag)
     // Emits: (CALL:void (tglobaladdr:i32):$dst)
index db87d4c850016a7f0a29c134ee6d3088f4e36614..8269448ca16c6ad19560065cd201423244b9c1f6 100644 (file)
@@ -92,7 +92,7 @@ def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_V8CallSeq, [SDNPHasChain]>;
 def callseq_end   : SDNode<"ISD::CALLSEQ_END",   SDT_V8CallSeq, [SDNPHasChain]>;
 
 def SDT_V8Call    : SDTypeProfile<0, 1, [SDTCisVT<0, i32>]>;
-def call          : SDNode<"ISD::CALL", SDT_V8Call,
+def call          : SDNode<"V8ISD::CALL", SDT_V8Call,
                           [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
 
 def SDT_V8RetFlag : SDTypeProfile<0, 0, []>;
index 4a6eebb1e6b8003cf2acb5e1ad356565a19333ba..62062185201d0eefc1e6633d12b9c70a13bfa206 100644 (file)
@@ -46,6 +46,7 @@ namespace V8ISD {
     SELECT_ICC, // Select between two values using the current ICC flags.
     SELECT_FCC, // Select between two values using the current FCC flags.
     
+    CALL,       // A V8 call instruction.
     RET_FLAG,   // Return with a flag operand.
   };
 }
@@ -185,6 +186,7 @@ const char *SparcV8TargetLowering::getTargetNodeName(unsigned Opcode) const {
   case V8ISD::ITOF:       return "V8ISD::ITOF";
   case V8ISD::SELECT_ICC: return "V8ISD::SELECT_ICC";
   case V8ISD::SELECT_FCC: return "V8ISD::SELECT_FCC";
+  case V8ISD::CALL:       return "V8ISD::CALL";
   case V8ISD::RET_FLAG:   return "V8ISD::RET_FLAG";
   }
 }
@@ -526,10 +528,12 @@ SparcV8TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
   std::vector<MVT::ValueType> NodeTys;
   NodeTys.push_back(MVT::Other);   // Returns a chain
   NodeTys.push_back(MVT::Flag);    // Returns a flag for retval copy to use.
+  std::vector<SDOperand> Ops;
+  Ops.push_back(Chain);
+  Ops.push_back(Callee);
   if (InFlag.Val)
-    Chain = SDOperand(DAG.getCall(NodeTys, Chain, Callee, InFlag), 0);
-  else
-    Chain = SDOperand(DAG.getCall(NodeTys, Chain, Callee), 0);
+    Ops.push_back(InFlag);
+  Chain = DAG.getNode(V8ISD::CALL, NodeTys, Ops);
   InFlag = Chain.getValue(1);
   
   MVT::ValueType RetTyVT = getValueType(RetTy);
@@ -981,7 +985,7 @@ SDOperand SparcV8DAGToDAGISel::Select(SDOperand Op) {
     // The high part is in the Y register.
     return CurDAG->SelectNodeTo(N, V8::RDY, MVT::i32, Mul.getValue(1));
   }
-  case ISD::CALL:
+  case V8ISD::CALL:
     // FIXME: This is a workaround for a bug in tblgen.
   { // Pattern #47: (call:Flag (tglobaladdr:i32):$dst, ICC:Flag)
     // Emits: (CALL:void (tglobaladdr:i32):$dst)
index db87d4c850016a7f0a29c134ee6d3088f4e36614..8269448ca16c6ad19560065cd201423244b9c1f6 100644 (file)
@@ -92,7 +92,7 @@ def callseq_start : SDNode<"ISD::CALLSEQ_START", SDT_V8CallSeq, [SDNPHasChain]>;
 def callseq_end   : SDNode<"ISD::CALLSEQ_END",   SDT_V8CallSeq, [SDNPHasChain]>;
 
 def SDT_V8Call    : SDTypeProfile<0, 1, [SDTCisVT<0, i32>]>;
-def call          : SDNode<"ISD::CALL", SDT_V8Call,
+def call          : SDNode<"V8ISD::CALL", SDT_V8Call,
                           [SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
 
 def SDT_V8RetFlag : SDTypeProfile<0, 0, []>;