aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-08 22:40:18 +0000
committerChris Lattner <sabre@nondot.org>2007-12-08 22:40:18 +0000
commite4af7b5a573593dcf2a37cd4590bf76d1322d6da (patch)
tree29efec2fc7be5208fe011797218d23c96d0fa45a
parent13c6a1740cb8877f10e202ee1442231e0c4a903a (diff)
downloadexternal_llvm-e4af7b5a573593dcf2a37cd4590bf76d1322d6da.zip
external_llvm-e4af7b5a573593dcf2a37cd4590bf76d1322d6da.tar.gz
external_llvm-e4af7b5a573593dcf2a37cd4590bf76d1322d6da.tar.bz2
implement some methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44723 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypes.cpp27
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypes.h4
2 files changed, 29 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
index eb1b84f..fb3e81c 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -320,8 +320,7 @@ void DAGTypeLegalizer::GetExpandedOp(SDOperand Op, SDOperand &Lo,
Hi = Entry.second;
}
-void DAGTypeLegalizer::SetExpandedOp(SDOperand Op, SDOperand Lo,
- SDOperand Hi) {
+void DAGTypeLegalizer::SetExpandedOp(SDOperand Op, SDOperand Lo, SDOperand Hi) {
// Remember that this is the result of the node.
std::pair<SDOperand, SDOperand> &Entry = ExpandedNodes[Op];
assert(Entry.first.Val == 0 && "Node already expanded");
@@ -335,6 +334,30 @@ void DAGTypeLegalizer::SetExpandedOp(SDOperand Op, SDOperand Lo,
MarkNewNodes(Hi.Val);
}
+void DAGTypeLegalizer::GetSplitOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi) {
+ std::pair<SDOperand, SDOperand> &Entry = SplitNodes[Op];
+ RemapNode(Entry.first);
+ RemapNode(Entry.second);
+ assert(Entry.first.Val && "Operand isn't split");
+ Lo = Entry.first;
+ Hi = Entry.second;
+}
+
+void DAGTypeLegalizer::SetSplitOp(SDOperand Op, SDOperand Lo, SDOperand Hi) {
+ // Remember that this is the result of the node.
+ std::pair<SDOperand, SDOperand> &Entry = SplitNodes[Op];
+ assert(Entry.first.Val == 0 && "Node already split");
+ Entry.first = Lo;
+ Entry.second = Hi;
+
+ // Lo/Hi may have been newly allocated, if so, add nodeid's as relevant.
+ if (Lo.Val->getNodeId() == NewNode)
+ MarkNewNodes(Lo.Val);
+ if (Hi.Val->getNodeId() == NewNode)
+ MarkNewNodes(Hi.Val);
+}
+
+
SDOperand DAGTypeLegalizer::CreateStackStoreLoad(SDOperand Op,
MVT::ValueType DestVT) {
// Create the stack frame object.
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/lib/CodeGen/SelectionDAG/LegalizeTypes.h
index 2030eda..ba39cc8 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.h
@@ -97,6 +97,10 @@ class VISIBILITY_HIDDEN DAGTypeLegalizer {
/// ScalarizedNodes - For nodes that are <1 x ty>, this map indicates the
/// scalar value of type 'ty' to use.
DenseMap<SDOperand, SDOperand> ScalarizedNodes;
+
+ /// SplitNodes - For nodes that need to be split this map indicates
+ /// which operands are the expanded version of the input.
+ DenseMap<SDOperand, std::pair<SDOperand, SDOperand> > SplitNodes;
/// ReplacedNodes - For nodes that have been replaced with another,
/// indicates the replacement node to use.