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

Chris Lattner lattner at cs.uiuc.edu
Fri Aug 26 10:14:38 PDT 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAG.h updated: 1.53 -> 1.54
SelectionDAGNodes.h updated: 1.62 -> 1.63
---
Log message:

Change ConstantPoolSDNode to actually hold the Constant itself instead of
putting it into the constant pool.  This allows the isel machinery to 
create constants that it will end up deciding are not needed, without them
ending up in the resultant function constant pool.



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

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


Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.53 llvm/include/llvm/CodeGen/SelectionDAG.h:1.54
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.53	Fri Aug 26 11:35:36 2005
+++ llvm/include/llvm/CodeGen/SelectionDAG.h	Fri Aug 26 12:14:27 2005
@@ -100,8 +100,8 @@
   SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT);
   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 getConstantPool(Constant *C, MVT::ValueType VT);
+  SDOperand getTargetConstantPool(Constant *C, MVT::ValueType VT);
   SDOperand getBasicBlock(MachineBasicBlock *MBB);
   SDOperand getExternalSymbol(const char *Sym, MVT::ValueType VT);
   SDOperand getValueType(MVT::ValueType);
@@ -320,7 +320,8 @@
   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, TargetConstantPoolIndices;
+  std::map<Constant *, SDNode*> ConstantPoolIndices;
+  std::map<Constant *, SDNode*> 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.62 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.63
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.62	Thu Aug 25 00:02:41 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Fri Aug 26 12:14:27 2005
@@ -828,15 +828,15 @@
 };
 
 class ConstantPoolSDNode : public SDNode {
-  unsigned CPI;
+  Constant *C;
 protected:
   friend class SelectionDAG;
-  ConstantPoolSDNode(unsigned cpi, MVT::ValueType VT, bool isTarget)
+  ConstantPoolSDNode(Constant *c, MVT::ValueType VT, bool isTarget)
     : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, VT),
-      CPI(cpi) {}
+    C(c) {}
 public:
 
-  unsigned getIndex() const { return CPI; }
+  Constant *get() const { return C; }
 
   static bool classof(const ConstantPoolSDNode *) { return true; }
   static bool classof(const SDNode *N) {






More information about the llvm-commits mailing list