Lines Matching refs:Matcher
1 //===- DAGISelMatcherEmitter.cpp - Matcher Emitter ------------------------===//
10 // This file contains code to generate C++ code for a matcher.
54 unsigned EmitMatcherList(const Matcher *N, unsigned Indent,
59 void EmitHistogram(const Matcher *N, formatted_raw_ostream &OS);
61 unsigned EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
135 /// EmitMatcherOpcodes - Emit bytes for the specified matcher and return
138 EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
143 case Matcher::Scope: {
205 case Matcher::RecordNode:
214 case Matcher::RecordChild:
224 case Matcher::RecordMemRef:
228 case Matcher::CaptureGlueInput:
232 case Matcher::MoveChild:
236 case Matcher::MoveParent:
240 case Matcher::CheckSame:
245 case Matcher::CheckPatternPredicate: {
253 case Matcher::CheckPredicate: {
262 case Matcher::CheckOpcode:
267 case Matcher::SwitchOpcode:
268 case Matcher::SwitchType: {
285 // For each case we emit the size, then the opcode, then the matcher.
287 const Matcher *Child;
353 case Matcher::CheckType:
360 case Matcher::CheckChildType:
366 case Matcher::CheckInteger: {
372 case Matcher::CheckCondCode:
377 case Matcher::CheckValueType:
382 case Matcher::CheckComplexPat: {
401 case Matcher::CheckAndImm: {
408 case Matcher::CheckOrImm: {
415 case Matcher::CheckFoldableChainNode:
419 case Matcher::EmitInteger: {
427 case Matcher::EmitStringInteger: {
436 case Matcher::EmitRegister: {
437 const EmitRegisterMatcher *Matcher = cast<EmitRegisterMatcher>(N);
438 const CodeGenRegister *Reg = Matcher->getReg();
442 OS << "OPC_EmitRegister2, " << getEnumName(Matcher->getVT()) << ", ";
446 OS << "OPC_EmitRegister, " << getEnumName(Matcher->getVT()) << ", ";
459 case Matcher::EmitConvertToTarget:
464 case Matcher::EmitMergeInputChains: {
480 case Matcher::EmitCopyToReg:
486 case Matcher::EmitNodeXForm: {
496 case Matcher::EmitNode:
497 case Matcher::MorphNodeTo: {
549 case Matcher::MarkGlueResults: {
558 case Matcher::CompleteMatch: {
580 /// EmitMatcherList - Emit the bytes for the specified matcher subtree.
582 EmitMatcherList(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
710 static void BuildHistogram(const Matcher *M, std::vector<unsigned> &OpcodeFreq){
732 void MatcherTableEmitter::EmitHistogram(const Matcher *M,
743 switch ((Matcher::KindTy)i) {
744 case Matcher::Scope: OS << "OPC_Scope"; break;
745 case Matcher::RecordNode: OS << "OPC_RecordNode"; break;
746 case Matcher::RecordChild: OS << "OPC_RecordChild"; break;
747 case Matcher::RecordMemRef: OS << "OPC_RecordMemRef"; break;
748 case Matcher::CaptureGlueInput: OS << "OPC_CaptureGlueInput"; break;
749 case Matcher::MoveChild: OS << "OPC_MoveChild"; break;
750 case Matcher::MoveParent: OS << "OPC_MoveParent"; break;
751 case Matcher::CheckSame: OS << "OPC_CheckSame"; break;
752 case Matcher::CheckPatternPredicate:
754 case Matcher::CheckPredicate: OS << "OPC_CheckPredicate"; break;
755 case Matcher::CheckOpcode: OS << "OPC_CheckOpcode"; break;
756 case Matcher::SwitchOpcode: OS << "OPC_SwitchOpcode"; break;
757 case Matcher::CheckType: OS << "OPC_CheckType"; break;
758 case Matcher::SwitchType: OS << "OPC_SwitchType"; break;
759 case Matcher::CheckChildType: OS << "OPC_CheckChildType"; break;
760 case Matcher::CheckInteger: OS << "OPC_CheckInteger"; break;
761 case Matcher::CheckCondCode: OS << "OPC_CheckCondCode"; break;
762 case Matcher::CheckValueType: OS << "OPC_CheckValueType"; break;
763 case Matcher::CheckComplexPat: OS << "OPC_CheckComplexPat"; break;
764 case Matcher::CheckAndImm: OS << "OPC_CheckAndImm"; break;
765 case Matcher::CheckOrImm: OS << "OPC_CheckOrImm"; break;
766 case Matcher::CheckFoldableChainNode:
768 case Matcher::EmitInteger: OS << "OPC_EmitInteger"; break;
769 case Matcher::EmitStringInteger: OS << "OPC_EmitStringInteger"; break;
770 case Matcher::EmitRegister: OS << "OPC_EmitRegister"; break;
771 case Matcher::EmitConvertToTarget: OS << "OPC_EmitConvertToTarget"; break;
772 case Matcher::EmitMergeInputChains: OS << "OPC_EmitMergeInputChains"; break;
773 case Matcher::EmitCopyToReg: OS << "OPC_EmitCopyToReg"; break;
774 case Matcher::EmitNode: OS << "OPC_EmitNode"; break;
775 case Matcher::MorphNodeTo: OS << "OPC_MorphNodeTo"; break;
776 case Matcher::EmitNodeXForm: OS << "OPC_EmitNodeXForm"; break;
777 case Matcher::MarkGlueResults: OS << "OPC_MarkGlueResults"; break;
778 case Matcher::CompleteMatch: OS << "OPC_CompleteMatch"; break;
787 void llvm::EmitMatcherTable(const Matcher *TheMatcher,