[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Mar 27 16:41:45 PST 2006



Changes in directory llvm/utils/TableGen:

DAGISelEmitter.cpp updated: 1.189 -> 1.190
---
Log message:

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


---
Diffs of the changes:  (+17 -13)

 DAGISelEmitter.cpp |   30 +++++++++++++++++-------------
 1 files changed, 17 insertions(+), 13 deletions(-)


Index: llvm/utils/TableGen/DAGISelEmitter.cpp
diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.189 llvm/utils/TableGen/DAGISelEmitter.cpp:1.190
--- llvm/utils/TableGen/DAGISelEmitter.cpp:1.189	Mon Mar 27 16:21:18 2006
+++ llvm/utils/TableGen/DAGISelEmitter.cpp	Mon Mar 27 18:41:33 2006
@@ -3115,19 +3115,21 @@
     
     // 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 @@
 
   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("






More information about the llvm-commits mailing list