reimplement the regex matching strategy by building a single
[oota-llvm.git] / utils / TableGen / DAGISelEmitter.cpp
index b116aa20c3b645329c47d0e82c1c09a40392dc63..d4cd1661d7f74becd4bc832bba9796d3325043c7 100644 (file)
@@ -1776,7 +1776,7 @@ void DAGISelEmitter::EmitInstructionSelector(raw_ostream &OS) {
           CallerCode += ", " + TargetOpcodes[j];
         }
         for (unsigned j = 0, e = TargetVTs.size(); j != e; ++j) {
-          CalleeCode += ", EVT VT" + utostr(j);
+          CalleeCode += ", MVT::SimpleValueType VT" + utostr(j);
           CallerCode += ", " + TargetVTs[j];
         }
         for (std::set<std::string>::iterator
@@ -1957,23 +1957,6 @@ void DAGISelEmitter::EmitInstructionSelector(raw_ostream &OS) {
      << "                              MVT::Other, Tmp, Chain);\n"
      << "}\n\n";
 
-  OS << "SDNode *Select_DECLARE(const SDValue &N) {\n"
-     << "  SDValue Chain = N.getOperand(0);\n"
-     << "  SDValue N1 = N.getOperand(1);\n"
-     << "  SDValue N2 = N.getOperand(2);\n"
-     << "  if (!isa<FrameIndexSDNode>(N1) || !isa<GlobalAddressSDNode>(N2)) {\n"
-     << "    CannotYetSelect(N);\n"
-     << "  }\n"
-     << "  int FI = cast<FrameIndexSDNode>(N1)->getIndex();\n"
-     << "  GlobalValue *GV = cast<GlobalAddressSDNode>(N2)->getGlobal();\n"
-     << "  SDValue Tmp1 = "
-     << "CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy());\n"
-     << "  SDValue Tmp2 = "
-     << "CurDAG->getTargetGlobalAddress(GV, TLI.getPointerTy());\n"
-     << "  return CurDAG->SelectNodeTo(N.getNode(), TargetInstrInfo::DECLARE,\n"
-     << "                              MVT::Other, Tmp1, Tmp2, Chain);\n"
-     << "}\n\n";
-
   OS << "// The main instruction selector code.\n"
      << "SDNode *SelectCode(SDValue N) {\n"
      << "  MVT::SimpleValueType NVT = N.getNode()->getValueType(0).getSimpleVT().SimpleTy;\n"
@@ -2007,7 +1990,6 @@ void DAGISelEmitter::EmitInstructionSelector(raw_ostream &OS) {
      << "  case ISD::INLINEASM: return Select_INLINEASM(N);\n"
      << "  case ISD::DBG_LABEL: return Select_DBG_LABEL(N);\n"
      << "  case ISD::EH_LABEL: return Select_EH_LABEL(N);\n"
-     << "  case ISD::DECLARE: return Select_DECLARE(N);\n"
      << "  case ISD::UNDEF: return Select_UNDEF(N);\n";
 
   // Loop over all of the case statements, emiting a call to each method we
@@ -2089,7 +2071,7 @@ void DAGISelEmitter::EmitInstructionSelector(raw_ostream &OS) {
      << "}\n\n";
 
   OS << "void CannotYetSelectIntrinsic(SDValue N) DISABLE_INLINE {\n"
-     << "  cerr << \"Cannot yet select: \";\n"
+     << "  errs() << \"Cannot yet select: \";\n"
      << "  unsigned iid = cast<ConstantSDNode>(N.getOperand("
      << "N.getOperand(0).getValueType() == MVT::Other))->getZExtValue();\n"
      << " llvm_report_error(\"Cannot yet select: intrinsic %\" +\n"
@@ -2112,12 +2094,12 @@ void DAGISelEmitter::run(raw_ostream &OS) {
   EmitNodeTransforms(OS);
   EmitPredicateFunctions(OS);
   
-  DOUT << "\n\nALL PATTERNS TO MATCH:\n\n";
+  DEBUG(errs() << "\n\nALL PATTERNS TO MATCH:\n\n");
   for (CodeGenDAGPatterns::ptm_iterator I = CGP.ptm_begin(), E = CGP.ptm_end();
        I != E; ++I) {
-    DOUT << "PATTERN: ";   DEBUG(I->getSrcPattern()->dump());
-    DOUT << "\nRESULT:  "; DEBUG(I->getDstPattern()->dump());
-    DOUT << "\n";
+    DEBUG(errs() << "PATTERN: ";   I->getSrcPattern()->dump());
+    DEBUG(errs() << "\nRESULT:  "; I->getDstPattern()->dump());
+    DEBUG(errs() << "\n");
   }
   
   // At this point, we have full information about the 'Patterns' we need to