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

Chris Lattner lattner at cs.uiuc.edu
Fri Aug 19 15:31:45 PDT 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.43 -> 1.44
SelectionDAGNodes.h updated: 1.58 -> 1.59
---
Log message:

ADd support for TargetGlobalAddress nodes


---
Diffs of the changes:  (+11 -3)

 SelectionDAG.h      |    2 ++
 SelectionDAGNodes.h |   12 +++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.43 llvm/include/llvm/CodeGen/SelectionDAG.h:1.44
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.43	Thu Aug 18 19:56:28 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h	Fri Aug 19 17:31:34 2005
@@ -97,6 +97,7 @@
   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 getFrameIndex(int FI, MVT::ValueType VT);
   SDOperand getConstantPool(unsigned CPIdx, MVT::ValueType VT);
   SDOperand getBasicBlock(MachineBasicBlock *MBB);
@@ -288,6 +289,7 @@
            SDNode *> Loads;
 
   std::map<const GlobalValue*, SDNode*> GlobalValues;
+  std::map<const GlobalValue*, SDNode*> TargetGlobalValues;
   std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> Constants;
   std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> TargetConstants;
   std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> ConstantFPs;


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.58 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.59
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.58	Thu Aug 18 02:25:46 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Fri Aug 19 17:31:34 2005
@@ -60,6 +60,11 @@
     // TargetConstant - Like Constant, but the DAG does not do any folding or
     // simplification of the constant.  This is used by the DAG->DAG selector.
     TargetConstant,
+    
+    // TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or
+    // anything else with this node, and this is valid in the target-specific
+    // dag, turning into a GlobalAddress operand.
+    TargetGlobalAddress,
 
     // CopyToReg - This node has three operands: a chain, a register number to
     // set to this value, and a value.  
@@ -775,8 +780,8 @@
   GlobalValue *TheGlobal;
 protected:
   friend class SelectionDAG;
-  GlobalAddressSDNode(const GlobalValue *GA, MVT::ValueType VT)
-    : SDNode(ISD::GlobalAddress, VT) {
+  GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT)
+    : SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress, VT) {
     TheGlobal = const_cast<GlobalValue*>(GA);
   }
 public:
@@ -785,7 +790,8 @@
 
   static bool classof(const GlobalAddressSDNode *) { return true; }
   static bool classof(const SDNode *N) {
-    return N->getOpcode() == ISD::GlobalAddress;
+    return N->getOpcode() == ISD::GlobalAddress ||
+           N->getOpcode() == ISD::TargetGlobalAddress;
   }
 };
 






More information about the llvm-commits mailing list