diff options
Diffstat (limited to 'llvm/utils')
-rw-r--r-- | llvm/utils/TableGen/DAGISelMatcher.cpp | 8 | ||||
-rw-r--r-- | llvm/utils/TableGen/DAGISelMatcher.h | 29 | ||||
-rw-r--r-- | llvm/utils/TableGen/DAGISelMatcherEmitter.cpp | 10 | ||||
-rw-r--r-- | llvm/utils/TableGen/DAGISelMatcherGen.cpp | 11 | ||||
-rw-r--r-- | llvm/utils/TableGen/DAGISelMatcherOpt.cpp | 18 |
5 files changed, 0 insertions, 76 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcher.cpp b/llvm/utils/TableGen/DAGISelMatcher.cpp index 8e1bd749f52..da5fc4da560 100644 --- a/llvm/utils/TableGen/DAGISelMatcher.cpp +++ b/llvm/utils/TableGen/DAGISelMatcher.cpp @@ -277,10 +277,6 @@ void EmitNodeMatcherCommon::printImpl(raw_ostream &OS, unsigned indent) const { OS << ")\n"; } -void MarkGlueResultsMatcher::printImpl(raw_ostream &OS, unsigned indent) const { - OS.indent(indent) << "MarkGlueResults <todo: args>\n"; -} - void CompleteMatchMatcher::printImpl(raw_ostream &OS, unsigned indent) const { OS.indent(indent) << "CompleteMatch <todo args>\n"; OS.indent(indent) << "Src = " << *Pattern.getSrcPattern() << "\n"; @@ -350,10 +346,6 @@ void EmitNodeMatcher::anchor() { } void MorphNodeToMatcher::anchor() { } -unsigned MarkGlueResultsMatcher::getHashImpl() const { - return HashUnsigneds(GlueResultNodes.begin(), GlueResultNodes.end()); -} - unsigned CompleteMatchMatcher::getHashImpl() const { return HashUnsigneds(Results.begin(), Results.end()) ^ ((unsigned)(intptr_t)&Pattern << 8); diff --git a/llvm/utils/TableGen/DAGISelMatcher.h b/llvm/utils/TableGen/DAGISelMatcher.h index a8a6ba5c32e..d1ac0ba53d3 100644 --- a/llvm/utils/TableGen/DAGISelMatcher.h +++ b/llvm/utils/TableGen/DAGISelMatcher.h @@ -82,7 +82,6 @@ public: EmitCopyToReg, // Emit a copytoreg into a physreg. EmitNode, // Create a DAG node EmitNodeXForm, // Run a SDNodeXForm - MarkGlueResults, // Indicate which interior nodes have glue results. CompleteMatch, // Finish a match and update the results. MorphNodeTo // Build a node, finish a match and update results. }; @@ -1116,34 +1115,6 @@ public: } }; -/// MarkGlueResultsMatcher - This node indicates which non-root nodes in the -/// pattern produce glue. This allows CompleteMatchMatcher to update them -/// with the output glue of the resultant code. -class MarkGlueResultsMatcher : public Matcher { - SmallVector<unsigned, 3> GlueResultNodes; -public: - MarkGlueResultsMatcher(ArrayRef<unsigned> nodes) - : Matcher(MarkGlueResults), GlueResultNodes(nodes.begin(), nodes.end()) {} - - unsigned getNumNodes() const { return GlueResultNodes.size(); } - - unsigned getNode(unsigned i) const { - assert(i < GlueResultNodes.size()); - return GlueResultNodes[i]; - } - - static inline bool classof(const Matcher *N) { - return N->getKind() == MarkGlueResults; - } - -private: - void printImpl(raw_ostream &OS, unsigned indent) const override; - bool isEqualImpl(const Matcher *M) const override { - return cast<MarkGlueResultsMatcher>(M)->GlueResultNodes == GlueResultNodes; - } - unsigned getHashImpl() const override; -}; - /// CompleteMatchMatcher - Complete a match by replacing the results of the /// pattern with the newly generated nodes. This also prints a comment /// indicating the source and dest patterns. diff --git a/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp b/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp index 709e0a4d28a..dad45335707 100644 --- a/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp +++ b/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp @@ -595,15 +595,6 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx, return 5 + !CompressVTs + EN->getNumVTs() + NumOperandBytes; } - case Matcher::MarkGlueResults: { - const MarkGlueResultsMatcher *CFR = cast<MarkGlueResultsMatcher>(N); - OS << "OPC_MarkGlueResults, " << CFR->getNumNodes() << ", "; - unsigned NumOperandBytes = 0; - for (unsigned i = 0, e = CFR->getNumNodes(); i != e; ++i) - NumOperandBytes += EmitVBRValue(CFR->getNode(i), OS); - OS << '\n'; - return 2+NumOperandBytes; - } case Matcher::CompleteMatch: { const CompleteMatchMatcher *CM = cast<CompleteMatchMatcher>(N); OS << "OPC_CompleteMatch, " << CM->getNumResults() << ", "; @@ -821,7 +812,6 @@ void MatcherTableEmitter::EmitHistogram(const Matcher *M, case Matcher::EmitNode: OS << "OPC_EmitNode"; break; case Matcher::MorphNodeTo: OS << "OPC_MorphNodeTo"; break; case Matcher::EmitNodeXForm: OS << "OPC_EmitNodeXForm"; break; - case Matcher::MarkGlueResults: OS << "OPC_MarkGlueResults"; break; case Matcher::CompleteMatch: OS << "OPC_CompleteMatch"; break; } diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp index cac11016514..04d8ff0b8e6 100644 --- a/llvm/utils/TableGen/DAGISelMatcherGen.cpp +++ b/llvm/utils/TableGen/DAGISelMatcherGen.cpp @@ -75,10 +75,6 @@ namespace { /// array of all of the recorded input nodes that have chains. SmallVector<unsigned, 2> MatchedChainNodes; - /// MatchedGlueResultNodes - This maintains the position in the recorded - /// nodes array of all of the recorded input nodes that have glue results. - SmallVector<unsigned, 2> MatchedGlueResultNodes; - /// MatchedComplexPatterns - This maintains a list of all of the /// ComplexPatterns that we need to check. The second element of each pair /// is the recorded operand number of the input node. @@ -425,8 +421,6 @@ void MatcherGen::EmitOperatorMatchCode(const TreePatternNode *N, AddMatcher(new RecordMatcher("'" + N->getOperator()->getName() + "' glue output node", NextRecordedOperandNo)); - // Remember all of the nodes with output glue our pattern will match. - MatchedGlueResultNodes.push_back(NextRecordedOperandNo++); } // If this node is known to have an input glue or if it *might* have an input @@ -988,11 +982,6 @@ void MatcherGen::EmitResultCode() { assert(Ops.size() >= NumSrcResults && "Didn't provide enough results"); Ops.resize(NumSrcResults); - // If the matched pattern covers nodes which define a glue result, emit a node - // that tells the matcher about them so that it can update their results. - if (!MatchedGlueResultNodes.empty()) - AddMatcher(new MarkGlueResultsMatcher(MatchedGlueResultNodes)); - AddMatcher(new CompleteMatchMatcher(Ops, Pattern)); } diff --git a/llvm/utils/TableGen/DAGISelMatcherOpt.cpp b/llvm/utils/TableGen/DAGISelMatcherOpt.cpp index a0211edce09..9d17d4a1bc7 100644 --- a/llvm/utils/TableGen/DAGISelMatcherOpt.cpp +++ b/llvm/utils/TableGen/DAGISelMatcherOpt.cpp @@ -78,24 +78,6 @@ static void ContractNodes(std::unique_ptr<Matcher> &MatcherPtr, return ContractNodes(MatcherPtr, CGP); } - // Turn EmitNode->MarkFlagResults->CompleteMatch into - // MarkFlagResults->EmitNode->CompleteMatch when we can to encourage - // MorphNodeTo formation. This is safe because MarkFlagResults never refers - // to the root of the pattern. - if (isa<EmitNodeMatcher>(N) && isa<MarkGlueResultsMatcher>(N->getNext()) && - isa<CompleteMatchMatcher>(N->getNext()->getNext())) { - // Unlink the two nodes from the list. - Matcher *EmitNode = MatcherPtr.release(); - Matcher *MFR = EmitNode->takeNext(); - Matcher *Tail = MFR->takeNext(); - - // Relink them. - MatcherPtr.reset(MFR); - MFR->setNext(EmitNode); - EmitNode->setNext(Tail); - return ContractNodes(MatcherPtr, CGP); - } - // Turn EmitNode->CompleteMatch into MorphNodeTo if we can. if (EmitNodeMatcher *EN = dyn_cast<EmitNodeMatcher>(N)) if (CompleteMatchMatcher *CM = |