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

Chris Lattner lattner at cs.uiuc.edu
Wed Aug 24 22:02:52 PDT 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.50 -> 1.51
SelectionDAGNodes.h updated: 1.61 -> 1.62
---
Log message:

Add support for TargetConstantPool node


---
Diffs of the changes:  (+8 -4)

 SelectionDAG.h      |    3 ++-
 SelectionDAGNodes.h |    9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.50 llvm/include/llvm/CodeGen/SelectionDAG.h:1.51
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.50	Wed Aug 24 19:42:08 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h	Thu Aug 25 00:02:41 2005
@@ -101,6 +101,7 @@
   SDOperand getFrameIndex(int FI, MVT::ValueType VT);
   SDOperand getTargetFrameIndex(int FI, MVT::ValueType VT);
   SDOperand getConstantPool(unsigned CPIdx, MVT::ValueType VT);
+  SDOperand getTargetConstantPool(unsigned CPIdx, MVT::ValueType VT);
   SDOperand getBasicBlock(MachineBasicBlock *MBB);
   SDOperand getExternalSymbol(const char *Sym, MVT::ValueType VT);
   SDOperand getValueType(MVT::ValueType);
@@ -309,7 +310,7 @@
   std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> TargetConstants;
   std::map<std::pair<uint64_t, MVT::ValueType>, SDNode*> ConstantFPs;
   std::map<int, SDNode*> FrameIndices, TargetFrameIndices;
-  std::map<unsigned, SDNode*> ConstantPoolIndices;
+  std::map<unsigned, SDNode*> ConstantPoolIndices, TargetConstantPoolIndices;
   std::map<MachineBasicBlock *, SDNode*> BBNodes;
   std::vector<SDNode*> ValueTypeNodes;
   std::map<std::string, SDNode*> ExternalSymbols;


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.61 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.62
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.61	Wed Aug 24 19:42:08 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Thu Aug 25 00:02:41 2005
@@ -66,6 +66,7 @@
     // dag, turning into a GlobalAddress operand.
     TargetGlobalAddress,
     TargetFrameIndex,
+    TargetConstantPool,
 
     // CopyToReg - This node has three operands: a chain, a register number to
     // set to this value, and a value.  
@@ -830,15 +831,17 @@
   unsigned CPI;
 protected:
   friend class SelectionDAG;
-  ConstantPoolSDNode(unsigned cpi, MVT::ValueType VT)
-    : SDNode(ISD::ConstantPool, VT), CPI(cpi) {}
+  ConstantPoolSDNode(unsigned cpi, MVT::ValueType VT, bool isTarget)
+    : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, VT),
+      CPI(cpi) {}
 public:
 
   unsigned getIndex() const { return CPI; }
 
   static bool classof(const ConstantPoolSDNode *) { return true; }
   static bool classof(const SDNode *N) {
-    return N->getOpcode() == ISD::ConstantPool;
+    return N->getOpcode() == ISD::ConstantPool ||
+           N->getOpcode() == ISD::TargetConstantPool;
   }
 };
 






More information about the llvm-commits mailing list