[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun May 8 21:14:28 PDT 2005



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAG.cpp updated: 1.99 -> 1.100
---
Log message:

memoize all nodes, even null Value* nodes.  Do not add two token chain outputs


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

 SelectionDAG.cpp |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.99 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.100
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.99	Sun May  8 23:08:27 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp	Sun May  8 23:14:13 2005
@@ -1328,13 +1328,11 @@
   return SDOperand(N, 0);
 }
 
-SDOperand SelectionDAG::getSrcValue(const Value* v, int offset) {
-  if (v && ValueNodes[std::make_pair(v,offset)])
-    return SDOperand(ValueNodes[std::make_pair(v,offset)], 0);
-  SDNode *N = new SrcValueSDNode(v, offset);
-  N->setValueTypes(MVT::Other);
-  if (v) //only track non-null values
-    ValueNodes[std::make_pair(v,offset)] = N;
+SDOperand SelectionDAG::getSrcValue(const Value *V, int Offset) {
+  SDNode *&N = ValueNodes[std::make_pair(V, Offset)];
+  if (N) return SDOperand(N, 0);
+
+  N = new SrcValueSDNode(V, Offset);
   AllNodes.push_back(N);
   return SDOperand(N, 0);
 }






More information about the llvm-commits mailing list