summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-11 18:57:39 +0000
committerChris Lattner <sabre@nondot.org>2005-05-11 18:57:39 +0000
commit724f7eec774a13f8bceaca89c93606fb7559a7b6 (patch)
tree9f83ec702829b75887d8c29d15b0f5e248e1fc51 /llvm/lib/CodeGen
parent490769c5b6be7cefa80d03f8e28962830ea23d66 (diff)
downloadbcm5719-llvm-724f7eec774a13f8bceaca89c93606fb7559a7b6.tar.gz
bcm5719-llvm-724f7eec774a13f8bceaca89c93606fb7559a7b6.zip
Do not memoize ADJCALLSTACKDOWN nodes, provide a method to hack on them.
llvm-svn: 21871
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index d0809db38cc..3c3de2d4370 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1192,9 +1192,17 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
#endif
}
- SDNode *&N = BinaryOps[std::make_pair(Opcode, std::make_pair(N1, N2))];
- if (N) return SDOperand(N, 0);
- N = new SDNode(Opcode, N1, N2);
+ // Memoize this node if possible.
+ SDNode *N;
+ if (Opcode != ISD::ADJCALLSTACKDOWN) {
+ SDNode *&BON = BinaryOps[std::make_pair(Opcode, std::make_pair(N1, N2))];
+ if (BON) return SDOperand(BON, 0);
+
+ BON = N = new SDNode(Opcode, N1, N2);
+ } else {
+ N = new SDNode(ISD::ADJCALLSTACKDOWN, N1, N2);
+ }
+
if (Opcode != ISD::READPORT && Opcode != ISD::READIO)
N->setValueTypes(VT);
@@ -1205,6 +1213,19 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
return SDOperand(N, 0);
}
+// setAdjCallChain - This method changes the token chain of an ADJCALLSTACKDOWN
+// node to be the specified operand.
+void SDNode::setAdjCallChain(SDOperand N) {
+ assert(N.getValueType() == MVT::Other);
+ assert(getOpcode() == ISD::ADJCALLSTACKDOWN && "Cannot adjust this node!");
+
+ Operands[0].Val->removeUser(this);
+ Operands[0] = N;
+ N.Val->Uses.push_back(this);
+}
+
+
+
SDOperand SelectionDAG::getLoad(MVT::ValueType VT,
SDOperand Chain, SDOperand Ptr,
SDOperand SV) {
OpenPOWER on IntegriCloud