Lines Matching defs:Matcher

22   class Matcher;
31 Matcher *ConvertPatternToMatcher(const PatternToMatch &Pattern,unsigned Variant,
33 Matcher *OptimizeMatcher(Matcher *Matcher, const CodeGenDAGPatterns &CGP);
34 void EmitMatcherTable(const Matcher *Matcher, const CodeGenDAGPatterns &CGP,
38 /// Matcher - Base class for all the DAG ISel Matcher representation
40 class Matcher {
43 OwningPtr<Matcher> Next;
47 // Matcher state manipulation.
90 Matcher(KindTy K) : Kind(K) {}
92 virtual ~Matcher() {}
96 Matcher *getNext() { return Next.get(); }
97 const Matcher *getNext() const { return Next.get(); }
98 void setNext(Matcher *C) { Next.reset(C); }
99 Matcher *takeNext() { return Next.take(); }
101 OwningPtr<Matcher> &getNextPtr() { return Next; }
103 bool isEqual(const Matcher *M) const {
152 Matcher *unlinkNode(Matcher *Other);
157 bool canMoveBefore(const Matcher *Other) const;
161 bool canMoveBeforeNode(const Matcher *Other) const;
165 bool isContradictory(const Matcher *Other) const {
180 virtual bool isEqualImpl(const Matcher *M) const = 0;
182 virtual bool isContradictoryImpl(const Matcher *M) const { return false; }
188 class ScopeMatcher : public Matcher {
189 SmallVector<Matcher*, 4> Children;
191 ScopeMatcher(Matcher *const *children, unsigned numchildren)
192 : Matcher(Scope), Children(children, children+numchildren) {
198 Matcher *getChild(unsigned i) { return Children[i]; }
199 const Matcher *getChild(unsigned i) const { return Children[i]; }
201 void resetChild(unsigned i, Matcher *N) {
206 Matcher *takeChild(unsigned i) {
207 Matcher *Res = Children[i];
221 static inline bool classof(const Matcher *N) {
227 virtual bool isEqualImpl(const Matcher *M) const { return false; }
232 class RecordMatcher : public Matcher {
242 : Matcher(RecordNode), WhatFor(whatfor), ResultNo(resultNo) {}
247 static inline bool classof(const Matcher *N) {
254 virtual bool isEqualImpl(const Matcher *M) const { return true; }
261 class RecordChildMatcher : public Matcher {
274 : Matcher(RecordChild), ChildNo(childno), WhatFor(whatfor),
281 static inline bool classof(const Matcher *N) {
289 virtual bool isEqualImpl(const Matcher *M) const {
296 class RecordMemRefMatcher : public Matcher {
298 RecordMemRefMatcher() : Matcher(RecordMemRef) {}
300 static inline bool classof(const Matcher *N) {
308 virtual bool isEqualImpl(const Matcher *M) const { return true; }
315 class CaptureGlueInputMatcher : public Matcher {
317 CaptureGlueInputMatcher() : Matcher(CaptureGlueInput) {}
319 static inline bool classof(const Matcher *N) {
327 virtual bool isEqualImpl(const Matcher *M) const { return true; }
333 class MoveChildMatcher : public Matcher {
336 MoveChildMatcher(unsigned childNo) : Matcher(MoveChild), ChildNo(childNo) {}
340 static inline bool classof(const Matcher *N) {
348 virtual bool isEqualImpl(const Matcher *M) const {
356 class MoveParentMatcher : public Matcher {
358 MoveParentMatcher() : Matcher(MoveParent) {}
360 static inline bool classof(const Matcher *N) {
368 virtual bool isEqualImpl(const Matcher *M) const { return true; }
375 class CheckSameMatcher : public Matcher {
379 : Matcher(CheckSame), MatchNumber(matchnumber) {}
383 static inline bool classof(const Matcher *N) {
391 virtual bool isEqualImpl(const Matcher *M) const {
400 class CheckChildSameMatcher : public Matcher {
405 : Matcher(CheckChildSame), ChildNo(childno), MatchNumber(matchnumber) {}
410 static inline bool classof(const Matcher *N) {
418 virtual bool isEqualImpl(const Matcher *M) const {
428 class CheckPatternPredicateMatcher : public Matcher {
432 : Matcher(CheckPatternPredicate), Predicate(predicate) {}
436 static inline bool classof(const Matcher *N) {
444 virtual bool isEqualImpl(const Matcher *M) const {
452 class CheckPredicateMatcher : public Matcher {
459 static inline bool classof(const Matcher *N) {
468 virtual bool isEqualImpl(const Matcher *M) const {
477 class CheckOpcodeMatcher : public Matcher {
481 : Matcher(CheckOpcode), Opcode(opcode) {}
485 static inline bool classof(const Matcher *N) {
493 virtual bool isEqualImpl(const Matcher *M) const;
495 virtual bool isContradictoryImpl(const Matcher *M) const;
502 class SwitchOpcodeMatcher : public Matcher {
503 SmallVector<std::pair<const SDNodeInfo*, Matcher*>, 8> Cases;
505 SwitchOpcodeMatcher(const std::pair<const SDNodeInfo*, Matcher*> *cases,
507 : Matcher(SwitchOpcode), Cases(cases, cases+numcases) {}
509 static inline bool classof(const Matcher *N) {
516 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; }
517 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; }
521 virtual bool isEqualImpl(const Matcher *M) const { return false; }
527 class CheckTypeMatcher : public Matcher {
532 : Matcher(CheckType), Type(type), ResNo(resno) {}
537 static inline bool classof(const Matcher *N) {
545 virtual bool isEqualImpl(const Matcher *M) const {
549 virtual bool isContradictoryImpl(const Matcher *M) const;
556 class SwitchTypeMatcher : public Matcher {
557 SmallVector<std::pair<MVT::SimpleValueType, Matcher*>, 8> Cases;
559 SwitchTypeMatcher(const std::pair<MVT::SimpleValueType, Matcher*> *cases,
561 : Matcher(SwitchType), Cases(cases, cases+numcases) {}
563 static inline bool classof(const Matcher *N) {
570 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; }
571 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; }
575 virtual bool isEqualImpl(const Matcher *M) const { return false; }
582 class CheckChildTypeMatcher : public Matcher {
587 : Matcher(CheckChildType), ChildNo(childno), Type(type) {}
592 static inline bool classof(const Matcher *N) {
600 virtual bool isEqualImpl(const Matcher *M) const {
605 virtual bool isContradictoryImpl(const Matcher *M) const;
611 class CheckIntegerMatcher : public Matcher {
615 : Matcher(CheckInteger), Value(value) {}
619 static inline bool classof(const Matcher *N) {
627 virtual bool isEqualImpl(const Matcher *M) const {
631 virtual bool isContradictoryImpl(const Matcher *M) const;
636 class CheckCondCodeMatcher : public Matcher {
640 : Matcher(CheckCondCode), CondCodeName(condcodename) {}
644 static inline bool classof(const Matcher *N) {
652 virtual bool isEqualImpl(const Matcher *M) const {
660 class CheckValueTypeMatcher : public Matcher {
664 : Matcher(CheckValueType), TypeName(type_name) {}
668 static inline bool classof(const Matcher *N) {
676 virtual bool isEqualImpl(const Matcher *M) const {
680 bool isContradictoryImpl(const Matcher *M) const;
687 class CheckComplexPatMatcher : public Matcher {
703 : Matcher(CheckComplexPat), Pattern(pattern), MatchNumber(matchnumber),
712 static inline bool classof(const Matcher *N) {
721 virtual bool isEqualImpl(const Matcher *M) const {
732 class CheckAndImmMatcher : public Matcher {
736 : Matcher(CheckAndImm), Value(value) {}
740 static inline bool classof(const Matcher *N) {
748 virtual bool isEqualImpl(const Matcher *M) const {
756 class CheckOrImmMatcher : public Matcher {
760 : Matcher(CheckOrImm), Value(value) {}
764 static inline bool classof(const Matcher *N) {
772 virtual bool isEqualImpl(const Matcher *M) const {
780 class CheckFoldableChainNodeMatcher : public Matcher {
783 : Matcher(CheckFoldableChainNode) {}
785 static inline bool classof(const Matcher *N) {
793 virtual bool isEqualImpl(const Matcher *M) const { return true; }
798 class EmitIntegerMatcher : public Matcher {
803 : Matcher(EmitInteger), Val(val), VT(vt) {}
808 static inline bool classof(const Matcher *N) {
814 virtual bool isEqualImpl(const Matcher *M) const {
823 class EmitStringIntegerMatcher : public Matcher {
828 : Matcher(EmitStringInteger), Val(val), VT(vt) {}
833 static inline bool classof(const Matcher *N) {
839 virtual bool isEqualImpl(const Matcher *M) const {
847 class EmitRegisterMatcher : public Matcher {
854 : Matcher(EmitRegister), Reg(reg), VT(vt) {}
859 static inline bool classof(const Matcher *N) {
865 virtual bool isEqualImpl(const Matcher *M) const {
877 class EmitConvertToTargetMatcher : public Matcher {
881 : Matcher(EmitConvertToTarget), Slot(slot) {}
885 static inline bool classof(const Matcher *N) {
891 virtual bool isEqualImpl(const Matcher *M) const {
901 class EmitMergeInputChainsMatcher : public Matcher {
905 : Matcher(EmitMergeInputChains), ChainNodes(nodes, nodes+NumNodes) {}
914 static inline bool classof(const Matcher *N) {
920 virtual bool isEqualImpl(const Matcher *M) const {
929 class EmitCopyToRegMatcher : public Matcher {
934 : Matcher(EmitCopyToReg), SrcSlot(srcSlot), DestPhysReg(destPhysReg) {}
939 static inline bool classof(const Matcher *N) {
945 virtual bool isEqualImpl(const Matcher *M) const {
958 class EmitNodeXFormMatcher : public Matcher {
963 : Matcher(EmitNodeXForm), Slot(slot), NodeXForm(nodeXForm) {}
968 static inline bool classof(const Matcher *N) {
974 virtual bool isEqualImpl(const Matcher *M) const {
985 class EmitNodeMatcherCommon : public Matcher {
1002 : Matcher(isMorphNodeTo ? MorphNodeTo : EmitNode), OpcodeName(opcodeName),
1031 static inline bool classof(const Matcher *N) {
1037 virtual bool isEqualImpl(const Matcher *M) const;
1059 static inline bool classof(const Matcher *N) {
1083 static inline bool classof(const Matcher *N) {
1091 class MarkGlueResultsMatcher : public Matcher {
1095 : Matcher(MarkGlueResults), GlueResultNodes(nodes, nodes+NumNodes) {}
1104 static inline bool classof(const Matcher *N) {
1110 virtual bool isEqualImpl(const Matcher *M) const {
1119 class CompleteMatchMatcher : public Matcher {
1125 : Matcher(CompleteMatch), Results(results, results+numresults),
1132 static inline bool classof(const Matcher *N) {
1138 virtual bool isEqualImpl(const Matcher *M) const {