From 0fb094fd60f3762f9031655e0223b3bfa72c5ac2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 19 Nov 2005 01:44:53 +0000 Subject: [PATCH] Add some method variants, patch by Evan Cheng git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24418 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 60 ++++++++++++++++------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 803e788b6a6..685bdabd49f 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1399,6 +1399,7 @@ void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); N->setValueTypes(VT); } + void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1) { RemoveNodeFromCSEMaps(N); @@ -1406,6 +1407,7 @@ void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, N->setValueTypes(VT); N->setOperands(Op1); } + void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1, SDOperand Op2) { @@ -1414,14 +1416,7 @@ void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, N->setValueTypes(VT); N->setOperands(Op1, Op2); } -void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT1, MVT::ValueType VT2, - SDOperand Op1, SDOperand Op2) { - RemoveNodeFromCSEMaps(N); - N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - setNodeValueTypes(N, VT1, VT2); - N->setOperands(Op1, Op2); -} + void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3) { @@ -1430,14 +1425,6 @@ void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, N->setValueTypes(VT); N->setOperands(Op1, Op2, Op3); } -void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, - MVT::ValueType VT1, MVT::ValueType VT2, - SDOperand Op1, SDOperand Op2, SDOperand Op3) { - RemoveNodeFromCSEMaps(N); - N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - setNodeValueTypes(N, VT1, VT2); - N->setOperands(Op1, Op2, Op3); -} void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1, @@ -1447,6 +1434,7 @@ void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, N->setValueTypes(VT); N->setOperands(Op1, Op2, Op3, Op4); } + void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, @@ -1457,7 +1445,45 @@ void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, N->setOperands(Op1, Op2, Op3, Op4, Op5); } -/// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead. +void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT1, MVT::ValueType VT2, + SDOperand Op1, SDOperand Op2) { + RemoveNodeFromCSEMaps(N); + N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); + setNodeValueTypes(N, VT1, VT2); + N->setOperands(Op1, Op2); +} + +void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT1, MVT::ValueType VT2, + SDOperand Op1, SDOperand Op2, SDOperand Op3) { + RemoveNodeFromCSEMaps(N); + N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); + setNodeValueTypes(N, VT1, VT2); + N->setOperands(Op1, Op2, Op3); +} + +void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT1, MVT::ValueType VT2, + SDOperand Op1, SDOperand Op2, + SDOperand Op3, SDOperand Op4) { + RemoveNodeFromCSEMaps(N); + N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); + setNodeValueTypes(N, VT1, VT2); + N->setOperands(Op1, Op2, Op3, Op4); +} + +void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT1, MVT::ValueType VT2, + SDOperand Op1, SDOperand Op2, + SDOperand Op3, SDOperand Op4, SDOperand Op5) { + RemoveNodeFromCSEMaps(N); + N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); + setNodeValueTypes(N, VT1, VT2); + N->setOperands(Op1, Op2, Op3, Op4, Op5); +} + +// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead. /// This can cause recursive merging of nodes in the DAG. /// /// This version assumes From/To have a single result value.