diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-27 21:48:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-27 21:48:43 +0000 |
commit | a230f9623d864450d432bb76c397b0cb35a3437e (patch) | |
tree | 2be73812f216d3264745af0db51056fe19b32ce6 /utils/TableGen/DAGISelMatcherGen.cpp | |
parent | 9fa200d2a2360412465bbd6cfb485af2e9d5b1b4 (diff) |
change CheckOpcodeMatcher to hold the SDNodeInfo instead of
the opcode name. This gives the optimizer more semantic info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelMatcherGen.cpp')
-rw-r--r-- | utils/TableGen/DAGISelMatcherGen.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/utils/TableGen/DAGISelMatcherGen.cpp b/utils/TableGen/DAGISelMatcherGen.cpp index 1224a1d42c..cae2dfbc59 100644 --- a/utils/TableGen/DAGISelMatcherGen.cpp +++ b/utils/TableGen/DAGISelMatcherGen.cpp @@ -252,14 +252,12 @@ void MatcherGen::EmitLeafMatchCode(const TreePatternNode *N) { if (N == Pattern.getSrcPattern()) { const std::vector<Record*> &OpNodes = CP.getRootNodes(); if (OpNodes.size() == 1) { - StringRef OpName = CGP.getSDNodeInfo(OpNodes[0]).getEnumName(); - AddMatcher(new CheckOpcodeMatcher(OpName)); + AddMatcher(new CheckOpcodeMatcher(CGP.getSDNodeInfo(OpNodes[0]))); } else if (!OpNodes.empty()) { - SmallVector<StringRef, 4> OpNames; + SmallVector<const SDNodeInfo*, 4> OpNames; for (unsigned i = 0, e = OpNodes.size(); i != e; i++) - OpNames.push_back(CGP.getSDNodeInfo(OpNodes[i]).getEnumName()); - AddMatcher(new CheckMultiOpcodeMatcher(OpNames.data(), - OpNames.size())); + OpNames.push_back(&CGP.getSDNodeInfo(OpNodes[i])); + AddMatcher(new CheckMultiOpcodeMatcher(OpNames.data(), OpNames.size())); } } @@ -337,7 +335,7 @@ void MatcherGen::EmitOperatorMatchCode(const TreePatternNode *N, } // Check that the current opcode lines up. - AddMatcher(new CheckOpcodeMatcher(CInfo.getEnumName())); + AddMatcher(new CheckOpcodeMatcher(CInfo)); // If there are node predicates for this node, generate their checks. for (unsigned i = 0, e = N->getPredicateFns().size(); i != e; ++i) |