sink special case "cannotyetselect" for intrinsics out of the
authorChris Lattner <sabre@nondot.org>
Wed, 17 Feb 2010 06:28:22 +0000 (06:28 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 17 Feb 2010 06:28:22 +0000 (06:28 +0000)
tblgen splatted code into the implementation.

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

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
utils/TableGen/DAGISelEmitter.cpp

index eead526f099e170af6240ea948b875645b68cffa..9ba0d55b7a954500a20be02e515ff347972efe00 100644 (file)
@@ -1444,6 +1444,11 @@ SDNode *SelectionDAGISel::Select_EH_LABEL(SDNode *N) {
 }
 
 void SelectionDAGISel::CannotYetSelect(SDNode *N) {
+  if (N->getOpcode() == ISD::INTRINSIC_W_CHAIN ||
+      N->getOpcode() == ISD::INTRINSIC_WO_CHAIN ||
+      N->getOpcode() == ISD::INTRINSIC_VOID)
+    return CannotYetSelectIntrinsic(N);
+  
   std::string msg;
   raw_string_ostream Msg(msg);
   Msg << "Cannot yet select: ";
index 1ac2d94431130883bfeec21d0c498f93d6164a9e..e0e25731e5be1441b6d3a2af758d57dac29d3ba1 100644 (file)
@@ -1841,13 +1841,7 @@ void DAGISelEmitter::EmitInstructionSelector(raw_ostream &OS) {
       // catch the case where nothing handles a pattern.
       if (mightNotMatch) {
         OS << "\n";
-        if (OpName != "ISD::INTRINSIC_W_CHAIN" &&
-            OpName != "ISD::INTRINSIC_WO_CHAIN" &&
-            OpName != "ISD::INTRINSIC_VOID")
-          OS << "  CannotYetSelect(N);\n";
-        else
-          OS << "  CannotYetSelectIntrinsic(N);\n";
-
+        OS << "  CannotYetSelect(N);\n";
         OS << "  return NULL;\n";
       }
       OS << "}\n\n";
@@ -1948,13 +1942,7 @@ void DAGISelEmitter::EmitInstructionSelector(raw_ostream &OS) {
   }
 
   OS << "  } // end of big switch.\n\n"
-     << "  if (N->getOpcode() != ISD::INTRINSIC_W_CHAIN &&\n"
-     << "      N->getOpcode() != ISD::INTRINSIC_WO_CHAIN &&\n"
-     << "      N->getOpcode() != ISD::INTRINSIC_VOID) {\n"
-     << "    CannotYetSelect(N);\n"
-     << "  } else {\n"
-     << "    CannotYetSelectIntrinsic(N);\n"
-     << "  }\n"
+     << "  CannotYetSelect(N);\n"
      << "  return NULL;\n"
      << "}\n\n";
 }