Changes in directory llvm/include/llvm/CodeGen:
SelectionDAG.h updated: 1.126 -> 1.127 SelectionDAGNodes.h updated: 1.143 -> 1.144 --- Log message: Eliminate SelectNodeTo() and getTargetNode() variants which take more than 3 SDOperand operands. They are replaced by versions which take an array of SDOperand and the number of operands. --- Diffs of the changes: (+16 -142) SelectionDAG.h | 76 ++++-------------------------------------------- SelectionDAGNodes.h | 82 +++++----------------------------------------------- 2 files changed, 16 insertions(+), 142 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.126 llvm/include/llvm/CodeGen/SelectionDAG.h:1.127 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.126 Sat Aug 26 02:55:35 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Sun Aug 27 03:07:55 2006 @@ -311,34 +311,14 @@ SDOperand Op1, SDOperand Op2); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7, SDOperand Op8); + SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + const SDOperand *Ops, unsigned NumOps); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2); SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4); - SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5); + /// getTargetNode - These are used for target selectors to create a new node /// with specified return type(s), target opcode, and operands. @@ -354,23 +334,6 @@ SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, - SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, - SDOperand Op7, SDOperand Op8); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT, const SDOperand *Ops, unsigned NumOps); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1); @@ -379,39 +342,14 @@ SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5, - SDOperand Op6); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5, - SDOperand Op6, SDOperand Op7); + SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, + MVT::ValueType VT2, + const SDOperand *Ops, unsigned NumOps); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, SDOperand Op1, SDOperand Op2); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, MVT::ValueType VT3, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, MVT::ValueType VT3, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5, - SDOperand Op6); - SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, MVT::ValueType VT3, - SDOperand Op1, SDOperand Op2, - SDOperand Op3, SDOperand Op4, SDOperand Op5, - SDOperand Op6, SDOperand Op7); SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, - MVT::ValueType VT2, + MVT::ValueType VT2, MVT::ValueType VT3, const SDOperand *Ops, unsigned NumOps); /// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead. Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.143 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.144 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.143 Wed Aug 16 16:01:10 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Sun Aug 27 03:07:55 2006 @@ -945,80 +945,16 @@ Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); Op2.Val->Uses.push_back(this); } - void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3) { + void setOperands(const SDOperand *Ops, unsigned NumOps) { assert(NumOperands == 0 && "Should not have operands yet!"); - OperandList = new SDOperand[4]; - OperandList[0] = Op0; - OperandList[1] = Op1; - OperandList[2] = Op2; - OperandList[3] = Op3; - NumOperands = 4; - Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); - Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); - } - void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4) { - assert(NumOperands == 0 && "Should not have operands yet!"); - OperandList = new SDOperand[5]; - OperandList[0] = Op0; - OperandList[1] = Op1; - OperandList[2] = Op2; - OperandList[3] = Op3; - OperandList[4] = Op4; - NumOperands = 5; - Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); - Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); - Op4.Val->Uses.push_back(this); - } - void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5) { - assert(NumOperands == 0 && "Should not have operands yet!"); - OperandList = new SDOperand[6]; - OperandList[0] = Op0; - OperandList[1] = Op1; - OperandList[2] = Op2; - OperandList[3] = Op3; - OperandList[4] = Op4; - OperandList[5] = Op5; - NumOperands = 6; - Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); - Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); - Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this); - } - void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6) { - assert(NumOperands == 0 && "Should not have operands yet!"); - OperandList = new SDOperand[7]; - OperandList[0] = Op0; - OperandList[1] = Op1; - OperandList[2] = Op2; - OperandList[3] = Op3; - OperandList[4] = Op4; - OperandList[5] = Op5; - OperandList[6] = Op6; - NumOperands = 7; - Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); - Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); - Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this); - Op6.Val->Uses.push_back(this); - } - void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, - SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) { - assert(NumOperands == 0 && "Should not have operands yet!"); - OperandList = new SDOperand[8]; - OperandList[0] = Op0; - OperandList[1] = Op1; - OperandList[2] = Op2; - OperandList[3] = Op3; - OperandList[4] = Op4; - OperandList[5] = Op5; - OperandList[6] = Op6; - OperandList[7] = Op7; - NumOperands = 8; - Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); - Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); - Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this); - Op6.Val->Uses.push_back(this); Op7.Val->Uses.push_back(this); + NumOperands = NumOps; + OperandList = new SDOperand[NumOperands]; + + for (unsigned i = 0, e = NumOps; i != e; ++i) { + OperandList[i] = Ops[i]; + SDNode *N = OperandList[i].Val; + N->Uses.push_back(this); + } } void addUser(SDNode *User) { _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits