Lines Matching refs:Matcher
22 class Matcher; variable
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,
40 class Matcher {
43 OwningPtr<Matcher> Next;
88 Matcher(KindTy K) : Kind(K) {} in Matcher() function
90 virtual ~Matcher() {} in ~Matcher()
94 Matcher *getNext() { return Next.get(); } in getNext()
95 const Matcher *getNext() const { return Next.get(); } in getNext()
96 void setNext(Matcher *C) { Next.reset(C); } in setNext()
97 Matcher *takeNext() { return Next.take(); } in takeNext()
99 OwningPtr<Matcher> &getNextPtr() { return Next; } in getNextPtr()
101 static inline bool classof(const Matcher *) { return true; } in classof() argument
103 bool isEqual(const Matcher *M) const { in isEqual()
151 Matcher *unlinkNode(Matcher *Other);
156 bool canMoveBefore(const Matcher *Other) const;
160 bool canMoveBeforeNode(const Matcher *Other) const;
164 bool isContradictory(const Matcher *Other) const { in isContradictory()
179 virtual bool isEqualImpl(const Matcher *M) const = 0;
181 virtual bool isContradictoryImpl(const Matcher *M) const { return false; } in isContradictoryImpl()
187 class ScopeMatcher : public Matcher {
188 SmallVector<Matcher*, 4> Children;
190 ScopeMatcher(Matcher *const *children, unsigned numchildren) in ScopeMatcher()
191 : Matcher(Scope), Children(children, children+numchildren) { in ScopeMatcher()
197 Matcher *getChild(unsigned i) { return Children[i]; } in getChild()
198 const Matcher *getChild(unsigned i) const { return Children[i]; } in getChild()
200 void resetChild(unsigned i, Matcher *N) { in resetChild()
205 Matcher *takeChild(unsigned i) { in takeChild()
206 Matcher *Res = Children[i]; in takeChild()
220 static inline bool classof(const Matcher *N) { in classof()
226 virtual bool isEqualImpl(const Matcher *M) const { return false; } in isEqualImpl()
231 class RecordMatcher : public Matcher {
241 : Matcher(RecordNode), WhatFor(whatfor), ResultNo(resultNo) {} in RecordMatcher()
246 static inline bool classof(const Matcher *N) { in classof()
253 virtual bool isEqualImpl(const Matcher *M) const { return true; } in isEqualImpl()
260 class RecordChildMatcher : public Matcher {
273 : Matcher(RecordChild), ChildNo(childno), WhatFor(whatfor), in RecordChildMatcher()
280 static inline bool classof(const Matcher *N) { in classof()
288 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
295 class RecordMemRefMatcher : public Matcher {
297 RecordMemRefMatcher() : Matcher(RecordMemRef) {} in RecordMemRefMatcher()
299 static inline bool classof(const Matcher *N) { in classof()
307 virtual bool isEqualImpl(const Matcher *M) const { return true; } in isEqualImpl()
314 class CaptureGlueInputMatcher : public Matcher {
316 CaptureGlueInputMatcher() : Matcher(CaptureGlueInput) {} in CaptureGlueInputMatcher()
318 static inline bool classof(const Matcher *N) { in classof()
326 virtual bool isEqualImpl(const Matcher *M) const { return true; } in isEqualImpl()
332 class MoveChildMatcher : public Matcher {
335 MoveChildMatcher(unsigned childNo) : Matcher(MoveChild), ChildNo(childNo) {} in MoveChildMatcher()
339 static inline bool classof(const Matcher *N) { in classof()
347 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
355 class MoveParentMatcher : public Matcher {
357 MoveParentMatcher() : Matcher(MoveParent) {} in MoveParentMatcher()
359 static inline bool classof(const Matcher *N) { in classof()
367 virtual bool isEqualImpl(const Matcher *M) const { return true; } in isEqualImpl()
374 class CheckSameMatcher : public Matcher {
378 : Matcher(CheckSame), MatchNumber(matchnumber) {} in CheckSameMatcher()
382 static inline bool classof(const Matcher *N) { in classof()
390 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
399 class CheckPatternPredicateMatcher : public Matcher {
403 : Matcher(CheckPatternPredicate), Predicate(predicate) {} in CheckPatternPredicateMatcher()
407 static inline bool classof(const Matcher *N) { in classof()
415 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
423 class CheckPredicateMatcher : public Matcher {
430 static inline bool classof(const Matcher *N) { in classof()
439 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
448 class CheckOpcodeMatcher : public Matcher {
452 : Matcher(CheckOpcode), Opcode(opcode) {} in CheckOpcodeMatcher()
456 static inline bool classof(const Matcher *N) { in classof()
464 virtual bool isEqualImpl(const Matcher *M) const;
466 virtual bool isContradictoryImpl(const Matcher *M) const;
473 class SwitchOpcodeMatcher : public Matcher {
474 SmallVector<std::pair<const SDNodeInfo*, Matcher*>, 8> Cases;
476 SwitchOpcodeMatcher(const std::pair<const SDNodeInfo*, Matcher*> *cases, in SwitchOpcodeMatcher()
478 : Matcher(SwitchOpcode), Cases(cases, cases+numcases) {} in SwitchOpcodeMatcher()
480 static inline bool classof(const Matcher *N) { in classof()
487 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; } in getCaseMatcher()
488 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; } in getCaseMatcher()
492 virtual bool isEqualImpl(const Matcher *M) const { return false; } in isEqualImpl()
498 class CheckTypeMatcher : public Matcher {
503 : Matcher(CheckType), Type(type), ResNo(resno) {} in CheckTypeMatcher()
508 static inline bool classof(const Matcher *N) { in classof()
516 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
520 virtual bool isContradictoryImpl(const Matcher *M) const;
527 class SwitchTypeMatcher : public Matcher {
528 SmallVector<std::pair<MVT::SimpleValueType, Matcher*>, 8> Cases;
530 SwitchTypeMatcher(const std::pair<MVT::SimpleValueType, Matcher*> *cases, in SwitchTypeMatcher()
532 : Matcher(SwitchType), Cases(cases, cases+numcases) {} in SwitchTypeMatcher()
534 static inline bool classof(const Matcher *N) { in classof()
541 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; } in getCaseMatcher()
542 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; } in getCaseMatcher()
546 virtual bool isEqualImpl(const Matcher *M) const { return false; } in isEqualImpl()
553 class CheckChildTypeMatcher : public Matcher {
558 : Matcher(CheckChildType), ChildNo(childno), Type(type) {} in CheckChildTypeMatcher()
563 static inline bool classof(const Matcher *N) { in classof()
571 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
576 virtual bool isContradictoryImpl(const Matcher *M) const;
582 class CheckIntegerMatcher : public Matcher {
586 : Matcher(CheckInteger), Value(value) {} in CheckIntegerMatcher()
590 static inline bool classof(const Matcher *N) { in classof()
598 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
602 virtual bool isContradictoryImpl(const Matcher *M) const;
607 class CheckCondCodeMatcher : public Matcher {
611 : Matcher(CheckCondCode), CondCodeName(condcodename) {} in CheckCondCodeMatcher()
615 static inline bool classof(const Matcher *N) { in classof()
623 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
631 class CheckValueTypeMatcher : public Matcher {
635 : Matcher(CheckValueType), TypeName(type_name) {} in CheckValueTypeMatcher()
639 static inline bool classof(const Matcher *N) { in classof()
647 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
651 bool isContradictoryImpl(const Matcher *M) const;
658 class CheckComplexPatMatcher : public Matcher {
674 : Matcher(CheckComplexPat), Pattern(pattern), MatchNumber(matchnumber), in CheckComplexPatMatcher()
683 static inline bool classof(const Matcher *N) { in classof()
692 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
703 class CheckAndImmMatcher : public Matcher {
707 : Matcher(CheckAndImm), Value(value) {} in CheckAndImmMatcher()
711 static inline bool classof(const Matcher *N) { in classof()
719 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
727 class CheckOrImmMatcher : public Matcher {
731 : Matcher(CheckOrImm), Value(value) {} in CheckOrImmMatcher()
735 static inline bool classof(const Matcher *N) { in classof()
743 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
751 class CheckFoldableChainNodeMatcher : public Matcher {
754 : Matcher(CheckFoldableChainNode) {} in CheckFoldableChainNodeMatcher()
756 static inline bool classof(const Matcher *N) { in classof()
764 virtual bool isEqualImpl(const Matcher *M) const { return true; } in isEqualImpl()
769 class EmitIntegerMatcher : public Matcher {
774 : Matcher(EmitInteger), Val(val), VT(vt) {} in EmitIntegerMatcher()
779 static inline bool classof(const Matcher *N) { in classof()
785 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
794 class EmitStringIntegerMatcher : public Matcher {
799 : Matcher(EmitStringInteger), Val(val), VT(vt) {} in EmitStringIntegerMatcher()
804 static inline bool classof(const Matcher *N) { in classof()
810 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
818 class EmitRegisterMatcher : public Matcher {
825 : Matcher(EmitRegister), Reg(reg), VT(vt) {} in EmitRegisterMatcher()
830 static inline bool classof(const Matcher *N) { in classof()
836 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
848 class EmitConvertToTargetMatcher : public Matcher {
852 : Matcher(EmitConvertToTarget), Slot(slot) {} in EmitConvertToTargetMatcher()
856 static inline bool classof(const Matcher *N) { in classof()
862 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
872 class EmitMergeInputChainsMatcher : public Matcher {
876 : Matcher(EmitMergeInputChains), ChainNodes(nodes, nodes+NumNodes) {} in EmitMergeInputChainsMatcher()
885 static inline bool classof(const Matcher *N) { in classof()
891 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
900 class EmitCopyToRegMatcher : public Matcher {
905 : Matcher(EmitCopyToReg), SrcSlot(srcSlot), DestPhysReg(destPhysReg) {} in EmitCopyToRegMatcher()
910 static inline bool classof(const Matcher *N) { in classof()
916 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
929 class EmitNodeXFormMatcher : public Matcher {
934 : Matcher(EmitNodeXForm), Slot(slot), NodeXForm(nodeXForm) {} in EmitNodeXFormMatcher()
939 static inline bool classof(const Matcher *N) { in classof()
945 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
956 class EmitNodeMatcherCommon : public Matcher {
973 : Matcher(isMorphNodeTo ? MorphNodeTo : EmitNode), OpcodeName(opcodeName), in EmitNodeMatcherCommon()
1002 static inline bool classof(const Matcher *N) { in classof()
1008 virtual bool isEqualImpl(const Matcher *M) const;
1029 static inline bool classof(const Matcher *N) { in classof()
1052 static inline bool classof(const Matcher *N) { in classof()
1060 class MarkGlueResultsMatcher : public Matcher {
1064 : Matcher(MarkGlueResults), GlueResultNodes(nodes, nodes+NumNodes) {} in MarkGlueResultsMatcher()
1073 static inline bool classof(const Matcher *N) { in classof()
1079 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()
1088 class CompleteMatchMatcher : public Matcher {
1094 : Matcher(CompleteMatch), Results(results, results+numresults), in CompleteMatchMatcher()
1101 static inline bool classof(const Matcher *N) { in classof()
1107 virtual bool isEqualImpl(const Matcher *M) const { in isEqualImpl()