From: Chris Lattner Date: Tue, 25 Oct 2005 20:35:14 +0000 (+0000) Subject: Emit some boilerplate for targets X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f071bb5b874fcf369ba3586f9bdf4114b34caf6b;p=oota-llvm.git Emit some boilerplate for targets git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23983 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index baf6b4873cb..32f0e64a674 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -1859,6 +1859,35 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { << " 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 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(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.