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

Chris Lattner lattner at cs.uiuc.edu
Tue Aug 16 11:16:35 PDT 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.36 -> 1.37
SelectionDAGNodes.h updated: 1.47 -> 1.48
---
Log message:

add some methods for dag->dag isel


---
Diffs of the changes:  (+40 -9)

 SelectionDAG.h      |   19 ++++++++++++++-----
 SelectionDAGNodes.h |   30 ++++++++++++++++++++++++++----
 2 files changed, 40 insertions(+), 9 deletions(-)


Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.36 llvm/include/llvm/CodeGen/SelectionDAG.h:1.37
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.36	Sat Aug 13 01:14:17 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h	Tue Aug 16 13:16:24 2005
@@ -204,14 +204,23 @@
   // getSrcValue - construct a node to track a Value* through the backend
   SDOperand getSrcValue(const Value* I, int offset = 0);
 
-  void replaceAllUsesWith(SDOperand Old, SDOperand New) {
-    assert(Old != New && "RAUW self!");
-    assert(0 && "Unimplemented!");
-  }
-
+  
+  /// SelectNodeTo - These are used for target selectors to *mutate* the
+  /// specified node to have the specified return type, Target opcode, and
+  /// operands.  Note that target opcodes are stored as
+  /// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field.
+  void SelectNodeTo(SDNode *N, MVT::ValueType VT, unsigned TargetOpc,
+                    SDOperand Op1);
+  void SelectNodeTo(SDNode *N, MVT::ValueType VT, unsigned TargetOpc,
+                    SDOperand Op1, SDOperand Op2);
+  void SelectNodeTo(SDNode *N, MVT::ValueType VT, unsigned TargetOpc,
+                    SDOperand Op1, SDOperand Op2, SDOperand Op3);
+  
+  
   void dump() const;
 
 private:
+  void RemoveNodeFromCSEMaps(SDNode *N);
   void DeleteNodeIfDead(SDNode *N, void *NodeSet);
   
   /// SimplifySetCC - Try to simplify a setcc built with the specified operands 


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.47 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.48
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.47	Wed Aug 10 15:50:42 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Tue Aug 16 13:16:24 2005
@@ -592,10 +592,17 @@
     NodeDepth = ND+1;
   }
 
-  virtual ~SDNode() {
-    // FIXME: Drop uses.
-  }
+  virtual ~SDNode() {}
 
+  /// MorphNodeTo - This clears the return value and operands list, and sets the
+  /// opcode of the node to the specified value.  This should only be used by
+  /// the SelectionDAG class.
+  void MorphNodeTo(unsigned Opc) {
+    NodeType = Opc;
+    Values.clear();
+    Operands.clear();
+  }
+  
   void setValueTypes(MVT::ValueType VT) {
     Values.reserve(1);
     Values.push_back(VT);
@@ -609,7 +616,22 @@
   void setValueTypes(std::vector<MVT::ValueType> &VTs) {
     std::swap(Values, VTs);
   }
-
+  
+  void setOperands(SDOperand Op0) {
+    Operands.reserve(1);
+    Operands.push_back(Op0);
+  }
+  void setOperands(SDOperand Op0, SDOperand Op1) {
+    Operands.reserve(2);
+    Operands.push_back(Op0);
+    Operands.push_back(Op1);
+  }
+  void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2) {
+    Operands.reserve(3);
+    Operands.push_back(Op0);
+    Operands.push_back(Op1);
+    Operands.push_back(Op2);
+  }
   void removeUser(SDNode *User) {
     // Remove this user from the operand's use list.
     for (unsigned i = Uses.size(); ; --i) {






More information about the llvm-commits mailing list