[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Evan Cheng
evan.cheng at apple.com
Wed Feb 8 23:15:35 PST 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAG.cpp updated: 1.254 -> 1.255
---
Log message:
More changes to reduce frame size.
Move all getTargetNode() out of SelectionDAG.h into SelectionDAG.cpp. This
prevents them from being inlined.
Change getTargetNode() so they return SDNode * instead of SDOperand to prevent
copying. It should also help compilation speed.
---
Diffs of the changes: (+243 -0)
SelectionDAG.cpp | 243 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 243 insertions(+)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.254 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.255
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.254 Sun Feb 5 00:29:23 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Feb 9 01:15:23 2006
@@ -2037,6 +2037,249 @@
return SDOperand(N, 0);
}
+/// getTargetNode - These are used for target selectors to create a new node
+/// with specified return type(s), target opcode, and operands.
+///
+/// Note that getTargetNode returns the resultant node. If there is already a
+/// node of the specified opcode and operands, it returns that node instead of
+/// the current one.
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT) {
+ return getNode(ISD::BUILTIN_OP_END+Opcode, VT).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
+ SDOperand Op1) {
+ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
+ SDOperand Op1, SDOperand Op2) {
+ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
+ SDOperand Op1, SDOperand Op2, SDOperand Op3) {
+ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
+ SDOperand Op1, SDOperand Op2, SDOperand Op3,
+ SDOperand Op4) {
+ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3, Op4).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
+ SDOperand Op1, SDOperand Op2, SDOperand Op3,
+ SDOperand Op4, SDOperand Op5) {
+ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Op1, Op2, Op3, Op4, Op5).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
+ SDOperand Op1, SDOperand Op2, SDOperand Op3,
+ SDOperand Op4, SDOperand Op5, SDOperand Op6) {
+ std::vector<SDOperand> Ops;
+ Ops.reserve(6);
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ Ops.push_back(Op4);
+ Ops.push_back(Op5);
+ Ops.push_back(Op6);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
+ SDOperand Op1, SDOperand Op2, SDOperand Op3,
+ SDOperand Op4, SDOperand Op5, SDOperand Op6,
+ SDOperand Op7) {
+ std::vector<SDOperand> Ops;
+ Ops.reserve(7);
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ Ops.push_back(Op4);
+ Ops.push_back(Op5);
+ Ops.push_back(Op6);
+ Ops.push_back(Op7);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
+ SDOperand Op1, SDOperand Op2, SDOperand Op3,
+ SDOperand Op4, SDOperand Op5, SDOperand Op6,
+ SDOperand Op7, SDOperand Op8) {
+ std::vector<SDOperand> Ops;
+ Ops.reserve(8);
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ Ops.push_back(Op4);
+ Ops.push_back(Op5);
+ Ops.push_back(Op6);
+ Ops.push_back(Op7);
+ Ops.push_back(Op8);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT,
+ std::vector<SDOperand> &Ops) {
+ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, SDOperand Op1) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, SDOperand Op1, SDOperand Op2) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
+ SDOperand Op3) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
+ SDOperand Op3, SDOperand Op4) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ Ops.push_back(Op4);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
+ SDOperand Op3, SDOperand Op4, SDOperand Op5) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ Ops.push_back(Op4);
+ Ops.push_back(Op5);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
+ SDOperand Op3, SDOperand Op4, SDOperand Op5,
+ SDOperand Op6) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ Ops.push_back(Op4);
+ Ops.push_back(Op5);
+ Ops.push_back(Op6);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
+ SDOperand Op3, SDOperand Op4, SDOperand Op5,
+ SDOperand Op6, SDOperand Op7) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ Ops.push_back(Op4);
+ Ops.push_back(Op5);
+ Ops.push_back(Op6);
+ Ops.push_back(Op7);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, MVT::ValueType VT3,
+ SDOperand Op1, SDOperand Op2) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ ResultTys.push_back(VT3);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, MVT::ValueType VT3,
+ SDOperand Op1, SDOperand Op2,
+ SDOperand Op3, SDOperand Op4, SDOperand Op5) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ ResultTys.push_back(VT3);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ Ops.push_back(Op4);
+ Ops.push_back(Op5);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, MVT::ValueType VT3,
+ SDOperand Op1, SDOperand Op2,
+ SDOperand Op3, SDOperand Op4, SDOperand Op5,
+ SDOperand Op6) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ ResultTys.push_back(VT3);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ Ops.push_back(Op4);
+ Ops.push_back(Op5);
+ Ops.push_back(Op6);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::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) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ ResultTys.push_back(VT3);
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Op1);
+ Ops.push_back(Op2);
+ Ops.push_back(Op3);
+ Ops.push_back(Op4);
+ Ops.push_back(Op5);
+ Ops.push_back(Op6);
+ Ops.push_back(Op7);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1,
+ MVT::ValueType VT2, std::vector<SDOperand> &Ops) {
+ std::vector<MVT::ValueType> ResultTys;
+ ResultTys.push_back(VT1);
+ ResultTys.push_back(VT2);
+ return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops).Val;
+}
+
// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
/// This can cause recursive merging of nodes in the DAG.
///
More information about the llvm-commits
mailing list