diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-03-28 00:41:33 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-03-28 00:41:33 +0000 |
| commit | 7c9740a9edb6c7bbcd877a86da51a1c50752e27c (patch) | |
| tree | 8b780245a559ef39778a207a01c17857c0fd0fdb /llvm/utils/TableGen | |
| parent | e55d171ccdff0fc6afd511f30284336612a6f3f4 (diff) | |
| download | bcm5719-llvm-7c9740a9edb6c7bbcd877a86da51a1c50752e27c.tar.gz bcm5719-llvm-7c9740a9edb6c7bbcd877a86da51a1c50752e27c.zip | |
Tblgen doesn't like multiple SDNode<> definitions that map to the sameenum value. Split them into separate enums.
Also, don't emit dynamic checks when we can compute them statically
llvm-svn: 27202
Diffstat (limited to 'llvm/utils/TableGen')
| -rw-r--r-- | llvm/utils/TableGen/DAGISelEmitter.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp index 7c911bd5be2..38bc05c965f 100644 --- a/llvm/utils/TableGen/DAGISelEmitter.cpp +++ b/llvm/utils/TableGen/DAGISelEmitter.cpp @@ -3115,19 +3115,21 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { // If the last pattern has predicates (which could fail) emit code to catch // the case where nothing handles a pattern. - if (mightNotMatch) - OS << " std::cerr << \"Cannot yet select: \";\n" - << " if (N.getOpcode() != ISD::INTRINSIC) {\n" - << " N.Val->dump(CurDAG);\n" - << " } else {\n" - << " unsigned iid = cast<ConstantSDNode>(N.getOperand(" - "N.getOperand(0).getValueType() == MVT::Other))->getValue();\n" - << " std::cerr << \"intrinsic %\"<< " - "Intrinsic::getName((Intrinsic::ID)iid);\n" - << " }\n" - << " std::cerr << '\\n';\n" + if (mightNotMatch) { + OS << " std::cerr << \"Cannot yet select: \";\n"; + if (OpcodeInfo.getEnumName() != "ISD::INTRINSIC_W_CHAIN" && + OpcodeInfo.getEnumName() != "ISD::INTRINSIC_WO_CHAIN" && + OpcodeInfo.getEnumName() != "ISD::INTRINSIC_VOID") { + OS << " N.Val->dump(CurDAG);\n"; + } else { + OS << " unsigned iid = cast<ConstantSDNode>(N.getOperand(" + "N.getOperand(0).getValueType() == MVT::Other))->getValue();\n" + << " std::cerr << \"intrinsic %\"<< " + "Intrinsic::getName((Intrinsic::ID)iid);\n"; + } + OS << " std::cerr << '\\n';\n" << " abort();\n"; - + } OS << "}\n\n"; } @@ -3285,7 +3287,9 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { OS << " } // end of big switch.\n\n" << " std::cerr << \"Cannot yet select: \";\n" - << " if (N.getOpcode() != ISD::INTRINSIC) {\n" + << " if (N.getOpcode() != ISD::INTRINSIC_W_CHAIN &&\n" + << " N.getOpcode() != ISD::INTRINSIC_WO_CHAIN &&\n" + << " N.getOpcode() != ISD::INTRINSIC_VOID) {\n" << " N.Val->dump(CurDAG);\n" << " } else {\n" << " unsigned iid = cast<ConstantSDNode>(N.getOperand(" |

