diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-25 01:57:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-25 01:57:41 +0000 |
commit | 06158406c5d0ba49ed3840bce382a3b502a3fdea (patch) | |
tree | 67ca38e639822cc78e24edd08c292bf8a8ee451c | |
parent | 60df53e30a7e39c884f4ca4eb03346bea5825109 (diff) | |
download | external_llvm-06158406c5d0ba49ed3840bce382a3b502a3fdea.zip external_llvm-06158406c5d0ba49ed3840bce382a3b502a3fdea.tar.gz external_llvm-06158406c5d0ba49ed3840bce382a3b502a3fdea.tar.bz2 |
add some noop code to push it out of my tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97094 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | utils/TableGen/DAGISelMatcherOpt.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/utils/TableGen/DAGISelMatcherOpt.cpp b/utils/TableGen/DAGISelMatcherOpt.cpp index 623d870..48396cd 100644 --- a/utils/TableGen/DAGISelMatcherOpt.cpp +++ b/utils/TableGen/DAGISelMatcherOpt.cpp @@ -53,8 +53,31 @@ static void ContractNodes(OwningPtr<MatcherNode> &MatcherPtr) { ContractNodes(N->getNextPtr()); } +static void FactorNodes(OwningPtr<MatcherNode> &MatcherPtr) { + // If we reached the end of the chain, we're done. + MatcherNode *N = MatcherPtr.get(); + if (N == 0) return; + + // If this is not a push node, just scan for one. + if (!isa<ScopeMatcherNode>(N)) + return FactorNodes(N->getNextPtr()); + + // Okay, pull together the series of linear push nodes into a vector so we can + // inspect it more easily. + SmallVector<MatcherNode*, 32> OptionsToMatch; + + MatcherNode *CurNode = N; + for (; ScopeMatcherNode *PMN = dyn_cast<ScopeMatcherNode>(CurNode); + CurNode = PMN->getNext()) + OptionsToMatch.push_back(PMN->getCheck()); + OptionsToMatch.push_back(CurNode); + + +} + MatcherNode *llvm::OptimizeMatcher(MatcherNode *Matcher) { OwningPtr<MatcherNode> MatcherPtr(Matcher); ContractNodes(MatcherPtr); + FactorNodes(MatcherPtr); return MatcherPtr.take(); } |