From: Chris Lattner Date: Thu, 26 Jan 2006 23:08:55 +0000 (+0000) Subject: Teach the dag selectors to select InlineAsm nodes. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fabcb7abc57253c0e8ba1de1952a6b332ea9cd7b;p=oota-llvm.git Teach the dag selectors to select InlineAsm nodes. Aren't we happy the pattern selectors are almost all gone? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25666 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 2ce87cf422e..f8ed5deb26d 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -2662,6 +2662,21 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { } // Emit boilerplate. + OS << "SDOperand Select_INLINEASM(SDOperand N) {\n" + << " std::vector Ops(N.Val->op_begin(), N.Val->op_end());\n" + << " Ops[0] = Select(N.getOperand(0)); // Select the chain.\n\n" + << " // Select the flag operand.\n" + << " if (Ops.back().getValueType() == MVT::Flag)\n" + << " Ops.back() = Select(Ops.back());\n" + << " std::vector VTs;\n" + << " VTs.push_back(MVT::Other);\n" + << " VTs.push_back(MVT::Flag);\n" + << " SDOperand New = CurDAG->getNode(ISD::INLINEASM, VTs, Ops);\n" + << " CodeGenMap[N.getValue(0)] = New;\n" + << " CodeGenMap[N.getValue(1)] = New.getValue(1);\n" + << " return New.getValue(N.ResNo);\n" + << "}\n\n"; + OS << "// The main instruction selector code.\n" << "SDOperand SelectCode(SDOperand N) {\n" << " if (N.getOpcode() >= ISD::BUILTIN_OP_END &&\n" @@ -2737,7 +2752,9 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { << " CodeGenMap[N.getValue(1)] = Result.getValue(1);\n" << " return Result.getValue(N.ResNo);\n" << " }\n" - << " }\n"; + << " }\n" + << " case ISD::INLINEASM: return Select_INLINEASM(N);\n"; + // Loop over all of the case statements, emiting a call to each method we // emitted above.