forked from OSchip/llvm-project
parent
499e33646e
commit
abb430bad2
|
@ -1001,8 +1001,24 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
|
||||||
<< " case ISD::AssertZext:\n"
|
<< " case ISD::AssertZext:\n"
|
||||||
<< " return Select(N->getOperand(0));\n";
|
<< " return Select(N->getOperand(0));\n";
|
||||||
|
|
||||||
|
// Group the patterns by their top-level opcodes.
|
||||||
|
std::map<Record*, std::vector<PatternToMatch*> > PatternsByOpcode;
|
||||||
|
for (unsigned i = 0, e = PatternsToMatch.size(); i != e; ++i)
|
||||||
|
PatternsByOpcode[PatternsToMatch[i].first->getOperator()]
|
||||||
|
.push_back(&PatternsToMatch[i]);
|
||||||
|
|
||||||
|
for (std::map<Record*, std::vector<PatternToMatch*> >::iterator
|
||||||
|
PBOI = PatternsByOpcode.begin(), E = PatternsByOpcode.end(); PBOI != E;
|
||||||
|
++PBOI) {
|
||||||
|
const SDNodeInfo &OpcodeInfo = getSDNodeInfo(PBOI->first);
|
||||||
|
std::vector<PatternToMatch*> &Patterns = PBOI->second;
|
||||||
|
|
||||||
|
OS << " case " << OpcodeInfo.getEnumName() << ":\n";
|
||||||
|
|
||||||
|
OS << " break;\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
OS << " } // end of big switch.\n\n"
|
OS << " } // end of big switch.\n\n"
|
||||||
<< " std::cerr << \"Cannot yet select: \";\n"
|
<< " std::cerr << \"Cannot yet select: \";\n"
|
||||||
<< " N->dump();\n"
|
<< " N->dump();\n"
|
||||||
|
|
|
@ -325,7 +325,8 @@ class DAGISelEmitter : public TableGenBackend {
|
||||||
/// PatternsToMatch - All of the things we are matching on the DAG. The first
|
/// PatternsToMatch - All of the things we are matching on the DAG. The first
|
||||||
/// value is the pattern to match, the second pattern is the result to
|
/// value is the pattern to match, the second pattern is the result to
|
||||||
/// emit.
|
/// emit.
|
||||||
std::vector<std::pair<TreePatternNode*, TreePatternNode*> > PatternsToMatch;
|
typedef std::pair<TreePatternNode*, TreePatternNode*> PatternToMatch;
|
||||||
|
std::vector<PatternToMatch> PatternsToMatch;
|
||||||
public:
|
public:
|
||||||
DAGISelEmitter(RecordKeeper &R) : Records(R) {}
|
DAGISelEmitter(RecordKeeper &R) : Records(R) {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue