diff options
author | Chris Lattner <sabre@nondot.org> | 2005-05-09 04:14:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-05-09 04:14:13 +0000 |
commit | c14f354895fb764c6861aeb814764d7a6cd49e6e (patch) | |
tree | 4c15188b510d16d628c0e65e216477d3c55846bd /llvm/lib/CodeGen | |
parent | f5675a0813ae017553b06ab709cdb41e9169ac30 (diff) | |
download | bcm5719-llvm-c14f354895fb764c6861aeb814764d7a6cd49e6e.tar.gz bcm5719-llvm-c14f354895fb764c6861aeb814764d7a6cd49e6e.zip |
memoize all nodes, even null Value* nodes. Do not add two token chain outputs
llvm-svn: 21805
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 965976cce3d..c9ce7962200 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -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); } |