summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-04 01:25:36 +0000
committerChris Lattner <sabre@nondot.org>2010-03-04 01:25:36 +0000
commit0e2cedb7625dbc60b72d718769bf56fe68a5285a (patch)
treeb9fdd3f2a2e1486c4b8193841d84b00ddb4a6804 /llvm/utils
parent0acbb71badd565a75a3c41e04908ca0b56717b5f (diff)
downloadbcm5719-llvm-0e2cedb7625dbc60b72d718769bf56fe68a5285a.tar.gz
bcm5719-llvm-0e2cedb7625dbc60b72d718769bf56fe68a5285a.zip
now that complexpatterns are all emitted at the end of the match
sequence, just emit instruction predicates right before them. This exposes yet more factoring opportunitites, shrinking the X86 table to 79144 bytes. llvm-svn: 97704
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/DAGISelMatcherGen.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
index 433da18cecb..783c470f9b6 100644
--- a/llvm/utils/TableGen/DAGISelMatcherGen.cpp
+++ b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
@@ -471,6 +471,9 @@ bool MatcherGen::EmitMatcherCode(unsigned Variant) {
if (Variant != 0) return true;
}
+ // Emit the matcher for the pattern structure and types.
+ EmitMatchCode(Pattern.getSrcPattern(), PatWithNoTypes);
+
// If the pattern has a predicate on it (e.g. only enabled when a subtarget
// feature is around, do the check).
// FIXME: This should get emitted after the match code below to encourage
@@ -479,15 +482,11 @@ bool MatcherGen::EmitMatcherCode(unsigned Variant) {
// X86's MatchAddress.
if (!Pattern.getPredicateCheck().empty())
AddMatcher(new CheckPatternPredicateMatcher(Pattern.getPredicateCheck()));
-
- // Emit the matcher for the pattern structure and types.
- EmitMatchCode(Pattern.getSrcPattern(), PatWithNoTypes);
// Now that we've completed the structural type match, emit any ComplexPattern
// checks (e.g. addrmode matches). We emit this after the structural match
// because they are generally more expensive to evaluate and more difficult to
// factor.
- // FIXME2: Can the patternpredicatematcher be moved to right before this??
for (unsigned i = 0, e = MatchedComplexPatterns.size(); i != e; ++i) {
const TreePatternNode *N = MatchedComplexPatterns[i].first;
OpenPOWER on IntegriCloud