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

Chris Lattner lattner at cs.uiuc.edu
Thu Jan 13 12:49:43 PST 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.10 -> 1.11
SelectionDAGNodes.h updated: 1.12 -> 1.13
---
Log message:

Add new ImplicitDef node, rename CopyRegSDNode class to RegSDNode.


---
Diffs of the changes:  (+26 -12)

Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.10 llvm/include/llvm/CodeGen/SelectionDAG.h:1.11
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.10	Wed Jan 12 12:11:36 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h	Thu Jan 13 14:49:26 2005
@@ -119,14 +119,21 @@
   SDOperand getCopyToReg(SDOperand Chain, SDOperand N, unsigned Reg) {
     // Note: these are auto-CSE'd because the caller doesn't make requests that
     // could cause duplicates to occur.
-    SDNode *NN = new CopyRegSDNode(Chain, N, Reg);
+    SDNode *NN = new RegSDNode(Chain, N, Reg);
     AllNodes.push_back(NN);
     return SDOperand(NN, 0);
   }
 
   SDOperand getCopyFromReg(unsigned Reg, MVT::ValueType VT) {
     // Note: These nodes are auto-CSE'd by the caller of this method.
-    SDNode *NN = new CopyRegSDNode(Reg, VT);
+    SDNode *NN = new RegSDNode(ISD::CopyFromReg, Reg, VT);
+    AllNodes.push_back(NN);
+    return SDOperand(NN, 0);
+  }
+
+  SDOperand getImplicitDef(unsigned Reg) {
+    // Note: These nodes are auto-CSE'd by the caller of this method.
+    SDNode *NN = new RegSDNode(ISD::ImplicitDef, Reg, MVT::Other);
     AllNodes.push_back(NN);
     return SDOperand(NN, 0);
   }


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.12 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.13
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.12	Thu Jan 13 11:58:35 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Thu Jan 13 14:49:26 2005
@@ -58,16 +58,22 @@
 
     // CopyToReg - This node has chain and child nodes, and an associated
     // register number.  The instruction selector must guarantee that the value
-    // of the value node is available in the register stored in the
-    // CopyRegSDNode object.
+    // of the value node is available in the register stored in the RegSDNode
+    // object.
     CopyToReg,
 
     // CopyFromReg - This node indicates that the input value is a virtual or
     // physical register that is defined outside of the scope of this
-    // SelectionDAG.  The register number is available from the CopyRegSDNode
-    // object.
+    // SelectionDAG.  The register is available from the RegSDNode object.
     CopyFromReg,
 
+    // ImplicitDef - This node indicates that the specified register is
+    // implicitly defined by some operation (e.g. its a live-in argument).  This
+    // register is indicated in the RegSDNode object.  The only operand to this
+    // is the token chain coming in, the only result is the token chain going
+    // out.
+    ImplicitDef,
+
     // EXTRACT_ELEMENT - This is used to get the first or second (determined by
     // a Constant, which is required to be operand #1), element of the aggregate
     // value specified as operand #0.  This is only for use before legalization,
@@ -608,25 +614,26 @@
 };
 
 
-class CopyRegSDNode : public SDNode {
+class RegSDNode : public SDNode {
   unsigned Reg;
 protected:
   friend class SelectionDAG;
-  CopyRegSDNode(SDOperand Chain, SDOperand Src, unsigned reg)
+  RegSDNode(SDOperand Chain, SDOperand Src, unsigned reg)
     : SDNode(ISD::CopyToReg, Chain, Src), Reg(reg) {
     setValueTypes(MVT::Other);  // Just a token chain.
   }
-  CopyRegSDNode(unsigned reg, MVT::ValueType VT)
-    : SDNode(ISD::CopyFromReg, VT), Reg(reg) {
+  RegSDNode(unsigned Opc, unsigned reg, MVT::ValueType VT)
+    : SDNode(Opc, VT), Reg(reg) {
   }
 public:
 
   unsigned getReg() const { return Reg; }
 
-  static bool classof(const CopyRegSDNode *) { return true; }
+  static bool classof(const RegSDNode *) { return true; }
   static bool classof(const SDNode *N) {
     return N->getOpcode() == ISD::CopyToReg ||
-           N->getOpcode() == ISD::CopyFromReg;
+           N->getOpcode() == ISD::CopyFromReg ||
+           N->getOpcode() == ISD::ImplicitDef;
   }
 };
 






More information about the llvm-commits mailing list