X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FDAGISelMatcherEmitter.cpp;h=c6addd8b0db4ee713f8ff64e245493ff7b1a30d9;hb=ff7fb60f2a7e2f3efd54df6480aadcb4adf5cab7;hp=290c8d4f8f88ba4ade7738141d13a7d72c0bb894;hpb=60df53e30a7e39c884f4ca4eb03346bea5825109;p=oota-llvm.git diff --git a/utils/TableGen/DAGISelMatcherEmitter.cpp b/utils/TableGen/DAGISelMatcherEmitter.cpp index 290c8d4f8f8..c6addd8b0db 100644 --- a/utils/TableGen/DAGISelMatcherEmitter.cpp +++ b/utils/TableGen/DAGISelMatcherEmitter.cpp @@ -81,14 +81,14 @@ class MatcherTableEmitter { public: MatcherTableEmitter() {} - unsigned EmitMatcherList(const MatcherNode *N, unsigned Indent, + unsigned EmitMatcherList(const Matcher *N, unsigned Indent, unsigned StartIdx, formatted_raw_ostream &OS); void EmitPredicateFunctions(formatted_raw_ostream &OS); void EmitHistogram(formatted_raw_ostream &OS); private: - unsigned EmitMatcher(const MatcherNode *N, unsigned Indent, + unsigned EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx, formatted_raw_ostream &OS); unsigned getNodePredicate(StringRef PredName) { @@ -129,6 +129,17 @@ private: }; } // end anonymous namespace. +static unsigned GetVBRSize(unsigned Val) { + if (Val <= 127) return 1; + + unsigned NumBytes = 0; + while (Val >= 128) { + Val >>= 7; + ++NumBytes; + } + return NumBytes+1; +} + /// EmitVBRValue - Emit the specified value as a VBR, returning the number of /// bytes emitted. static unsigned EmitVBRValue(unsigned Val, raw_ostream &OS) { @@ -151,101 +162,153 @@ static unsigned EmitVBRValue(unsigned Val, raw_ostream &OS) { /// EmitMatcherOpcodes - Emit bytes for the specified matcher and return /// the number of bytes emitted. unsigned MatcherTableEmitter:: -EmitMatcher(const MatcherNode *N, unsigned Indent, formatted_raw_ostream &OS) { +EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx, + formatted_raw_ostream &OS) { OS.PadToColumn(Indent*2); switch (N->getKind()) { - case MatcherNode::Scope: assert(0 && "Should be handled by caller"); - case MatcherNode::RecordNode: + case Matcher::Scope: { + const ScopeMatcher *SM = cast(N); + assert(SM->getNext() == 0 && "Shouldn't have next after scope"); + + unsigned StartIdx = CurrentIdx; + + // Emit all of the children. + for (unsigned i = 0, e = SM->getNumChildren(); i != e; ++i) { + if (i == 0) { + OS << "OPC_Scope, "; + ++CurrentIdx; + } else { + OS << "/*" << CurrentIdx << "*/"; + OS.PadToColumn(Indent*2) << "/*Scope*/ "; + } + + // We need to encode the child and the offset of the failure code before + // emitting either of them. Handle this by buffering the output into a + // string while we get the size. Unfortunately, the offset of the + // children depends on the VBR size of the child, so for large children we + // have to iterate a bit. + SmallString<128> TmpBuf; + unsigned ChildSize = 0; + unsigned VBRSize = 0; + do { + VBRSize = GetVBRSize(ChildSize); + + TmpBuf.clear(); + raw_svector_ostream OS(TmpBuf); + formatted_raw_ostream FOS(OS); + ChildSize = EmitMatcherList(cast(N)->getChild(i), + Indent+1, CurrentIdx+VBRSize, FOS); + } while (GetVBRSize(ChildSize) != VBRSize); + + assert(ChildSize != 0 && "Should not have a zero-sized child!"); + + CurrentIdx += EmitVBRValue(ChildSize, OS); + OS << "/*->" << CurrentIdx+ChildSize << "*/"; + + if (i == 0) + OS.PadToColumn(CommentIndent) << "// " << SM->getNumChildren() + << " children in Scope"; + + OS << '\n' << TmpBuf.str(); + CurrentIdx += ChildSize; + } + + // Emit a zero as a sentinel indicating end of 'Scope'. + OS << "/*" << CurrentIdx << "*/"; + OS.PadToColumn(Indent*2) << "0, /*End of Scope*/\n"; + return CurrentIdx - StartIdx + 1; + } + + case Matcher::RecordNode: OS << "OPC_RecordNode,"; OS.PadToColumn(CommentIndent) << "// " - << cast(N)->getWhatFor() << '\n'; + << cast(N)->getWhatFor() << '\n'; return 1; - case MatcherNode::RecordChild: - OS << "OPC_RecordChild" << cast(N)->getChildNo() + case Matcher::RecordChild: + OS << "OPC_RecordChild" << cast(N)->getChildNo() << ','; OS.PadToColumn(CommentIndent) << "// " - << cast(N)->getWhatFor() << '\n'; + << cast(N)->getWhatFor() << '\n'; return 1; - case MatcherNode::RecordMemRef: + case Matcher::RecordMemRef: OS << "OPC_RecordMemRef,\n"; return 1; - case MatcherNode::CaptureFlagInput: + case Matcher::CaptureFlagInput: OS << "OPC_CaptureFlagInput,\n"; return 1; - case MatcherNode::MoveChild: - OS << "OPC_MoveChild, " - << cast(N)->getChildNo() << ",\n"; + case Matcher::MoveChild: + OS << "OPC_MoveChild, " << cast(N)->getChildNo() << ",\n"; return 2; - case MatcherNode::MoveParent: + case Matcher::MoveParent: OS << "OPC_MoveParent,\n"; return 1; - case MatcherNode::CheckSame: + case Matcher::CheckSame: OS << "OPC_CheckSame, " - << cast(N)->getMatchNumber() << ",\n"; + << cast(N)->getMatchNumber() << ",\n"; return 2; - case MatcherNode::CheckPatternPredicate: { - StringRef Pred = cast(N)->getPredicate(); + case Matcher::CheckPatternPredicate: { + StringRef Pred = cast(N)->getPredicate(); OS << "OPC_CheckPatternPredicate, " << getPatternPredicate(Pred) << ','; OS.PadToColumn(CommentIndent) << "// " << Pred << '\n'; return 2; } - case MatcherNode::CheckPredicate: { - StringRef Pred = cast(N)->getPredicateName(); + case Matcher::CheckPredicate: { + StringRef Pred = cast(N)->getPredicateName(); OS << "OPC_CheckPredicate, " << getNodePredicate(Pred) << ','; OS.PadToColumn(CommentIndent) << "// " << Pred << '\n'; return 2; } - case MatcherNode::CheckOpcode: + case Matcher::CheckOpcode: OS << "OPC_CheckOpcode, " - << cast(N)->getOpcodeName() << ",\n"; + << cast(N)->getOpcode().getEnumName() << ",\n"; return 2; - case MatcherNode::CheckMultiOpcode: { - const CheckMultiOpcodeMatcherNode *CMO=cast(N); - OS << "OPC_CheckMultiOpcode, " << CMO->getNumOpcodeNames() << ", "; - for (unsigned i = 0, e = CMO->getNumOpcodeNames(); i != e; ++i) - OS << CMO->getOpcodeName(i) << ", "; + case Matcher::CheckMultiOpcode: { + const CheckMultiOpcodeMatcher *CMO = cast(N); + OS << "OPC_CheckMultiOpcode, " << CMO->getNumOpcodes() << ", "; + for (unsigned i = 0, e = CMO->getNumOpcodes(); i != e; ++i) + OS << CMO->getOpcode(i).getEnumName() << ", "; OS << '\n'; - return 2 + CMO->getNumOpcodeNames(); + return 2 + CMO->getNumOpcodes(); } - case MatcherNode::CheckType: + case Matcher::CheckType: OS << "OPC_CheckType, " - << getEnumName(cast(N)->getType()) << ",\n"; + << getEnumName(cast(N)->getType()) << ",\n"; return 2; - case MatcherNode::CheckChildType: + case Matcher::CheckChildType: OS << "OPC_CheckChild" - << cast(N)->getChildNo() << "Type, " - << getEnumName(cast(N)->getType()) << ",\n"; + << cast(N)->getChildNo() << "Type, " + << getEnumName(cast(N)->getType()) << ",\n"; return 2; - case MatcherNode::CheckInteger: { - int64_t Val = cast(N)->getValue(); + case Matcher::CheckInteger: { + int64_t Val = cast(N)->getValue(); OS << "OPC_CheckInteger" << ClassifyInt(Val) << ", "; return EmitInt(Val, OS)+1; } - case MatcherNode::CheckCondCode: + case Matcher::CheckCondCode: OS << "OPC_CheckCondCode, ISD::" - << cast(N)->getCondCodeName() << ",\n"; + << cast(N)->getCondCodeName() << ",\n"; return 2; - case MatcherNode::CheckValueType: + case Matcher::CheckValueType: OS << "OPC_CheckValueType, MVT::" - << cast(N)->getTypeName() << ",\n"; + << cast(N)->getTypeName() << ",\n"; return 2; - case MatcherNode::CheckComplexPat: { + case Matcher::CheckComplexPat: { const ComplexPattern &Pattern = - cast(N)->getPattern(); + cast(N)->getPattern(); OS << "OPC_CheckComplexPat, " << getComplexPat(Pattern) << ','; OS.PadToColumn(CommentIndent) << "// " << Pattern.getSelectFunc(); OS << ": " << Pattern.getNumOperands() << " operands"; @@ -255,83 +318,86 @@ EmitMatcher(const MatcherNode *N, unsigned Indent, formatted_raw_ostream &OS) { return 2; } - case MatcherNode::CheckAndImm: { - int64_t Val = cast(N)->getValue(); + case Matcher::CheckAndImm: { + int64_t Val = cast(N)->getValue(); OS << "OPC_CheckAndImm" << ClassifyInt(Val) << ", "; return EmitInt(Val, OS)+1; } - case MatcherNode::CheckOrImm: { - int64_t Val = cast(N)->getValue(); + case Matcher::CheckOrImm: { + int64_t Val = cast(N)->getValue(); OS << "OPC_CheckOrImm" << ClassifyInt(Val) << ", "; return EmitInt(Val, OS)+1; } - case MatcherNode::CheckFoldableChainNode: + case Matcher::CheckFoldableChainNode: OS << "OPC_CheckFoldableChainNode,\n"; return 1; - case MatcherNode::CheckChainCompatible: + case Matcher::CheckChainCompatible: OS << "OPC_CheckChainCompatible, " - << cast(N)->getPreviousOp() << ",\n"; + << cast(N)->getPreviousOp() << ",\n"; return 2; - case MatcherNode::EmitInteger: { - int64_t Val = cast(N)->getValue(); + case Matcher::EmitInteger: { + int64_t Val = cast(N)->getValue(); OS << "OPC_EmitInteger" << ClassifyInt(Val) << ", " - << getEnumName(cast(N)->getVT()) << ", "; + << getEnumName(cast(N)->getVT()) << ", "; return EmitInt(Val, OS)+2; } - case MatcherNode::EmitStringInteger: { - const std::string &Val = cast(N)->getValue(); + case Matcher::EmitStringInteger: { + const std::string &Val = cast(N)->getValue(); // These should always fit into one byte. OS << "OPC_EmitInteger1, " - << getEnumName(cast(N)->getVT()) << ", " + << getEnumName(cast(N)->getVT()) << ", " << Val << ",\n"; return 3; } - case MatcherNode::EmitRegister: + case Matcher::EmitRegister: OS << "OPC_EmitRegister, " - << getEnumName(cast(N)->getVT()) << ", "; - if (Record *R = cast(N)->getReg()) + << getEnumName(cast(N)->getVT()) << ", "; + if (Record *R = cast(N)->getReg()) OS << getQualifiedName(R) << ",\n"; else OS << "0 /*zero_reg*/,\n"; return 3; - case MatcherNode::EmitConvertToTarget: + case Matcher::EmitConvertToTarget: OS << "OPC_EmitConvertToTarget, " - << cast(N)->getSlot() << ",\n"; + << cast(N)->getSlot() << ",\n"; return 2; - case MatcherNode::EmitMergeInputChains: { - const EmitMergeInputChainsMatcherNode *MN = - cast(N); + case Matcher::EmitMergeInputChains: { + const EmitMergeInputChainsMatcher *MN = + cast(N); OS << "OPC_EmitMergeInputChains, " << MN->getNumNodes() << ", "; for (unsigned i = 0, e = MN->getNumNodes(); i != e; ++i) OS << MN->getNode(i) << ", "; OS << '\n'; return 2+MN->getNumNodes(); } - case MatcherNode::EmitCopyToReg: + case Matcher::EmitCopyToReg: OS << "OPC_EmitCopyToReg, " - << cast(N)->getSrcSlot() << ", " - << getQualifiedName(cast(N)->getDestPhysReg()) + << cast(N)->getSrcSlot() << ", " + << getQualifiedName(cast(N)->getDestPhysReg()) << ",\n"; return 3; - case MatcherNode::EmitNodeXForm: { - const EmitNodeXFormMatcherNode *XF = cast(N); + case Matcher::EmitNodeXForm: { + const EmitNodeXFormMatcher *XF = cast(N); OS << "OPC_EmitNodeXForm, " << getNodeXFormID(XF->getNodeXForm()) << ", " << XF->getSlot() << ','; OS.PadToColumn(CommentIndent) << "// "<getNodeXForm()->getName()<<'\n'; return 3; } - case MatcherNode::EmitNode: { - const EmitNodeMatcherNode *EN = cast(N); - OS << "OPC_EmitNode, TARGET_OPCODE(" << EN->getOpcodeName() << "), 0"; + case Matcher::EmitNode: + case Matcher::MorphNodeTo: { + const EmitNodeMatcherCommon *EN = cast(N); + OS << (isa(EN) ? "OPC_EmitNode" : "OPC_MorphNodeTo"); + OS << ", TARGET_OPCODE(" << EN->getOpcodeName() << "), 0"; if (EN->hasChain()) OS << "|OPFL_Chain"; - if (EN->hasFlag()) OS << "|OPFL_Flag"; + if (EN->hasInFlag()) OS << "|OPFL_FlagInput"; + if (EN->hasOutFlag()) OS << "|OPFL_FlagOutput"; if (EN->hasMemRefs()) OS << "|OPFL_MemRefs"; if (EN->getNumFixedArityOperands() != -1) OS << "|OPFL_Variadic" << EN->getNumFixedArityOperands(); @@ -348,11 +414,30 @@ EmitMatcher(const MatcherNode *N, unsigned Indent, formatted_raw_ostream &OS) { // is too large to represent with a byte. NumOperandBytes += EmitVBRValue(EN->getOperand(i), OS); } + + // Print the result #'s for EmitNode. + if (const EmitNodeMatcher *E = dyn_cast(EN)) { + if (unsigned NumResults = EN->getNumNonChainFlagVTs()) { + OS.PadToColumn(CommentIndent) << "// Results = "; + unsigned First = E->getFirstResultSlot(); + for (unsigned i = 0; i != NumResults; ++i) + OS << "#" << First+i << " "; + } + } OS << '\n'; + + if (const MorphNodeToMatcher *SNT = dyn_cast(N)) { + OS.PadToColumn(Indent*2) << "// Src: " + << *SNT->getPattern().getSrcPattern() << '\n'; + OS.PadToColumn(Indent*2) << "// Dst: " + << *SNT->getPattern().getDstPattern() << '\n'; + + } + return 6+EN->getNumVTs()+NumOperandBytes; } - case MatcherNode::MarkFlagResults: { - const MarkFlagResultsMatcherNode *CFR = cast(N); + case Matcher::MarkFlagResults: { + const MarkFlagResultsMatcher *CFR = cast(N); OS << "OPC_MarkFlagResults, " << CFR->getNumNodes() << ", "; unsigned NumOperandBytes = 0; for (unsigned i = 0, e = CFR->getNumNodes(); i != e; ++i) @@ -360,8 +445,8 @@ EmitMatcher(const MatcherNode *N, unsigned Indent, formatted_raw_ostream &OS) { OS << '\n'; return 2+NumOperandBytes; } - case MatcherNode::CompleteMatch: { - const CompleteMatchMatcherNode *CM = cast(N); + case Matcher::CompleteMatch: { + const CompleteMatchMatcher *CM = cast(N); OS << "OPC_CompleteMatch, " << CM->getNumResults() << ", "; unsigned NumResultBytes = 0; for (unsigned i = 0, e = CM->getNumResults(); i != e; ++i) @@ -380,7 +465,7 @@ EmitMatcher(const MatcherNode *N, unsigned Indent, formatted_raw_ostream &OS) { /// EmitMatcherList - Emit the bytes for the specified matcher subtree. unsigned MatcherTableEmitter:: -EmitMatcherList(const MatcherNode *N, unsigned Indent, unsigned CurrentIdx, +EmitMatcherList(const Matcher *N, unsigned Indent, unsigned CurrentIdx, formatted_raw_ostream &OS) { unsigned Size = 0; while (N) { @@ -388,52 +473,8 @@ EmitMatcherList(const MatcherNode *N, unsigned Indent, unsigned CurrentIdx, Histogram.resize(N->getKind()+1); Histogram[N->getKind()]++; - // Scope is a special case since it is binary. - if (const ScopeMatcherNode *SMN = dyn_cast(N)) { - // We need to encode the child and the offset of the failure code before - // emitting either of them. Handle this by buffering the output into a - // string while we get the size. - SmallString<128> TmpBuf; - unsigned NextSize; - { - raw_svector_ostream OS(TmpBuf); - formatted_raw_ostream FOS(OS); - NextSize = EmitMatcherList(cast(N)->getCheck(), - Indent+1, CurrentIdx+2, FOS); - } - - // In the unlikely event that we have something too big to emit with a - // one byte offset, regenerate it with a two-byte one. - if (NextSize > 255) { - TmpBuf.clear(); - raw_svector_ostream OS(TmpBuf); - formatted_raw_ostream FOS(OS); - NextSize = EmitMatcherList(cast(N)->getCheck(), - Indent+1, CurrentIdx+3, FOS); - if (NextSize > 65535) { - errs() << - "Tblgen internal error: can't handle pattern this complex yet\n"; - exit(1); - } - } - - OS << "/*" << CurrentIdx << "*/"; - OS.PadToColumn(Indent*2); - - if (NextSize < 256) - OS << "OPC_Scope, " << NextSize << ",\n"; - else - OS << "OPC_Scope2, " << (NextSize&255) << ", " << (NextSize>>8) <<",\n"; - OS << TmpBuf.str(); - - Size += 2+NextSize; - CurrentIdx += 2+NextSize; - N = SMN->getNext(); - continue; - } - OS << "/*" << CurrentIdx << "*/"; - unsigned MatcherSize = EmitMatcher(N, Indent, OS); + unsigned MatcherSize = EmitMatcher(N, Indent, CurrentIdx, OS); Size += MatcherSize; CurrentIdx += MatcherSize; @@ -513,44 +554,42 @@ void MatcherTableEmitter::EmitHistogram(formatted_raw_ostream &OS) { OS << " // Opcode Histogram:\n"; for (unsigned i = 0, e = Histogram.size(); i != e; ++i) { OS << " // #"; - switch ((MatcherNode::KindTy)i) { - case MatcherNode::Scope: OS << "OPC_Scope"; break; - case MatcherNode::RecordNode: OS << "OPC_RecordNode"; break; - case MatcherNode::RecordChild: OS << "OPC_RecordChild"; break; - case MatcherNode::RecordMemRef: OS << "OPC_RecordMemRef"; break; - case MatcherNode::CaptureFlagInput: OS << "OPC_CaptureFlagInput"; break; - case MatcherNode::MoveChild: OS << "OPC_MoveChild"; break; - case MatcherNode::MoveParent: OS << "OPC_MoveParent"; break; - case MatcherNode::CheckSame: OS << "OPC_CheckSame"; break; - case MatcherNode::CheckPatternPredicate: + switch ((Matcher::KindTy)i) { + case Matcher::Scope: OS << "OPC_Scope"; break; + case Matcher::RecordNode: OS << "OPC_RecordNode"; break; + case Matcher::RecordChild: OS << "OPC_RecordChild"; break; + case Matcher::RecordMemRef: OS << "OPC_RecordMemRef"; break; + case Matcher::CaptureFlagInput: OS << "OPC_CaptureFlagInput"; break; + case Matcher::MoveChild: OS << "OPC_MoveChild"; break; + case Matcher::MoveParent: OS << "OPC_MoveParent"; break; + case Matcher::CheckSame: OS << "OPC_CheckSame"; break; + case Matcher::CheckPatternPredicate: OS << "OPC_CheckPatternPredicate"; break; - case MatcherNode::CheckPredicate: OS << "OPC_CheckPredicate"; break; - case MatcherNode::CheckOpcode: OS << "OPC_CheckOpcode"; break; - case MatcherNode::CheckMultiOpcode: OS << "OPC_CheckMultiOpcode"; break; - case MatcherNode::CheckType: OS << "OPC_CheckType"; break; - case MatcherNode::CheckChildType: OS << "OPC_CheckChildType"; break; - case MatcherNode::CheckInteger: OS << "OPC_CheckInteger"; break; - case MatcherNode::CheckCondCode: OS << "OPC_CheckCondCode"; break; - case MatcherNode::CheckValueType: OS << "OPC_CheckValueType"; break; - case MatcherNode::CheckComplexPat: OS << "OPC_CheckComplexPat"; break; - case MatcherNode::CheckAndImm: OS << "OPC_CheckAndImm"; break; - case MatcherNode::CheckOrImm: OS << "OPC_CheckOrImm"; break; - case MatcherNode::CheckFoldableChainNode: + case Matcher::CheckPredicate: OS << "OPC_CheckPredicate"; break; + case Matcher::CheckOpcode: OS << "OPC_CheckOpcode"; break; + case Matcher::CheckMultiOpcode: OS << "OPC_CheckMultiOpcode"; break; + case Matcher::CheckType: OS << "OPC_CheckType"; break; + case Matcher::CheckChildType: OS << "OPC_CheckChildType"; break; + case Matcher::CheckInteger: OS << "OPC_CheckInteger"; break; + case Matcher::CheckCondCode: OS << "OPC_CheckCondCode"; break; + case Matcher::CheckValueType: OS << "OPC_CheckValueType"; break; + case Matcher::CheckComplexPat: OS << "OPC_CheckComplexPat"; break; + case Matcher::CheckAndImm: OS << "OPC_CheckAndImm"; break; + case Matcher::CheckOrImm: OS << "OPC_CheckOrImm"; break; + case Matcher::CheckFoldableChainNode: OS << "OPC_CheckFoldableChainNode"; break; - case MatcherNode::CheckChainCompatible: - OS << "OPC_CheckChainCompatible"; break; - case MatcherNode::EmitInteger: OS << "OPC_EmitInteger"; break; - case MatcherNode::EmitStringInteger: OS << "OPC_EmitStringInteger"; break; - case MatcherNode::EmitRegister: OS << "OPC_EmitRegister"; break; - case MatcherNode::EmitConvertToTarget: - OS << "OPC_EmitConvertToTarget"; break; - case MatcherNode::EmitMergeInputChains: - OS << "OPC_EmitMergeInputChains"; break; - case MatcherNode::EmitCopyToReg: OS << "OPC_EmitCopyToReg"; break; - case MatcherNode::EmitNode: OS << "OPC_EmitNode"; break; - case MatcherNode::EmitNodeXForm: OS << "OPC_EmitNodeXForm"; break; - case MatcherNode::MarkFlagResults: OS << "OPC_MarkFlagResults"; break; - case MatcherNode::CompleteMatch: OS << "OPC_CompleteMatch"; break; + case Matcher::CheckChainCompatible: OS << "OPC_CheckChainCompatible"; break; + case Matcher::EmitInteger: OS << "OPC_EmitInteger"; break; + case Matcher::EmitStringInteger: OS << "OPC_EmitStringInteger"; break; + case Matcher::EmitRegister: OS << "OPC_EmitRegister"; break; + case Matcher::EmitConvertToTarget: OS << "OPC_EmitConvertToTarget"; break; + case Matcher::EmitMergeInputChains: OS << "OPC_EmitMergeInputChains"; break; + case Matcher::EmitCopyToReg: OS << "OPC_EmitCopyToReg"; break; + case Matcher::EmitNode: OS << "OPC_EmitNode"; break; + case Matcher::MorphNodeTo: OS << "OPC_MorphNodeTo"; break; + case Matcher::EmitNodeXForm: OS << "OPC_EmitNodeXForm"; break; + case Matcher::MarkFlagResults: OS << "OPC_MarkFlagResults"; break; + case Matcher::CompleteMatch: OS << "OPC_CompleteMatch"; break; } OS.PadToColumn(40) << " = " << Histogram[i] << '\n'; @@ -559,7 +598,7 @@ void MatcherTableEmitter::EmitHistogram(formatted_raw_ostream &OS) { } -void llvm::EmitMatcherTable(const MatcherNode *Matcher, raw_ostream &O) { +void llvm::EmitMatcherTable(const Matcher *TheMatcher, raw_ostream &O) { formatted_raw_ostream OS(O); OS << "// The main instruction selector code.\n"; @@ -570,7 +609,7 @@ void llvm::EmitMatcherTable(const MatcherNode *Matcher, raw_ostream &O) { OS << " // Opcodes are emitted as 2 bytes, TARGET_OPCODE handles this.\n"; OS << " #define TARGET_OPCODE(X) X & 255, unsigned(X) >> 8\n"; OS << " static const unsigned char MatcherTable[] = {\n"; - unsigned TotalSize = MatcherEmitter.EmitMatcherList(Matcher, 5, 0, OS); + unsigned TotalSize = MatcherEmitter.EmitMatcherList(TheMatcher, 5, 0, OS); OS << " 0\n }; // Total Array size is " << (TotalSize+1) << " bytes\n\n"; MatcherEmitter.EmitHistogram(OS);