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;
92 Matcher(KindTy K) : Kind(K) {} in Matcher() function
94 virtual ~Matcher() {} in ~Matcher()
98 Matcher *getNext() { return Next.get(); } in getNext()
99 const Matcher *getNext() const { return Next.get(); } in getNext()
100 void setNext(Matcher *C) { Next.reset(C); } in setNext()
101 Matcher *takeNext() { return Next.release(); } in takeNext()
103 std::unique_ptr<Matcher> &getNextPtr() { return Next; } in getNextPtr()
105 bool isEqual(const Matcher *M) const { in isEqual()
155 Matcher *unlinkNode(Matcher *Other);
160 bool canMoveBefore(const Matcher *Other) const;
164 bool canMoveBeforeNode(const Matcher *Other) const;
168 bool isContradictory(const Matcher *Other) const { in isContradictory()
183 virtual bool isEqualImpl(const Matcher *M) const = 0;
185 virtual bool isContradictoryImpl(const Matcher *M) const { return false; } in isContradictoryImpl()
191 class ScopeMatcher : public Matcher {
192 SmallVector<Matcher*, 4> Children;
194 ScopeMatcher(ArrayRef<Matcher *> children) in ScopeMatcher()
195 : Matcher(Scope), Children(children.begin(), children.end()) { in ScopeMatcher()
201 Matcher *getChild(unsigned i) { return Children[i]; } in getChild()
202 const Matcher *getChild(unsigned i) const { return Children[i]; } in getChild()
204 void resetChild(unsigned i, Matcher *N) { in resetChild()
209 Matcher *takeChild(unsigned i) { in takeChild()
210 Matcher *Res = Children[i]; in takeChild()
224 static inline bool classof(const Matcher *N) { in classof()
230 bool isEqualImpl(const Matcher *M) const override { return false; } in isEqualImpl()
235 class RecordMatcher : public Matcher {
245 : Matcher(RecordNode), WhatFor(whatfor), ResultNo(resultNo) {} in RecordMatcher()
250 static inline bool classof(const Matcher *N) { in classof()
257 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
264 class RecordChildMatcher : public Matcher {
277 : Matcher(RecordChild), ChildNo(childno), WhatFor(whatfor), in RecordChildMatcher()
284 static inline bool classof(const Matcher *N) { in classof()
292 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
299 class RecordMemRefMatcher : public Matcher {
301 RecordMemRefMatcher() : Matcher(RecordMemRef) {} in RecordMemRefMatcher()
303 static inline bool classof(const Matcher *N) { in classof()
311 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
318 class CaptureGlueInputMatcher : public Matcher {
320 CaptureGlueInputMatcher() : Matcher(CaptureGlueInput) {} in CaptureGlueInputMatcher()
322 static inline bool classof(const Matcher *N) { in classof()
330 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
336 class MoveChildMatcher : public Matcher {
339 MoveChildMatcher(unsigned childNo) : Matcher(MoveChild), ChildNo(childNo) {} in MoveChildMatcher()
343 static inline bool classof(const Matcher *N) { in classof()
351 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
359 class MoveParentMatcher : public Matcher {
361 MoveParentMatcher() : Matcher(MoveParent) {} in MoveParentMatcher()
363 static inline bool classof(const Matcher *N) { in classof()
371 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
378 class CheckSameMatcher : public Matcher {
382 : Matcher(CheckSame), MatchNumber(matchnumber) {} in CheckSameMatcher()
386 static inline bool classof(const Matcher *N) { in classof()
394 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
403 class CheckChildSameMatcher : public Matcher {
408 : Matcher(CheckChildSame), ChildNo(childno), MatchNumber(matchnumber) {} in CheckChildSameMatcher()
413 static inline bool classof(const Matcher *N) { in classof()
421 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
431 class CheckPatternPredicateMatcher : public Matcher {
435 : Matcher(CheckPatternPredicate), Predicate(predicate) {} in CheckPatternPredicateMatcher()
439 static inline bool classof(const Matcher *N) { in classof()
447 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
455 class CheckPredicateMatcher : public Matcher {
462 static inline bool classof(const Matcher *N) { in classof()
471 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
480 class CheckOpcodeMatcher : public Matcher {
484 : Matcher(CheckOpcode), Opcode(opcode) {} in CheckOpcodeMatcher()
488 static inline bool classof(const Matcher *N) { in classof()
496 bool isEqualImpl(const Matcher *M) const override;
498 bool isContradictoryImpl(const Matcher *M) const override;
505 class SwitchOpcodeMatcher : public Matcher {
506 SmallVector<std::pair<const SDNodeInfo*, Matcher*>, 8> Cases;
508 SwitchOpcodeMatcher(ArrayRef<std::pair<const SDNodeInfo*, Matcher*> > cases) in SwitchOpcodeMatcher()
509 : Matcher(SwitchOpcode), Cases(cases.begin(), cases.end()) {} in SwitchOpcodeMatcher()
512 static inline bool classof(const Matcher *N) { in classof()
519 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; } in getCaseMatcher()
520 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; } in getCaseMatcher()
524 bool isEqualImpl(const Matcher *M) const override { return false; } in isEqualImpl()
530 class CheckTypeMatcher : public Matcher {
535 : Matcher(CheckType), Type(type), ResNo(resno) {} in CheckTypeMatcher()
540 static inline bool classof(const Matcher *N) { in classof()
548 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
552 bool isContradictoryImpl(const Matcher *M) const override;
559 class SwitchTypeMatcher : public Matcher {
560 SmallVector<std::pair<MVT::SimpleValueType, Matcher*>, 8> Cases;
562 SwitchTypeMatcher(ArrayRef<std::pair<MVT::SimpleValueType, Matcher*> > cases) in SwitchTypeMatcher()
563 : Matcher(SwitchType), Cases(cases.begin(), cases.end()) {} in SwitchTypeMatcher()
566 static inline bool classof(const Matcher *N) { in classof()
573 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; } in getCaseMatcher()
574 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; } in getCaseMatcher()
578 bool isEqualImpl(const Matcher *M) const override { return false; } in isEqualImpl()
585 class CheckChildTypeMatcher : public Matcher {
590 : Matcher(CheckChildType), ChildNo(childno), Type(type) {} in CheckChildTypeMatcher()
595 static inline bool classof(const Matcher *N) { in classof()
603 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
608 bool isContradictoryImpl(const Matcher *M) const override;
614 class CheckIntegerMatcher : public Matcher {
618 : Matcher(CheckInteger), Value(value) {} in CheckIntegerMatcher()
622 static inline bool classof(const Matcher *N) { in classof()
630 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
634 bool isContradictoryImpl(const Matcher *M) const override;
639 class CheckChildIntegerMatcher : public Matcher {
644 : Matcher(CheckChildInteger), ChildNo(childno), Value(value) {} in CheckChildIntegerMatcher()
649 static inline bool classof(const Matcher *N) { in classof()
657 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
662 bool isContradictoryImpl(const Matcher *M) const override;
667 class CheckCondCodeMatcher : public Matcher {
671 : Matcher(CheckCondCode), CondCodeName(condcodename) {} in CheckCondCodeMatcher()
675 static inline bool classof(const Matcher *N) { in classof()
683 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
691 class CheckValueTypeMatcher : public Matcher {
695 : Matcher(CheckValueType), TypeName(type_name) {} in CheckValueTypeMatcher()
699 static inline bool classof(const Matcher *N) { in classof()
707 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
711 bool isContradictoryImpl(const Matcher *M) const override;
718 class CheckComplexPatMatcher : public Matcher {
734 : Matcher(CheckComplexPat), Pattern(pattern), MatchNumber(matchnumber), in CheckComplexPatMatcher()
743 static inline bool classof(const Matcher *N) { in classof()
752 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
763 class CheckAndImmMatcher : public Matcher {
767 : Matcher(CheckAndImm), Value(value) {} in CheckAndImmMatcher()
771 static inline bool classof(const Matcher *N) { in classof()
779 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
787 class CheckOrImmMatcher : public Matcher {
791 : Matcher(CheckOrImm), Value(value) {} in CheckOrImmMatcher()
795 static inline bool classof(const Matcher *N) { in classof()
803 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
811 class CheckFoldableChainNodeMatcher : public Matcher {
814 : Matcher(CheckFoldableChainNode) {} in CheckFoldableChainNodeMatcher()
816 static inline bool classof(const Matcher *N) { in classof()
824 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
829 class EmitIntegerMatcher : public Matcher {
834 : Matcher(EmitInteger), Val(val), VT(vt) {} in EmitIntegerMatcher()
839 static inline bool classof(const Matcher *N) { in classof()
845 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
854 class EmitStringIntegerMatcher : public Matcher {
859 : Matcher(EmitStringInteger), Val(val), VT(vt) {} in EmitStringIntegerMatcher()
864 static inline bool classof(const Matcher *N) { in classof()
870 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
878 class EmitRegisterMatcher : public Matcher {
885 : Matcher(EmitRegister), Reg(reg), VT(vt) {} in EmitRegisterMatcher()
890 static inline bool classof(const Matcher *N) { in classof()
896 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
908 class EmitConvertToTargetMatcher : public Matcher {
912 : Matcher(EmitConvertToTarget), Slot(slot) {} in EmitConvertToTargetMatcher()
916 static inline bool classof(const Matcher *N) { in classof()
922 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
932 class EmitMergeInputChainsMatcher : public Matcher {
936 : Matcher(EmitMergeInputChains), ChainNodes(nodes.begin(), nodes.end()) {} in EmitMergeInputChainsMatcher()
945 static inline bool classof(const Matcher *N) { in classof()
951 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
960 class EmitCopyToRegMatcher : public Matcher {
965 : Matcher(EmitCopyToReg), SrcSlot(srcSlot), DestPhysReg(destPhysReg) {} in EmitCopyToRegMatcher()
970 static inline bool classof(const Matcher *N) { in classof()
976 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
989 class EmitNodeXFormMatcher : public Matcher {
994 : Matcher(EmitNodeXForm), Slot(slot), NodeXForm(nodeXForm) {} in EmitNodeXFormMatcher()
999 static inline bool classof(const Matcher *N) { in classof()
1005 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
1016 class EmitNodeMatcherCommon : public Matcher {
1033 : Matcher(isMorphNodeTo ? MorphNodeTo : EmitNode), OpcodeName(opcodeName), in EmitNodeMatcherCommon()
1062 static inline bool classof(const Matcher *N) { in classof()
1068 bool isEqualImpl(const Matcher *M) const override;
1090 static inline bool classof(const Matcher *N) { in classof()
1114 static inline bool classof(const Matcher *N) { in classof()
1122 class MarkGlueResultsMatcher : public Matcher {
1126 : Matcher(MarkGlueResults), GlueResultNodes(nodes.begin(), nodes.end()) {} in MarkGlueResultsMatcher()
1135 static inline bool classof(const Matcher *N) { in classof()
1141 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
1150 class CompleteMatchMatcher : public Matcher {
1156 : Matcher(CompleteMatch), Results(results.begin(), results.end()), in CompleteMatchMatcher()
1163 static inline bool classof(const Matcher *N) { in classof()
1169 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()