Make SelectNodeTo return N

llvm-svn: 24548
This commit is contained in:
Chris Lattner 2005-11-30 22:45:14 +00:00
parent 3713e6b49c
commit be5dd5da19
2 changed files with 79 additions and 63 deletions

View File

@ -20,7 +20,7 @@
#include <map>
#include <list>
#include <string> // FIXME remove eventually, turning map into const char* map.
#include <string>
namespace llvm {
class TargetLowering;
@ -272,33 +272,35 @@ public:
/// SelectNodeTo - These are used for target selectors to *mutate* the
/// specified node to have the specified return type, Target opcode, and
/// operands. Note that target opcodes are stored as
/// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field.
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2, SDOperand Op3);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4,
SDOperand Op5);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4,
SDOperand Op5, SDOperand Op6);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
MVT::ValueType VT2, SDOperand Op1, SDOperand Op2);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
SDOperand Op3);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
SDOperand Op3, SDOperand Op4);
void SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
SDOperand Op3, SDOperand Op4, SDOperand Op5);
/// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field. The 0th value
/// of the resultant node is returned.
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT);
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1);
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2);
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2, SDOperand Op3);
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2, SDOperand Op3,
SDOperand Op4);
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2, SDOperand Op3,
SDOperand Op4, SDOperand Op5);
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
SDOperand Op1, SDOperand Op2, SDOperand Op3,
SDOperand Op4, SDOperand Op5, SDOperand Op6);
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
MVT::ValueType VT2, SDOperand Op1, SDOperand Op2);
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
SDOperand Op3);
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
SDOperand Op3, SDOperand Op4);
SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
SDOperand Op3, SDOperand Op4, SDOperand Op5);
SDOperand getTargetNode(unsigned Opcode, MVT::ValueType VT) {
return getNode(ISD::BUILTIN_OP_END+Opcode, VT);

View File

@ -1415,104 +1415,118 @@ void SelectionDAG::setNodeValueTypes(SDNode *N, MVT::ValueType VT1,
/// specified node to have the specified return type, Target opcode, and
/// operands. Note that target opcodes are stored as
/// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field.
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT) {
SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT) {
RemoveNodeFromCSEMaps(N);
N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
N->setValueTypes(VT);
return SDOperand(N, 0);
}
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1) {
SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1) {
RemoveNodeFromCSEMaps(N);
N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
N->setValueTypes(VT);
N->setOperands(Op1);
return SDOperand(N, 0);
}
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1,
SDOperand Op2) {
SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1,
SDOperand Op2) {
RemoveNodeFromCSEMaps(N);
N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
N->setValueTypes(VT);
N->setOperands(Op1, Op2);
return SDOperand(N, 0);
}
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1,
SDOperand Op2, SDOperand Op3) {
SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1,
SDOperand Op2, SDOperand Op3) {
RemoveNodeFromCSEMaps(N);
N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
N->setValueTypes(VT);
N->setOperands(Op1, Op2, Op3);
return SDOperand(N, 0);
}
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1,
SDOperand Op2, SDOperand Op3, SDOperand Op4) {
SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1,
SDOperand Op2, SDOperand Op3,
SDOperand Op4) {
RemoveNodeFromCSEMaps(N);
N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
N->setValueTypes(VT);
N->setOperands(Op1, Op2, Op3, Op4);
return SDOperand(N, 0);
}
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1,
SDOperand Op2, SDOperand Op3, SDOperand Op4,
SDOperand Op5) {
SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1,
SDOperand Op2, SDOperand Op3,SDOperand Op4,
SDOperand Op5) {
RemoveNodeFromCSEMaps(N);
N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
N->setValueTypes(VT);
N->setOperands(Op1, Op2, Op3, Op4, Op5);
return SDOperand(N, 0);
}
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1,
SDOperand Op2, SDOperand Op3, SDOperand Op4,
SDOperand Op5, SDOperand Op6) {
SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT, SDOperand Op1,
SDOperand Op2, SDOperand Op3,SDOperand Op4,
SDOperand Op5, SDOperand Op6) {
RemoveNodeFromCSEMaps(N);
N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc);
N->setValueTypes(VT);
N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6);
return SDOperand(N, 0);
}
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT1, MVT::ValueType VT2,
SDOperand Op1, SDOperand Op2) {
SDOperand 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);
return SDOperand(N, 0);
}
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT1, MVT::ValueType VT2,
SDOperand Op1, SDOperand Op2, SDOperand Op3) {
SDOperand 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);
return SDOperand(N, 0);
}
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT1, MVT::ValueType VT2,
SDOperand Op1, SDOperand Op2,
SDOperand Op3, SDOperand Op4) {
SDOperand 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);
return SDOperand(N, 0);
}
void SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc,
MVT::ValueType VT1, MVT::ValueType VT2,
SDOperand Op1, SDOperand Op2,
SDOperand Op3, SDOperand Op4, SDOperand Op5) {
SDOperand 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);
return SDOperand(N, 0);
}
// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.