#include <iostream>
using namespace llvm;
+//#define ENABLE_NEW_ISEL
+
+
static cl::opt<bool>
GenDebug("gen-debug", cl::desc("Generate debug code"), cl::init(false));
OS << "// The main instruction selector code.\n"
<< "SDNode *SelectCode(SDNode *N) {\n"
+#ifdef ENABLE_NEW_ISEL
+ << " return SelectCode2(N);\n"
+#endif
<< " MVT::SimpleValueType NVT = N->getValueType(0).getSimpleVT().SimpleTy;\n"
<< " switch (N->getOpcode()) {\n"
<< " default:\n"
// definitions. Emit the resultant instruction selector.
EmitInstructionSelector(OS);
-#if 0
+#ifdef ENABLE_NEW_ISEL
MatcherNode *Matcher = 0;
// Add all the patterns to a temporary list so we can sort them.
Matcher = new PushMatcherNode(N, Matcher);
}
- // OptimizeMatcher(Matcher);
+ OptimizeMatcher(Matcher);
//Matcher->dump();
EmitMatcherTable(Matcher, OS);
delete Matcher;
MatcherNode *ConvertPatternToMatcher(const PatternToMatch &Pattern,
const CodeGenDAGPatterns &CGP);
-
+void OptimizeMatcher(const MatcherNode *Matcher);
void EmitMatcherTable(const MatcherNode *Matcher, raw_ostream &OS);
--- /dev/null
+//===- DAGISelMatcherOpt.cpp - Optimize a DAG Matcher ---------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the DAG Matcher optimizer.
+//
+//===----------------------------------------------------------------------===//
+
+#include "DAGISelMatcher.h"
+using namespace llvm;
+
+void llvm::OptimizeMatcher(const MatcherNode *Matcher) {
+ // Nothing yet.
+}