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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-05-09 04:14:13 +00:00
parent 369e6db9b6
commit 0437cdd6dc

View File

@ -1328,13 +1328,11 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
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);
}