1 //===- DAGISelMatcher.h - Representation of DAG pattern matcher -----------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef TBLGEN_DAGISELMATCHER_H
11 #define TBLGEN_DAGISELMATCHER_H
13 #include "llvm/CodeGen/ValueTypes.h"
14 #include "llvm/ADT/OwningPtr.h"
15 #include "llvm/ADT/StringRef.h"
16 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/Support/Casting.h"
20 class CodeGenDAGPatterns;
27 MatcherNode *ConvertPatternToMatcher(const PatternToMatch &Pattern,
28 const CodeGenDAGPatterns &CGP);
29 MatcherNode *OptimizeMatcher(MatcherNode *Matcher);
30 void EmitMatcherTable(const MatcherNode *Matcher, raw_ostream &OS);
33 /// MatcherNode - Base class for all the the DAG ISel Matcher representation
36 // The next matcher node that is executed after this one. Null if this is the
37 // last stage of a match.
38 OwningPtr<MatcherNode> Next;
41 // Matcher state manipulation.
42 Push, // Push a checking scope.
43 RecordNode, // Record the current node.
44 RecordChild, // Record a child of the current node.
45 RecordMemRef, // Record the memref in the current node.
46 CaptureFlagInput, // If the current node has an input flag, save it.
47 MoveChild, // Move current node to specified child.
48 MoveParent, // Move current node to parent.
50 // Predicate checking.
51 CheckSame, // Fail if not same as prev match.
52 CheckPatternPredicate,
53 CheckPredicate, // Fail if node predicate fails.
54 CheckOpcode, // Fail if not opcode.
55 CheckMultiOpcode, // Fail if not in opcode list.
56 CheckType, // Fail if not correct type.
57 CheckChildType, // Fail if child has wrong type.
58 CheckInteger, // Fail if wrong val.
59 CheckCondCode, // Fail if not condcode.
64 CheckFoldableChainNode,
67 // Node creation/emisssion.
68 EmitInteger, // Create a TargetConstant
69 EmitStringInteger, // Create a TargetConstant from a string.
70 EmitRegister, // Create a register.
71 EmitConvertToTarget, // Convert a imm/fpimm to target imm/fpimm
72 EmitMergeInputChains, // Merge together a chains for an input.
73 EmitCopyToReg, // Emit a copytoreg into a physreg.
74 EmitNode, // Create a DAG node
75 EmitNodeXForm, // Run a SDNodeXForm
76 MarkFlagResults, // Indicate which interior nodes have flag results.
77 CompleteMatch // Finish a match and update the results.
82 MatcherNode(KindTy K) : Kind(K) {}
84 virtual ~MatcherNode() {}
86 KindTy getKind() const { return Kind; }
88 MatcherNode *getNext() { return Next.get(); }
89 const MatcherNode *getNext() const { return Next.get(); }
90 void setNext(MatcherNode *C) { Next.reset(C); }
91 MatcherNode *takeNext() { return Next.take(); }
93 OwningPtr<MatcherNode> &getNextPtr() { return Next; }
95 static inline bool classof(const MatcherNode *) { return true; }
97 virtual void print(raw_ostream &OS, unsigned indent = 0) const = 0;
100 void printNext(raw_ostream &OS, unsigned indent) const;
103 /// PushMatcherNode - This pushes a failure scope on the stack and evaluates
104 /// 'Next'. If 'Next' fails to match, it pops its scope and attempts to
106 class PushMatcherNode : public MatcherNode {
107 OwningPtr<MatcherNode> Failure;
109 PushMatcherNode(MatcherNode *next = 0, MatcherNode *failure = 0)
110 : MatcherNode(Push), Failure(failure) {
114 MatcherNode *getFailure() { return Failure.get(); }
115 const MatcherNode *getFailure() const { return Failure.get(); }
116 void setFailure(MatcherNode *N) { Failure.reset(N); }
117 OwningPtr<MatcherNode> &getFailurePtr() { return Failure; }
119 static inline bool classof(const MatcherNode *N) {
120 return N->getKind() == Push;
123 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
126 /// RecordMatcherNode - Save the current node in the operand list.
127 class RecordMatcherNode : public MatcherNode {
128 /// WhatFor - This is a string indicating why we're recording this. This
129 /// should only be used for comment generation not anything semantic.
132 RecordMatcherNode(const std::string &whatfor)
133 : MatcherNode(RecordNode), WhatFor(whatfor) {}
135 const std::string &getWhatFor() const { return WhatFor; }
137 static inline bool classof(const MatcherNode *N) {
138 return N->getKind() == RecordNode;
141 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
144 /// RecordChildMatcherNode - Save a numbered child of the current node, or fail
145 /// the match if it doesn't exist. This is logically equivalent to:
146 /// MoveChild N + RecordNode + MoveParent.
147 class RecordChildMatcherNode : public MatcherNode {
150 /// WhatFor - This is a string indicating why we're recording this. This
151 /// should only be used for comment generation not anything semantic.
154 RecordChildMatcherNode(unsigned childno, const std::string &whatfor)
155 : MatcherNode(RecordChild), ChildNo(childno), WhatFor(whatfor) {}
157 unsigned getChildNo() const { return ChildNo; }
158 const std::string &getWhatFor() const { return WhatFor; }
160 static inline bool classof(const MatcherNode *N) {
161 return N->getKind() == RecordChild;
164 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
167 /// RecordMemRefMatcherNode - Save the current node's memref.
168 class RecordMemRefMatcherNode : public MatcherNode {
170 RecordMemRefMatcherNode() : MatcherNode(RecordMemRef) {}
172 static inline bool classof(const MatcherNode *N) {
173 return N->getKind() == RecordMemRef;
176 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
180 /// CaptureFlagInputMatcherNode - If the current record has a flag input, record
181 /// it so that it is used as an input to the generated code.
182 class CaptureFlagInputMatcherNode : public MatcherNode {
184 CaptureFlagInputMatcherNode()
185 : MatcherNode(CaptureFlagInput) {}
187 static inline bool classof(const MatcherNode *N) {
188 return N->getKind() == CaptureFlagInput;
191 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
194 /// MoveChildMatcherNode - This tells the interpreter to move into the
195 /// specified child node.
196 class MoveChildMatcherNode : public MatcherNode {
199 MoveChildMatcherNode(unsigned childNo)
200 : MatcherNode(MoveChild), ChildNo(childNo) {}
202 unsigned getChildNo() const { return ChildNo; }
204 static inline bool classof(const MatcherNode *N) {
205 return N->getKind() == MoveChild;
208 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
211 /// MoveParentMatcherNode - This tells the interpreter to move to the parent
212 /// of the current node.
213 class MoveParentMatcherNode : public MatcherNode {
215 MoveParentMatcherNode()
216 : MatcherNode(MoveParent) {}
218 static inline bool classof(const MatcherNode *N) {
219 return N->getKind() == MoveParent;
222 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
225 /// CheckSameMatcherNode - This checks to see if this node is exactly the same
226 /// node as the specified match that was recorded with 'Record'. This is used
227 /// when patterns have the same name in them, like '(mul GPR:$in, GPR:$in)'.
228 class CheckSameMatcherNode : public MatcherNode {
229 unsigned MatchNumber;
231 CheckSameMatcherNode(unsigned matchnumber)
232 : MatcherNode(CheckSame), MatchNumber(matchnumber) {}
234 unsigned getMatchNumber() const { return MatchNumber; }
236 static inline bool classof(const MatcherNode *N) {
237 return N->getKind() == CheckSame;
240 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
243 /// CheckPatternPredicateMatcherNode - This checks the target-specific predicate
244 /// to see if the entire pattern is capable of matching. This predicate does
245 /// not take a node as input. This is used for subtarget feature checks etc.
246 class CheckPatternPredicateMatcherNode : public MatcherNode {
247 std::string Predicate;
249 CheckPatternPredicateMatcherNode(StringRef predicate)
250 : MatcherNode(CheckPatternPredicate), Predicate(predicate) {}
252 StringRef getPredicate() const { return Predicate; }
254 static inline bool classof(const MatcherNode *N) {
255 return N->getKind() == CheckPatternPredicate;
258 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
261 /// CheckPredicateMatcherNode - This checks the target-specific predicate to
262 /// see if the node is acceptable.
263 class CheckPredicateMatcherNode : public MatcherNode {
266 CheckPredicateMatcherNode(StringRef predname)
267 : MatcherNode(CheckPredicate), PredName(predname) {}
269 StringRef getPredicateName() const { return PredName; }
271 static inline bool classof(const MatcherNode *N) {
272 return N->getKind() == CheckPredicate;
275 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
279 /// CheckOpcodeMatcherNode - This checks to see if the current node has the
280 /// specified opcode, if not it fails to match.
281 class CheckOpcodeMatcherNode : public MatcherNode {
282 StringRef OpcodeName;
284 CheckOpcodeMatcherNode(StringRef opcodename)
285 : MatcherNode(CheckOpcode), OpcodeName(opcodename) {}
287 StringRef getOpcodeName() const { return OpcodeName; }
289 static inline bool classof(const MatcherNode *N) {
290 return N->getKind() == CheckOpcode;
293 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
296 /// CheckMultiOpcodeMatcherNode - This checks to see if the current node has one
297 /// of the specified opcode, if not it fails to match.
298 class CheckMultiOpcodeMatcherNode : public MatcherNode {
299 SmallVector<StringRef, 4> OpcodeNames;
301 CheckMultiOpcodeMatcherNode(const StringRef *opcodes, unsigned numops)
302 : MatcherNode(CheckMultiOpcode), OpcodeNames(opcodes, opcodes+numops) {}
304 unsigned getNumOpcodeNames() const { return OpcodeNames.size(); }
305 StringRef getOpcodeName(unsigned i) const { return OpcodeNames[i]; }
307 static inline bool classof(const MatcherNode *N) {
308 return N->getKind() == CheckMultiOpcode;
311 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
316 /// CheckTypeMatcherNode - This checks to see if the current node has the
317 /// specified type, if not it fails to match.
318 class CheckTypeMatcherNode : public MatcherNode {
319 MVT::SimpleValueType Type;
321 CheckTypeMatcherNode(MVT::SimpleValueType type)
322 : MatcherNode(CheckType), Type(type) {}
324 MVT::SimpleValueType getType() const { return Type; }
326 static inline bool classof(const MatcherNode *N) {
327 return N->getKind() == CheckType;
330 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
333 /// CheckChildTypeMatcherNode - This checks to see if a child node has the
334 /// specified type, if not it fails to match.
335 class CheckChildTypeMatcherNode : public MatcherNode {
337 MVT::SimpleValueType Type;
339 CheckChildTypeMatcherNode(unsigned childno, MVT::SimpleValueType type)
340 : MatcherNode(CheckChildType), ChildNo(childno), Type(type) {}
342 unsigned getChildNo() const { return ChildNo; }
343 MVT::SimpleValueType getType() const { return Type; }
345 static inline bool classof(const MatcherNode *N) {
346 return N->getKind() == CheckChildType;
349 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
353 /// CheckIntegerMatcherNode - This checks to see if the current node is a
354 /// ConstantSDNode with the specified integer value, if not it fails to match.
355 class CheckIntegerMatcherNode : public MatcherNode {
358 CheckIntegerMatcherNode(int64_t value)
359 : MatcherNode(CheckInteger), Value(value) {}
361 int64_t getValue() const { return Value; }
363 static inline bool classof(const MatcherNode *N) {
364 return N->getKind() == CheckInteger;
367 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
370 /// CheckCondCodeMatcherNode - This checks to see if the current node is a
371 /// CondCodeSDNode with the specified condition, if not it fails to match.
372 class CheckCondCodeMatcherNode : public MatcherNode {
373 StringRef CondCodeName;
375 CheckCondCodeMatcherNode(StringRef condcodename)
376 : MatcherNode(CheckCondCode), CondCodeName(condcodename) {}
378 StringRef getCondCodeName() const { return CondCodeName; }
380 static inline bool classof(const MatcherNode *N) {
381 return N->getKind() == CheckCondCode;
384 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
387 /// CheckValueTypeMatcherNode - This checks to see if the current node is a
388 /// VTSDNode with the specified type, if not it fails to match.
389 class CheckValueTypeMatcherNode : public MatcherNode {
392 CheckValueTypeMatcherNode(StringRef type_name)
393 : MatcherNode(CheckValueType), TypeName(type_name) {}
395 StringRef getTypeName() const { return TypeName; }
397 static inline bool classof(const MatcherNode *N) {
398 return N->getKind() == CheckValueType;
401 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
406 /// CheckComplexPatMatcherNode - This node runs the specified ComplexPattern on
407 /// the current node.
408 class CheckComplexPatMatcherNode : public MatcherNode {
409 const ComplexPattern &Pattern;
411 CheckComplexPatMatcherNode(const ComplexPattern &pattern)
412 : MatcherNode(CheckComplexPat), Pattern(pattern) {}
414 const ComplexPattern &getPattern() const { return Pattern; }
416 static inline bool classof(const MatcherNode *N) {
417 return N->getKind() == CheckComplexPat;
420 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
423 /// CheckAndImmMatcherNode - This checks to see if the current node is an 'and'
424 /// with something equivalent to the specified immediate.
425 class CheckAndImmMatcherNode : public MatcherNode {
428 CheckAndImmMatcherNode(int64_t value)
429 : MatcherNode(CheckAndImm), Value(value) {}
431 int64_t getValue() const { return Value; }
433 static inline bool classof(const MatcherNode *N) {
434 return N->getKind() == CheckAndImm;
437 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
440 /// CheckOrImmMatcherNode - This checks to see if the current node is an 'and'
441 /// with something equivalent to the specified immediate.
442 class CheckOrImmMatcherNode : public MatcherNode {
445 CheckOrImmMatcherNode(int64_t value)
446 : MatcherNode(CheckOrImm), Value(value) {}
448 int64_t getValue() const { return Value; }
450 static inline bool classof(const MatcherNode *N) {
451 return N->getKind() == CheckOrImm;
454 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
457 /// CheckFoldableChainNodeMatcherNode - This checks to see if the current node
458 /// (which defines a chain operand) is safe to fold into a larger pattern.
459 class CheckFoldableChainNodeMatcherNode : public MatcherNode {
461 CheckFoldableChainNodeMatcherNode()
462 : MatcherNode(CheckFoldableChainNode) {}
464 static inline bool classof(const MatcherNode *N) {
465 return N->getKind() == CheckFoldableChainNode;
468 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
471 /// CheckChainCompatibleMatcherNode - Verify that the current node's chain
472 /// operand is 'compatible' with the specified recorded node's.
473 class CheckChainCompatibleMatcherNode : public MatcherNode {
476 CheckChainCompatibleMatcherNode(unsigned previousop)
477 : MatcherNode(CheckChainCompatible), PreviousOp(previousop) {}
479 unsigned getPreviousOp() const { return PreviousOp; }
481 static inline bool classof(const MatcherNode *N) {
482 return N->getKind() == CheckChainCompatible;
485 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
488 /// EmitIntegerMatcherNode - This creates a new TargetConstant.
489 class EmitIntegerMatcherNode : public MatcherNode {
491 MVT::SimpleValueType VT;
493 EmitIntegerMatcherNode(int64_t val, MVT::SimpleValueType vt)
494 : MatcherNode(EmitInteger), Val(val), VT(vt) {}
496 int64_t getValue() const { return Val; }
497 MVT::SimpleValueType getVT() const { return VT; }
499 static inline bool classof(const MatcherNode *N) {
500 return N->getKind() == EmitInteger;
503 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
506 /// EmitStringIntegerMatcherNode - A target constant whose value is represented
508 class EmitStringIntegerMatcherNode : public MatcherNode {
510 MVT::SimpleValueType VT;
512 EmitStringIntegerMatcherNode(const std::string &val, MVT::SimpleValueType vt)
513 : MatcherNode(EmitStringInteger), Val(val), VT(vt) {}
515 const std::string &getValue() const { return Val; }
516 MVT::SimpleValueType getVT() const { return VT; }
518 static inline bool classof(const MatcherNode *N) {
519 return N->getKind() == EmitStringInteger;
522 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
525 /// EmitRegisterMatcherNode - This creates a new TargetConstant.
526 class EmitRegisterMatcherNode : public MatcherNode {
527 /// Reg - The def for the register that we're emitting. If this is null, then
528 /// this is a reference to zero_reg.
530 MVT::SimpleValueType VT;
532 EmitRegisterMatcherNode(Record *reg, MVT::SimpleValueType vt)
533 : MatcherNode(EmitRegister), Reg(reg), VT(vt) {}
535 Record *getReg() const { return Reg; }
536 MVT::SimpleValueType getVT() const { return VT; }
538 static inline bool classof(const MatcherNode *N) {
539 return N->getKind() == EmitRegister;
542 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
545 /// EmitConvertToTargetMatcherNode - Emit an operation that reads a specified
546 /// recorded node and converts it from being a ISD::Constant to
547 /// ISD::TargetConstant, likewise for ConstantFP.
548 class EmitConvertToTargetMatcherNode : public MatcherNode {
551 EmitConvertToTargetMatcherNode(unsigned slot)
552 : MatcherNode(EmitConvertToTarget), Slot(slot) {}
554 unsigned getSlot() const { return Slot; }
556 static inline bool classof(const MatcherNode *N) {
557 return N->getKind() == EmitConvertToTarget;
560 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
563 /// EmitMergeInputChainsMatcherNode - Emit a node that merges a list of input
564 /// chains together with a token factor. The list of nodes are the nodes in the
565 /// matched pattern that have chain input/outputs. This node adds all input
566 /// chains of these nodes if they are not themselves a node in the pattern.
567 class EmitMergeInputChainsMatcherNode : public MatcherNode {
568 SmallVector<unsigned, 3> ChainNodes;
570 EmitMergeInputChainsMatcherNode(const unsigned *nodes, unsigned NumNodes)
571 : MatcherNode(EmitMergeInputChains), ChainNodes(nodes, nodes+NumNodes) {}
573 unsigned getNumNodes() const { return ChainNodes.size(); }
575 unsigned getNode(unsigned i) const {
576 assert(i < ChainNodes.size());
577 return ChainNodes[i];
580 static inline bool classof(const MatcherNode *N) {
581 return N->getKind() == EmitMergeInputChains;
584 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
587 /// EmitCopyToRegMatcherNode - Emit a CopyToReg node from a value to a physreg,
588 /// pushing the chain and flag results.
590 class EmitCopyToRegMatcherNode : public MatcherNode {
591 unsigned SrcSlot; // Value to copy into the physreg.
594 EmitCopyToRegMatcherNode(unsigned srcSlot, Record *destPhysReg)
595 : MatcherNode(EmitCopyToReg), SrcSlot(srcSlot), DestPhysReg(destPhysReg) {}
597 unsigned getSrcSlot() const { return SrcSlot; }
598 Record *getDestPhysReg() const { return DestPhysReg; }
600 static inline bool classof(const MatcherNode *N) {
601 return N->getKind() == EmitCopyToReg;
604 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
609 /// EmitNodeXFormMatcherNode - Emit an operation that runs an SDNodeXForm on a
610 /// recorded node and records the result.
611 class EmitNodeXFormMatcherNode : public MatcherNode {
615 EmitNodeXFormMatcherNode(unsigned slot, Record *nodeXForm)
616 : MatcherNode(EmitNodeXForm), Slot(slot), NodeXForm(nodeXForm) {}
618 unsigned getSlot() const { return Slot; }
619 Record *getNodeXForm() const { return NodeXForm; }
621 static inline bool classof(const MatcherNode *N) {
622 return N->getKind() == EmitNodeXForm;
625 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
628 /// EmitNodeMatcherNode - This signals a successful match and generates a node.
629 class EmitNodeMatcherNode : public MatcherNode {
630 std::string OpcodeName;
631 const SmallVector<MVT::SimpleValueType, 3> VTs;
632 const SmallVector<unsigned, 6> Operands;
633 bool HasChain, HasFlag, HasMemRefs;
635 /// NumFixedArityOperands - If this is a fixed arity node, this is set to -1.
636 /// If this is a varidic node, this is set to the number of fixed arity
637 /// operands in the root of the pattern. The rest are appended to this node.
638 int NumFixedArityOperands;
640 EmitNodeMatcherNode(const std::string &opcodeName,
641 const MVT::SimpleValueType *vts, unsigned numvts,
642 const unsigned *operands, unsigned numops,
643 bool hasChain, bool hasFlag, bool hasmemrefs,
644 int numfixedarityoperands)
645 : MatcherNode(EmitNode), OpcodeName(opcodeName),
646 VTs(vts, vts+numvts), Operands(operands, operands+numops),
647 HasChain(hasChain), HasFlag(hasFlag), HasMemRefs(hasmemrefs),
648 NumFixedArityOperands(numfixedarityoperands) {}
650 const std::string &getOpcodeName() const { return OpcodeName; }
652 unsigned getNumVTs() const { return VTs.size(); }
653 MVT::SimpleValueType getVT(unsigned i) const {
654 assert(i < VTs.size());
658 unsigned getNumOperands() const { return Operands.size(); }
659 unsigned getOperand(unsigned i) const {
660 assert(i < Operands.size());
664 bool hasChain() const { return HasChain; }
665 bool hasFlag() const { return HasFlag; }
666 bool hasMemRefs() const { return HasMemRefs; }
667 int getNumFixedArityOperands() const { return NumFixedArityOperands; }
669 static inline bool classof(const MatcherNode *N) {
670 return N->getKind() == EmitNode;
673 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
676 /// MarkFlagResultsMatcherNode - This node indicates which non-root nodes in the
677 /// pattern produce flags. This allows CompleteMatchMatcherNode to update them
678 /// with the output flag of the resultant code.
679 class MarkFlagResultsMatcherNode : public MatcherNode {
680 SmallVector<unsigned, 3> FlagResultNodes;
682 MarkFlagResultsMatcherNode(const unsigned *nodes, unsigned NumNodes)
683 : MatcherNode(MarkFlagResults), FlagResultNodes(nodes, nodes+NumNodes) {}
685 unsigned getNumNodes() const { return FlagResultNodes.size(); }
687 unsigned getNode(unsigned i) const {
688 assert(i < FlagResultNodes.size());
689 return FlagResultNodes[i];
692 static inline bool classof(const MatcherNode *N) {
693 return N->getKind() == MarkFlagResults;
696 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
699 /// CompleteMatchMatcherNode - Complete a match by replacing the results of the
700 /// pattern with the newly generated nodes. This also prints a comment
701 /// indicating the source and dest patterns.
702 class CompleteMatchMatcherNode : public MatcherNode {
703 SmallVector<unsigned, 2> Results;
704 const PatternToMatch &Pattern;
706 CompleteMatchMatcherNode(const unsigned *results, unsigned numresults,
707 const PatternToMatch &pattern)
708 : MatcherNode(CompleteMatch), Results(results, results+numresults),
711 unsigned getNumResults() const { return Results.size(); }
712 unsigned getResult(unsigned R) const { return Results[R]; }
713 const PatternToMatch &getPattern() const { return Pattern; }
715 static inline bool classof(const MatcherNode *N) {
716 return N->getKind() == CompleteMatch;
719 virtual void print(raw_ostream &OS, unsigned indent = 0) const;
723 } // end namespace llvm