Tblgen doesn't like multiple SDNode<> definitions that map to the sameenum value...
authorChris Lattner <sabre@nondot.org>
Tue, 28 Mar 2006 00:41:33 +0000 (00:41 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 28 Mar 2006 00:41:33 +0000 (00:41 +0000)
Also, don't emit dynamic checks when we can compute them statically

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27202 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelEmitter.cpp

index 7c911bd5be2784c660b088d8432215b0fc9b9a8b..38bc05c965f5d0e6d86433de2d5d73fe69e36ce6 100644 (file)
@@ -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("