Added new getNode and getTargetNode variants for X86 stores.
authorEvan Cheng <evan.cheng@apple.com>
Sat, 10 Dec 2005 00:37:58 +0000 (00:37 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 10 Dec 2005 00:37:58 +0000 (00:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24653 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAG.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 63cf7b2668b95a9e4fc45e016e99f60dfba0966d..9d1131a2695d6965a1abfbca288e58f8c5dce8ae 100644 (file)
@@ -232,6 +232,9 @@ public:
   SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
                     SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4,
                     SDOperand N5);
+  SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
+                    SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4,
+                    SDOperand N5, SDOperand N6);
   SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
                     std::vector<SDOperand> &Children);
   SDOperand getNode(unsigned Opcode, std::vector<MVT::ValueType> &ResultTys,
@@ -341,6 +344,11 @@ public:
                           SDOperand Op4, SDOperand Op5) {
     return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3, Op4, Op5);
   }
+  SDOperand getTargetNode(unsigned Opcode, MVT::ValueType VT,
+                          SDOperand Op1, SDOperand Op2, SDOperand Op3,
+                          SDOperand Op4, SDOperand Op5, SDOperand Op6) {
+    return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3, Op4, Op5, Op6);
+  }
   SDOperand getTargetNode(unsigned Opcode, MVT::ValueType VT,
                           std::vector<SDOperand> &Ops) {
     return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops);
index f9ea84f3010caefe4d255c2c8cd6a01944b9581d..30ebeb2b8e9b063a79229128c523b704ca686f4d 100644 (file)
@@ -1088,66 +1088,6 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
   return SDOperand(N, 0);
 }
 
-// setAdjCallChain - This method changes the token chain of an
-// CALLSEQ_START/END node to be the specified operand.
-void SDNode::setAdjCallChain(SDOperand N) {
-  assert(N.getValueType() == MVT::Other);
-  assert((getOpcode() == ISD::CALLSEQ_START ||
-          getOpcode() == ISD::CALLSEQ_END) && "Cannot adjust this node!");
-
-  OperandList[0].Val->removeUser(this);
-  OperandList[0] = N;
-  OperandList[0].Val->Uses.push_back(this);
-}
-
-
-
-SDOperand SelectionDAG::getLoad(MVT::ValueType VT,
-                                SDOperand Chain, SDOperand Ptr,
-                                SDOperand SV) {
-  SDNode *&N = Loads[std::make_pair(Ptr, std::make_pair(Chain, VT))];
-  if (N) return SDOperand(N, 0);
-  N = new SDNode(ISD::LOAD, Chain, Ptr, SV);
-
-  // Loads have a token chain.
-  setNodeValueTypes(N, VT, MVT::Other);
-  AllNodes.push_back(N);
-  return SDOperand(N, 0);
-}
-
-SDOperand SelectionDAG::getVecLoad(unsigned Count, MVT::ValueType EVT,
-                                   SDOperand Chain, SDOperand Ptr,
-                                   SDOperand SV) {
-  SDNode *&N = Loads[std::make_pair(Ptr, std::make_pair(Chain, EVT))];
-  if (N) return SDOperand(N, 0);
-  std::vector<SDOperand> Ops;
-  Ops.reserve(5);
-  Ops.push_back(Chain);
-  Ops.push_back(Ptr);
-  Ops.push_back(getConstant(Count, MVT::i32));
-  Ops.push_back(getValueType(EVT));
-  Ops.push_back(SV);
-  std::vector<MVT::ValueType> VTs;
-  VTs.reserve(2);
-  VTs.push_back(MVT::Vector); VTs.push_back(MVT::Other);  // Add token chain.
-  return getNode(ISD::VLOAD, VTs, Ops);
-}
-
-SDOperand SelectionDAG::getExtLoad(unsigned Opcode, MVT::ValueType VT,
-                                   SDOperand Chain, SDOperand Ptr, SDOperand SV,
-                                   MVT::ValueType EVT) {
-  std::vector<SDOperand> Ops;
-  Ops.reserve(4);
-  Ops.push_back(Chain);
-  Ops.push_back(Ptr);
-  Ops.push_back(SV);
-  Ops.push_back(getValueType(EVT));
-  std::vector<MVT::ValueType> VTs;
-  VTs.reserve(2);
-  VTs.push_back(VT); VTs.push_back(MVT::Other);  // Add token chain.
-  return getNode(Opcode, VTs, Ops);
-}
-
 SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
                                 SDOperand N1, SDOperand N2, SDOperand N3) {
   // Perform various simplifications.
@@ -1224,6 +1164,79 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
   return getNode(Opcode, VT, Ops);
 }
 
+SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
+                                SDOperand N1, SDOperand N2, SDOperand N3,
+                                SDOperand N4, SDOperand N5, SDOperand N6) {
+  std::vector<SDOperand> Ops;
+  Ops.reserve(6);
+  Ops.push_back(N1);
+  Ops.push_back(N2);
+  Ops.push_back(N3);
+  Ops.push_back(N4);
+  Ops.push_back(N5);
+  Ops.push_back(N6);
+  return getNode(Opcode, VT, Ops);
+}
+
+// setAdjCallChain - This method changes the token chain of an
+// CALLSEQ_START/END node to be the specified operand.
+void SDNode::setAdjCallChain(SDOperand N) {
+  assert(N.getValueType() == MVT::Other);
+  assert((getOpcode() == ISD::CALLSEQ_START ||
+          getOpcode() == ISD::CALLSEQ_END) && "Cannot adjust this node!");
+
+  OperandList[0].Val->removeUser(this);
+  OperandList[0] = N;
+  OperandList[0].Val->Uses.push_back(this);
+}
+
+
+
+SDOperand SelectionDAG::getLoad(MVT::ValueType VT,
+                                SDOperand Chain, SDOperand Ptr,
+                                SDOperand SV) {
+  SDNode *&N = Loads[std::make_pair(Ptr, std::make_pair(Chain, VT))];
+  if (N) return SDOperand(N, 0);
+  N = new SDNode(ISD::LOAD, Chain, Ptr, SV);
+
+  // Loads have a token chain.
+  setNodeValueTypes(N, VT, MVT::Other);
+  AllNodes.push_back(N);
+  return SDOperand(N, 0);
+}
+
+SDOperand SelectionDAG::getVecLoad(unsigned Count, MVT::ValueType EVT,
+                                   SDOperand Chain, SDOperand Ptr,
+                                   SDOperand SV) {
+  SDNode *&N = Loads[std::make_pair(Ptr, std::make_pair(Chain, EVT))];
+  if (N) return SDOperand(N, 0);
+  std::vector<SDOperand> Ops;
+  Ops.reserve(5);
+  Ops.push_back(Chain);
+  Ops.push_back(Ptr);
+  Ops.push_back(getConstant(Count, MVT::i32));
+  Ops.push_back(getValueType(EVT));
+  Ops.push_back(SV);
+  std::vector<MVT::ValueType> VTs;
+  VTs.reserve(2);
+  VTs.push_back(MVT::Vector); VTs.push_back(MVT::Other);  // Add token chain.
+  return getNode(ISD::VLOAD, VTs, Ops);
+}
+
+SDOperand SelectionDAG::getExtLoad(unsigned Opcode, MVT::ValueType VT,
+                                   SDOperand Chain, SDOperand Ptr, SDOperand SV,
+                                   MVT::ValueType EVT) {
+  std::vector<SDOperand> Ops;
+  Ops.reserve(4);
+  Ops.push_back(Chain);
+  Ops.push_back(Ptr);
+  Ops.push_back(SV);
+  Ops.push_back(getValueType(EVT));
+  std::vector<MVT::ValueType> VTs;
+  VTs.reserve(2);
+  VTs.push_back(VT); VTs.push_back(MVT::Other);  // Add token chain.
+  return getNode(Opcode, VTs, Ops);
+}
 
 SDOperand SelectionDAG::getSrcValue(const Value *V, int Offset) {
   assert((!V || isa<PointerType>(V->getType())) &&