Lines Matching refs:Matcher

22   class Matcher;  variable
31 Matcher *ConvertPatternToMatcher(const PatternToMatch &Pattern,unsigned Variant,
33 void OptimizeMatcher(std::unique_ptr<Matcher> &Matcher,
35 void EmitMatcherTable(const Matcher *Matcher, const CodeGenDAGPatterns &CGP,
41 class Matcher {
44 std::unique_ptr<Matcher> Next;
91 Matcher(KindTy K) : Kind(K) {} in Matcher() function
93 virtual ~Matcher() {} in ~Matcher()
97 Matcher *getNext() { return Next.get(); } in getNext()
98 const Matcher *getNext() const { return Next.get(); } in getNext()
99 void setNext(Matcher *C) { Next.reset(C); } in setNext()
100 Matcher *takeNext() { return Next.release(); } in takeNext()
102 std::unique_ptr<Matcher> &getNextPtr() { return Next; } in getNextPtr()
104 bool isEqual(const Matcher *M) const { in isEqual()
143 Matcher *unlinkNode(Matcher *Other);
148 bool canMoveBefore(const Matcher *Other) const;
152 bool canMoveBeforeNode(const Matcher *Other) const;
156 bool isContradictory(const Matcher *Other) const { in isContradictory()
171 virtual bool isEqualImpl(const Matcher *M) const = 0;
172 virtual bool isContradictoryImpl(const Matcher *M) const { return false; } in isContradictoryImpl()
178 class ScopeMatcher : public Matcher {
179 SmallVector<Matcher*, 4> Children;
181 ScopeMatcher(ArrayRef<Matcher *> children) in ScopeMatcher()
182 : Matcher(Scope), Children(children.begin(), children.end()) { in ScopeMatcher()
188 Matcher *getChild(unsigned i) { return Children[i]; } in getChild()
189 const Matcher *getChild(unsigned i) const { return Children[i]; } in getChild()
191 void resetChild(unsigned i, Matcher *N) { in resetChild()
196 Matcher *takeChild(unsigned i) { in takeChild()
197 Matcher *Res = Children[i]; in takeChild()
211 static inline bool classof(const Matcher *N) { in classof()
217 bool isEqualImpl(const Matcher *M) const override { return false; } in isEqualImpl()
221 class RecordMatcher : public Matcher {
231 : Matcher(RecordNode), WhatFor(whatfor), ResultNo(resultNo) {} in RecordMatcher()
236 static inline bool classof(const Matcher *N) { in classof()
242 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
248 class RecordChildMatcher : public Matcher {
261 : Matcher(RecordChild), ChildNo(childno), WhatFor(whatfor), in RecordChildMatcher()
268 static inline bool classof(const Matcher *N) { in classof()
274 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
280 class RecordMemRefMatcher : public Matcher {
282 RecordMemRefMatcher() : Matcher(RecordMemRef) {} in RecordMemRefMatcher()
284 static inline bool classof(const Matcher *N) { in classof()
290 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
296 class CaptureGlueInputMatcher : public Matcher {
298 CaptureGlueInputMatcher() : Matcher(CaptureGlueInput) {} in CaptureGlueInputMatcher()
300 static inline bool classof(const Matcher *N) { in classof()
306 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
311 class MoveChildMatcher : public Matcher {
314 MoveChildMatcher(unsigned childNo) : Matcher(MoveChild), ChildNo(childNo) {} in MoveChildMatcher()
318 static inline bool classof(const Matcher *N) { in classof()
324 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
331 class MoveParentMatcher : public Matcher {
333 MoveParentMatcher() : Matcher(MoveParent) {} in MoveParentMatcher()
335 static inline bool classof(const Matcher *N) { in classof()
341 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
347 class CheckSameMatcher : public Matcher {
351 : Matcher(CheckSame), MatchNumber(matchnumber) {} in CheckSameMatcher()
355 static inline bool classof(const Matcher *N) { in classof()
361 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
369 class CheckChildSameMatcher : public Matcher {
374 : Matcher(CheckChildSame), ChildNo(childno), MatchNumber(matchnumber) {} in CheckChildSameMatcher()
379 static inline bool classof(const Matcher *N) { in classof()
385 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
394 class CheckPatternPredicateMatcher : public Matcher {
398 : Matcher(CheckPatternPredicate), Predicate(predicate) {} in CheckPatternPredicateMatcher()
402 static inline bool classof(const Matcher *N) { in classof()
408 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
415 class CheckPredicateMatcher : public Matcher {
422 static inline bool classof(const Matcher *N) { in classof()
428 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
436 class CheckOpcodeMatcher : public Matcher {
440 : Matcher(CheckOpcode), Opcode(opcode) {} in CheckOpcodeMatcher()
444 static inline bool classof(const Matcher *N) { in classof()
450 bool isEqualImpl(const Matcher *M) const override;
451 bool isContradictoryImpl(const Matcher *M) const override;
458 class SwitchOpcodeMatcher : public Matcher {
459 SmallVector<std::pair<const SDNodeInfo*, Matcher*>, 8> Cases;
461 SwitchOpcodeMatcher(ArrayRef<std::pair<const SDNodeInfo*, Matcher*> > cases) in SwitchOpcodeMatcher()
462 : Matcher(SwitchOpcode), Cases(cases.begin(), cases.end()) {} in SwitchOpcodeMatcher()
465 static inline bool classof(const Matcher *N) { in classof()
472 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; } in getCaseMatcher()
473 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; } in getCaseMatcher()
477 bool isEqualImpl(const Matcher *M) const override { return false; } in isEqualImpl()
482 class CheckTypeMatcher : public Matcher {
487 : Matcher(CheckType), Type(type), ResNo(resno) {} in CheckTypeMatcher()
492 static inline bool classof(const Matcher *N) { in classof()
498 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
501 bool isContradictoryImpl(const Matcher *M) const override;
508 class SwitchTypeMatcher : public Matcher {
509 SmallVector<std::pair<MVT::SimpleValueType, Matcher*>, 8> Cases;
511 SwitchTypeMatcher(ArrayRef<std::pair<MVT::SimpleValueType, Matcher*> > cases) in SwitchTypeMatcher()
512 : Matcher(SwitchType), Cases(cases.begin(), cases.end()) {} in SwitchTypeMatcher()
515 static inline bool classof(const Matcher *N) { in classof()
522 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; } in getCaseMatcher()
523 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; } in getCaseMatcher()
527 bool isEqualImpl(const Matcher *M) const override { return false; } in isEqualImpl()
533 class CheckChildTypeMatcher : public Matcher {
538 : Matcher(CheckChildType), ChildNo(childno), Type(type) {} in CheckChildTypeMatcher()
543 static inline bool classof(const Matcher *N) { in classof()
549 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
553 bool isContradictoryImpl(const Matcher *M) const override;
559 class CheckIntegerMatcher : public Matcher {
563 : Matcher(CheckInteger), Value(value) {} in CheckIntegerMatcher()
567 static inline bool classof(const Matcher *N) { in classof()
573 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
576 bool isContradictoryImpl(const Matcher *M) const override;
581 class CheckChildIntegerMatcher : public Matcher {
586 : Matcher(CheckChildInteger), ChildNo(childno), Value(value) {} in CheckChildIntegerMatcher()
591 static inline bool classof(const Matcher *N) { in classof()
597 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
601 bool isContradictoryImpl(const Matcher *M) const override;
606 class CheckCondCodeMatcher : public Matcher {
610 : Matcher(CheckCondCode), CondCodeName(condcodename) {} in CheckCondCodeMatcher()
614 static inline bool classof(const Matcher *N) { in classof()
620 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
627 class CheckValueTypeMatcher : public Matcher {
631 : Matcher(CheckValueType), TypeName(type_name) {} in CheckValueTypeMatcher()
635 static inline bool classof(const Matcher *N) { in classof()
641 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
644 bool isContradictoryImpl(const Matcher *M) const override;
651 class CheckComplexPatMatcher : public Matcher {
667 : Matcher(CheckComplexPat), Pattern(pattern), MatchNumber(matchnumber), in CheckComplexPatMatcher()
676 static inline bool classof(const Matcher *N) { in classof()
682 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
690 class CheckAndImmMatcher : public Matcher {
694 : Matcher(CheckAndImm), Value(value) {} in CheckAndImmMatcher()
698 static inline bool classof(const Matcher *N) { in classof()
704 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
711 class CheckOrImmMatcher : public Matcher {
715 : Matcher(CheckOrImm), Value(value) {} in CheckOrImmMatcher()
719 static inline bool classof(const Matcher *N) { in classof()
725 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
732 class CheckFoldableChainNodeMatcher : public Matcher {
735 : Matcher(CheckFoldableChainNode) {} in CheckFoldableChainNodeMatcher()
737 static inline bool classof(const Matcher *N) { in classof()
743 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
747 class EmitIntegerMatcher : public Matcher {
752 : Matcher(EmitInteger), Val(val), VT(vt) {} in EmitIntegerMatcher()
757 static inline bool classof(const Matcher *N) { in classof()
763 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
771 class EmitStringIntegerMatcher : public Matcher {
776 : Matcher(EmitStringInteger), Val(val), VT(vt) {} in EmitStringIntegerMatcher()
781 static inline bool classof(const Matcher *N) { in classof()
787 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
794 class EmitRegisterMatcher : public Matcher {
801 : Matcher(EmitRegister), Reg(reg), VT(vt) {} in EmitRegisterMatcher()
806 static inline bool classof(const Matcher *N) { in classof()
812 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
821 class EmitConvertToTargetMatcher : public Matcher {
825 : Matcher(EmitConvertToTarget), Slot(slot) {} in EmitConvertToTargetMatcher()
829 static inline bool classof(const Matcher *N) { in classof()
835 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
844 class EmitMergeInputChainsMatcher : public Matcher {
848 : Matcher(EmitMergeInputChains), ChainNodes(nodes.begin(), nodes.end()) {} in EmitMergeInputChainsMatcher()
857 static inline bool classof(const Matcher *N) { in classof()
863 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
871 class EmitCopyToRegMatcher : public Matcher {
876 : Matcher(EmitCopyToReg), SrcSlot(srcSlot), DestPhysReg(destPhysReg) {} in EmitCopyToRegMatcher()
881 static inline bool classof(const Matcher *N) { in classof()
887 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
897 class EmitNodeXFormMatcher : public Matcher {
902 : Matcher(EmitNodeXForm), Slot(slot), NodeXForm(nodeXForm) {} in EmitNodeXFormMatcher()
907 static inline bool classof(const Matcher *N) { in classof()
913 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
921 class EmitNodeMatcherCommon : public Matcher {
938 : Matcher(isMorphNodeTo ? MorphNodeTo : EmitNode), OpcodeName(opcodeName), in EmitNodeMatcherCommon()
967 static inline bool classof(const Matcher *N) { in classof()
973 bool isEqualImpl(const Matcher *M) const override;
994 static inline bool classof(const Matcher *N) { in classof()
1018 static inline bool classof(const Matcher *N) { in classof()
1026 class CompleteMatchMatcher : public Matcher {
1032 : Matcher(CompleteMatch), Results(results.begin(), results.end()), in CompleteMatchMatcher()
1039 static inline bool classof(const Matcher *N) { in classof()
1045 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()