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

Evan Cheng evan.cheng at apple.com
Tue Nov 29 18:04:24 PST 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.71 -> 1.72
SelectionDAGNodes.h updated: 1.79 -> 1.80
---
Log message:

Added an index field to GlobalAddressSDNode so it can represent X+12, etc.


---
Diffs of the changes:  (+25 -2)

 SelectionDAG.h      |    6 +++++-
 SelectionDAGNodes.h |   21 ++++++++++++++++++++-
 2 files changed, 25 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.71 llvm/include/llvm/CodeGen/SelectionDAG.h:1.72
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.71	Tue Nov 29 00:15:39 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h	Tue Nov 29 20:04:11 2005
@@ -110,7 +110,8 @@
   SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT);
   SDOperand getConstantFP(double Val, MVT::ValueType VT);
   SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
-  SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
+  SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
+                                   int offset=0);
   SDOperand getFrameIndex(int FI, MVT::ValueType VT);
   SDOperand getTargetFrameIndex(int FI, MVT::ValueType VT);
   SDOperand getConstantPool(Constant *C, MVT::ValueType VT);
@@ -283,6 +284,9 @@
   void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, 
                     SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4,
                     SDOperand Op5);
+  void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, 
+                    SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4,
+                    SDOperand Op5, SDOperand Op6);
   void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, 
                     MVT::ValueType VT2, SDOperand Op1, SDOperand Op2);
   void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.79 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.80
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.79	Tue Nov 29 00:15:39 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Tue Nov 29 20:04:11 2005
@@ -795,6 +795,21 @@
     Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this);
     Op4.Val->Uses.push_back(this);
   }
+  void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3,
+                   SDOperand Op4, SDOperand Op5) {
+    assert(NumOperands == 0 && "Should not have operands yet!");
+    OperandList = new SDOperand[6];
+    OperandList[0] = Op0;
+    OperandList[1] = Op1;
+    OperandList[2] = Op2;
+    OperandList[3] = Op3;
+    OperandList[4] = Op4;
+    OperandList[5] = Op5;
+    NumOperands = 6;
+    Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
+    Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this);
+    Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this);
+  }
   void addUser(SDNode *User) {
     Uses.push_back(User);
   }
@@ -923,15 +938,19 @@
 
 class GlobalAddressSDNode : public SDNode {
   GlobalValue *TheGlobal;
+  int offset;
 protected:
   friend class SelectionDAG;
-  GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT)
+  GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
+                      int o=0)
     : SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress, VT) {
     TheGlobal = const_cast<GlobalValue*>(GA);
+    offset = o;
   }
 public:
 
   GlobalValue *getGlobal() const { return TheGlobal; }
+  int getOffset() const { return offset; }
 
   static bool classof(const GlobalAddressSDNode *) { return true; }
   static bool classof(const SDNode *N) {






More information about the llvm-commits mailing list