[llvm-commits] [llvm] r97704 - /llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp

Chris Lattner sabre at nondot.org
Wed Mar 3 17:25:36 PST 2010


Author: lattner
Date: Wed Mar  3 19:25:36 2010
New Revision: 97704

URL: http://llvm.org/viewvc/llvm-project?rev=97704&view=rev
Log:
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.

Modified:
    llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp

Modified: llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp?rev=97704&r1=97703&r2=97704&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp Wed Mar  3 19:25:36 2010
@@ -471,6 +471,9 @@
     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 @@
   // 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;
     





More information about the llvm-commits mailing list