aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2006-01-23 20:59:12 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2006-01-23 20:59:12 +0000
commit8c6f1ee5aa376118f1cb7b16b62994fc255eac56 (patch)
tree98090e093688e636f62bb13b43eb5a63dc50d0eb /lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent17d52f723421ce28d1b9fe2fc058366ed43ec094 (diff)
another selectto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25548 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 48d1d5c806..3165fc1d65 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1649,6 +1649,29 @@ SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
return SDOperand(N, 0);
}
+SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
+ MVT::ValueType VT, SDOperand Op1,
+ SDOperand Op2, SDOperand Op3,SDOperand Op4,
+ SDOperand Op5, SDOperand Op6,
+ SDOperand Op7) {
+ // If an identical node already exists, use it.
+ std::vector<SDOperand> OpList;
+ OpList.push_back(Op1); OpList.push_back(Op2); OpList.push_back(Op3);
+ OpList.push_back(Op4); OpList.push_back(Op5); OpList.push_back(Op6);
+ OpList.push_back(Op7);
+ SDNode *&ON = OneResultNodes[std::make_pair(ISD::BUILTIN_OP_END+TargetOpc,
+ std::make_pair(VT, OpList))];
+ if (ON) return SDOperand(ON, 0);
+
+ RemoveNodeFromCSEMaps(N);
+ N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
+ N->setValueTypes(VT);
+ N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6, Op7);
+
+ ON = N; // Memoize the new node.
+ return SDOperand(N, 0);
+}
+
SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT1, MVT::ValueType VT2,
SDOperand Op1, SDOperand Op2) {