[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Oct 25 13:35:25 PDT 2005
Changes in directory llvm/utils/TableGen:
DAGISelEmitter.cpp updated: 1.65 -> 1.66
---
Log message:
Emit some boilerplate for targets
---
Diffs of the changes: (+29 -0)
DAGISelEmitter.cpp | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+)
Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.65 llvm/utils/TableGen/DAGISelEmitter.cpp:1.66
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.65 Thu Oct 20 20:19:59 2005
+++ llvm/utils/TableGen/DAGISelEmitter.cpp Tue Oct 25 15:35:14 2005
@@ -1859,6 +1859,35 @@
<< " SDOperand Tmp0 = Select(N.getOperand(0));\n"
<< " if (!N.Val->hasOneUse()) CodeGenMap[N] = Tmp0;\n"
<< " return Tmp0;\n"
+ << " }\n"
+ << " case ISD::TokenFactor:\n"
+ << " if (N.getNumOperands() == 2) {\n"
+ << " SDOperand Op0 = Select(N.getOperand(0));\n"
+ << " SDOperand Op1 = Select(N.getOperand(1));\n"
+ << " return CodeGenMap[N] =\n"
+ << " CurDAG->getNode(ISD::TokenFactor, MVT::Other, Op0, Op1);\n"
+ << " } else {\n"
+ << " std::vector<SDOperand> Ops;\n"
+ << " for (unsigned i = 0, e = N.getNumOperands(); i != e; ++i)\n"
+ << " Ops.push_back(Select(N.getOperand(i)));\n"
+ << " return CodeGenMap[N] = \n"
+ << " CurDAG->getNode(ISD::TokenFactor, MVT::Other, Ops);\n"
+ << " }\n"
+ << " case ISD::CopyFromReg: {\n"
+ << " SDOperand Chain = Select(N.getOperand(0));\n"
+ << " if (Chain == N.getOperand(0)) return N; // No change\n"
+ << " SDOperand New = CurDAG->getCopyFromReg(Chain,\n"
+ << " cast<RegisterSDNode>(N.getOperand(1))->getReg(),\n"
+ << " N.Val->getValueType(0));\n"
+ << " return New.getValue(N.ResNo);\n"
+ << " }\n"
+ << " case ISD::CopyToReg: {\n"
+ << " SDOperand Chain = Select(N.getOperand(0));\n"
+ << " SDOperand Reg = N.getOperand(1);\n"
+ << " SDOperand Val = Select(N.getOperand(2));\n"
+ << " return CodeGenMap[N] = \n"
+ << " CurDAG->getNode(ISD::CopyToReg, MVT::Other,\n"
+ << " Chain, Reg, Val);\n"
<< " }\n";
// Group the patterns by their top-level opcodes.
More information about the llvm-commits
mailing list