aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-26 23:08:55 +0000
committerChris Lattner <sabre@nondot.org>2006-01-26 23:08:55 +0000
commitfabcb7abc57253c0e8ba1de1952a6b332ea9cd7b (patch)
treeeeb0cb24f224554164226510d5297bbf81fa9fe8
parent511731786e2dd3b8faee5a3e5ac20d3755650f91 (diff)
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
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index 2ce87cf422..f8ed5deb26 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<SDOperand> 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<MVT::ValueType> 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.