Home | History | Annotate | Download | only in TableGen

Lines Matching defs:Pattern

52     const PatternToMatch &Pattern;
55 /// PatWithNoTypes - This is a clone of Pattern.getSrcPattern() that starts
87 /// physreg input to the pattern. The first elt is the Register node, the
88 /// second is the recorded slot number the input pattern match saved it in.
98 MatcherGen(const PatternToMatch &pattern, const CodeGenDAGPatterns &cgp);
126 /// GetInstPatternNode - Get the pattern for an instruction.
144 MatcherGen::MatcherGen(const PatternToMatch &pattern,
146 : Pattern(pattern), CGP(cgp), NextRecordedOperandNo(0),
148 // We need to produce the matcher tree for the patterns source pattern. To do
154 // To figure out the fewest number of type checks needed, clone the pattern,
155 // remove the types, then perform type inference on the pattern as a whole.
160 PatWithNoTypes = Pattern.getSrcPattern()->clone();
167 /// InferPossibleTypes - As we emit the pattern, we end up generating type
172 // TP - Get *SOME* tree pattern, we don't care which. It is only used for
194 // Pattern Match Generation
206 if (N == Pattern.getSrcPattern()) {
249 errs() << "We expect complex pattern uses to have names: " << *N << "\n";
284 // If this is at the root of the pattern, we emit a redundant
287 if (N == Pattern.getSrcPattern())
321 // Remember all of the input chains our pattern will match.
324 // Don't look at the input chain when matching the tree pattern to the
349 const TreePatternNode *Root = Pattern.getSrcPattern();
350 if (N != Root) { // Not the root of the pattern.
378 N != Pattern.getSrcPattern()) {
385 // Remember all of the nodes with output glue our pattern will match.
390 // glue, capture it as the glue input of the pattern.
420 // we already saw this in the pattern, emit code to verify dagness.
452 /// pattern for the specified Variant. If the variant is invalid this returns
455 // If the root of the pattern is a ComplexPattern and if it is specified to
460 Pattern.getSrcPattern()->getComplexPatternInfo(CGP)) {
462 assert(!OpNodes.empty() &&"Complex Pattern must specify what it can match");
470 // Emit the matcher for the pattern structure and types.
471 EmitMatchCode(Pattern.getSrcPattern(), PatWithNoTypes);
473 // If the pattern has a predicate on it (e.g. only enabled when a subtarget
475 if (!Pattern.getPredicateCheck().empty())
476 AddMatcher(new CheckPatternPredicateMatcher(Pattern.getPredicateCheck()));
491 "Complex pattern should have a name and slot");
505 // If the complex pattern has a chain, then we need to keep track of the
532 // A reference to a complex pattern gets all of the results of the complex
533 // pattern's match.
618 /// GetInstPatternNode - Get the pattern for an instruction.
624 // FIXME2?: Assume actual pattern comes before "implicit".
628 else if (/*isRoot*/ N == Pattern.getDstPattern())
629 InstPatNode = Pattern.getSrcPattern();
677 // If we can, get the pattern for the instruction we're generating. We derive
678 // a variety of information from this pattern, such as whether it has a chain.
690 // regardless of whether they happen to have an internal pattern saying so.
691 if (Pattern.getSrcPattern()->TreeHasProperty(SDNPHasChain, CGP)
696 bool isRoot = N == Pattern.getDstPattern();
701 const TreePatternNode *SrcPat = Pattern.getSrcPattern();
705 // FIXME2: this is checking the entire pattern, not just the node in
714 // Loop over all of the operands of the instruction pattern, emitting code
774 // If this is the root instruction of a pattern that has physical registers in
775 // its result pattern, add output VTs for them. For example, X86 has:
779 if (isRoot && !Pattern.getDstRegs().empty()) {
786 for (unsigned i = 0; i != Pattern.getDstRegs().size(); ++i) {
787 Record *Reg = Pattern.getDstRegs()[i];
793 // If this is the root of the pattern and the pattern we're matching includes
798 (Pattern.getSrcPattern()->NodeHasProperty(SDNPVariadic, CGP)))
799 NumFixedArityOperands = Pattern.getSrcPattern()->getNumChildren();
801 // If this is the root node and multiple matched nodes in the input pattern
809 Pattern.getSrcPattern()->TreeHasProperty(SDNPMemOperand, CGP);
814 numNodesThatMayLoadOrStore(Pattern.getDstPattern(), CGP);
862 // This is something selected from the pattern we matched.
875 PrintFatalError("Unknown node in result pattern!");
886 // Codegen the root of the result pattern, capturing the resulting values.
888 EmitResultOperand(Pattern.getDstPattern(), Ops);
890 // At this point, we have however many values the result pattern produces.
891 // However, the input pattern might not need all of these. If there are
896 unsigned NumSrcResults = Pattern.getSrcPattern()->getNumTypes();
898 // If the pattern also has (implicit) results, count them as well.
899 if (!Pattern.getDstRegs().empty()) {
903 const TreePatternNode *DstPat = Pattern.getDstPattern();
912 for (unsigned i = 0; i != Pattern.getDstRegs().size(); ++i) {
913 Record *Reg = Pattern.getDstRegs()[i];
922 // If the matched pattern covers nodes which define a glue result, emit a node
928 AddMatcher(new CompleteMatchMatcher(Ops.data(), Ops.size(), Pattern));
932 /// ConvertPatternToMatcher - Create the matcher for the specified pattern with
934 Matcher *llvm::ConvertPatternToMatcher(const PatternToMatch &Pattern,
937 MatcherGen Gen(Pattern, CGP);
948 // If the match succeeds, then we generate Pattern.