Lines Matching refs:Matcher
21 class Matcher; variable
30 Matcher *ConvertPatternToMatcher(const PatternToMatch &Pattern,unsigned Variant,
32 void OptimizeMatcher(std::unique_ptr<Matcher> &Matcher,
34 void EmitMatcherTable(Matcher *Matcher, const CodeGenDAGPatterns &CGP,
40 class Matcher {
43 std::unique_ptr<Matcher> Next;
97 Matcher(KindTy K) : Kind(K) {} in Matcher() function
99 virtual ~Matcher() {} in ~Matcher()
105 Matcher *getNext() { return Next.get(); } in getNext()
106 const Matcher *getNext() const { return Next.get(); } in getNext()
107 void setNext(Matcher *C) { Next.reset(C); } in setNext()
108 Matcher *takeNext() { return Next.release(); } in takeNext()
110 std::unique_ptr<Matcher> &getNextPtr() { return Next; } in getNextPtr()
112 bool isEqual(const Matcher *M) const { in isEqual()
154 Matcher *unlinkNode(Matcher *Other);
159 bool canMoveBefore(const Matcher *Other) const;
163 bool canMoveBeforeNode(const Matcher *Other) const;
167 bool isContradictory(const Matcher *Other) const { in isContradictory()
182 virtual bool isEqualImpl(const Matcher *M) const = 0;
183 virtual bool isContradictoryImpl(const Matcher *M) const { return false; } in isContradictoryImpl()
189 class ScopeMatcher : public Matcher {
190 SmallVector<Matcher*, 4> Children;
192 ScopeMatcher(ArrayRef<Matcher *> children) in ScopeMatcher()
193 : Matcher(Scope), Children(children.begin(), children.end()) { in ScopeMatcher()
199 Matcher *getChild(unsigned i) { return Children[i]; } in getChild()
200 const Matcher *getChild(unsigned i) const { return Children[i]; } in getChild()
202 void resetChild(unsigned i, Matcher *N) { in resetChild()
207 Matcher *takeChild(unsigned i) { in takeChild()
208 Matcher *Res = Children[i]; in takeChild()
222 static bool classof(const Matcher *N) { in classof()
228 bool isEqualImpl(const Matcher *M) const override { return false; } in isEqualImpl()
232 class RecordMatcher : public Matcher {
242 : Matcher(RecordNode), WhatFor(whatfor), ResultNo(resultNo) {} in RecordMatcher()
247 static bool classof(const Matcher *N) { in classof()
253 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
259 class RecordChildMatcher : public Matcher {
272 : Matcher(RecordChild), ChildNo(childno), WhatFor(whatfor), in RecordChildMatcher()
279 static bool classof(const Matcher *N) { in classof()
285 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
291 class RecordMemRefMatcher : public Matcher {
293 RecordMemRefMatcher() : Matcher(RecordMemRef) {} in RecordMemRefMatcher()
295 static bool classof(const Matcher *N) { in classof()
301 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
307 class CaptureGlueInputMatcher : public Matcher {
309 CaptureGlueInputMatcher() : Matcher(CaptureGlueInput) {} in CaptureGlueInputMatcher()
311 static bool classof(const Matcher *N) { in classof()
317 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
322 class MoveChildMatcher : public Matcher {
325 MoveChildMatcher(unsigned childNo) : Matcher(MoveChild), ChildNo(childNo) {} in MoveChildMatcher()
329 static bool classof(const Matcher *N) { in classof()
335 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
342 class MoveParentMatcher : public Matcher {
344 MoveParentMatcher() : Matcher(MoveParent) {} in MoveParentMatcher()
346 static bool classof(const Matcher *N) { in classof()
352 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
358 class CheckSameMatcher : public Matcher {
362 : Matcher(CheckSame), MatchNumber(matchnumber) {} in CheckSameMatcher()
366 static bool classof(const Matcher *N) { in classof()
372 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
380 class CheckChildSameMatcher : public Matcher {
385 : Matcher(CheckChildSame), ChildNo(childno), MatchNumber(matchnumber) {} in CheckChildSameMatcher()
390 static bool classof(const Matcher *N) { in classof()
396 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
405 class CheckPatternPredicateMatcher : public Matcher {
409 : Matcher(CheckPatternPredicate), Predicate(predicate) {} in CheckPatternPredicateMatcher()
413 static bool classof(const Matcher *N) { in classof()
419 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
426 class CheckPredicateMatcher : public Matcher {
437 static bool classof(const Matcher *N) { in classof()
443 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
451 class CheckOpcodeMatcher : public Matcher {
455 : Matcher(CheckOpcode), Opcode(opcode) {} in CheckOpcodeMatcher()
459 static bool classof(const Matcher *N) { in classof()
465 bool isEqualImpl(const Matcher *M) const override;
466 bool isContradictoryImpl(const Matcher *M) const override;
473 class SwitchOpcodeMatcher : public Matcher {
474 SmallVector<std::pair<const SDNodeInfo*, Matcher*>, 8> Cases;
476 SwitchOpcodeMatcher(ArrayRef<std::pair<const SDNodeInfo*, Matcher*> > cases) in SwitchOpcodeMatcher()
477 : Matcher(SwitchOpcode), Cases(cases.begin(), cases.end()) {} in SwitchOpcodeMatcher()
480 static 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 bool isEqualImpl(const Matcher *M) const override { return false; } in isEqualImpl()
497 class CheckTypeMatcher : public Matcher {
502 : Matcher(CheckType), Type(type), ResNo(resno) {} in CheckTypeMatcher()
507 static bool classof(const Matcher *N) { in classof()
513 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
516 bool isContradictoryImpl(const Matcher *M) const override;
523 class SwitchTypeMatcher : public Matcher {
524 SmallVector<std::pair<MVT::SimpleValueType, Matcher*>, 8> Cases;
526 SwitchTypeMatcher(ArrayRef<std::pair<MVT::SimpleValueType, Matcher*> > cases) in SwitchTypeMatcher()
527 : Matcher(SwitchType), Cases(cases.begin(), cases.end()) {} in SwitchTypeMatcher()
530 static bool classof(const Matcher *N) { in classof()
537 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; } in getCaseMatcher()
538 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; } in getCaseMatcher()
542 bool isEqualImpl(const Matcher *M) const override { return false; } in isEqualImpl()
548 class CheckChildTypeMatcher : public Matcher {
553 : Matcher(CheckChildType), ChildNo(childno), Type(type) {} in CheckChildTypeMatcher()
558 static bool classof(const Matcher *N) { in classof()
564 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
568 bool isContradictoryImpl(const Matcher *M) const override;
574 class CheckIntegerMatcher : public Matcher {
578 : Matcher(CheckInteger), Value(value) {} in CheckIntegerMatcher()
582 static bool classof(const Matcher *N) { in classof()
588 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
591 bool isContradictoryImpl(const Matcher *M) const override;
596 class CheckChildIntegerMatcher : public Matcher {
601 : Matcher(CheckChildInteger), ChildNo(childno), Value(value) {} in CheckChildIntegerMatcher()
606 static bool classof(const Matcher *N) { in classof()
612 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
616 bool isContradictoryImpl(const Matcher *M) const override;
621 class CheckCondCodeMatcher : public Matcher {
625 : Matcher(CheckCondCode), CondCodeName(condcodename) {} in CheckCondCodeMatcher()
629 static bool classof(const Matcher *N) { in classof()
635 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
642 class CheckChild2CondCodeMatcher : public Matcher {
646 : Matcher(CheckChild2CondCode), CondCodeName(condcodename) {} in CheckChild2CondCodeMatcher()
650 static bool classof(const Matcher *N) { in classof()
656 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
663 class CheckValueTypeMatcher : public Matcher {
667 : Matcher(CheckValueType), TypeName(type_name) {} in CheckValueTypeMatcher()
671 static bool classof(const Matcher *N) { in classof()
677 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
680 bool isContradictoryImpl(const Matcher *M) const override;
687 class CheckComplexPatMatcher : public Matcher {
703 : Matcher(CheckComplexPat), Pattern(pattern), MatchNumber(matchnumber), in CheckComplexPatMatcher()
712 static bool classof(const Matcher *N) { in classof()
718 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
726 class CheckAndImmMatcher : public Matcher {
730 : Matcher(CheckAndImm), Value(value) {} in CheckAndImmMatcher()
734 static bool classof(const Matcher *N) { in classof()
740 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
747 class CheckOrImmMatcher : public Matcher {
751 : Matcher(CheckOrImm), Value(value) {} in CheckOrImmMatcher()
755 static bool classof(const Matcher *N) { in classof()
761 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
768 class CheckImmAllOnesVMatcher : public Matcher {
770 CheckImmAllOnesVMatcher() : Matcher(CheckImmAllOnesV) {} in CheckImmAllOnesVMatcher()
772 static bool classof(const Matcher *N) { in classof()
778 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
779 bool isContradictoryImpl(const Matcher *M) const override;
784 class CheckImmAllZerosVMatcher : public Matcher {
786 CheckImmAllZerosVMatcher() : Matcher(CheckImmAllZerosV) {} in CheckImmAllZerosVMatcher()
788 static bool classof(const Matcher *N) { in classof()
794 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
795 bool isContradictoryImpl(const Matcher *M) const override;
800 class CheckFoldableChainNodeMatcher : public Matcher {
803 : Matcher(CheckFoldableChainNode) {} in CheckFoldableChainNodeMatcher()
805 static bool classof(const Matcher *N) { in classof()
811 bool isEqualImpl(const Matcher *M) const override { return true; } in isEqualImpl()
815 class EmitIntegerMatcher : public Matcher {
820 : Matcher(EmitInteger), Val(val), VT(vt) {} in EmitIntegerMatcher()
825 static bool classof(const Matcher *N) { in classof()
831 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
839 class EmitStringIntegerMatcher : public Matcher {
844 : Matcher(EmitStringInteger), Val(val), VT(vt) {} in EmitStringIntegerMatcher()
849 static bool classof(const Matcher *N) { in classof()
855 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
862 class EmitRegisterMatcher : public Matcher {
869 : Matcher(EmitRegister), Reg(reg), VT(vt) {} in EmitRegisterMatcher()
874 static bool classof(const Matcher *N) { in classof()
880 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
889 class EmitConvertToTargetMatcher : public Matcher {
893 : Matcher(EmitConvertToTarget), Slot(slot) {} in EmitConvertToTargetMatcher()
897 static bool classof(const Matcher *N) { in classof()
903 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
912 class EmitMergeInputChainsMatcher : public Matcher {
916 : Matcher(EmitMergeInputChains), ChainNodes(nodes.begin(), nodes.end()) {} in EmitMergeInputChainsMatcher()
925 static bool classof(const Matcher *N) { in classof()
931 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
939 class EmitCopyToRegMatcher : public Matcher {
946 : Matcher(EmitCopyToReg), SrcSlot(srcSlot), DestPhysReg(destPhysReg) {} in EmitCopyToRegMatcher()
951 static bool classof(const Matcher *N) { in classof()
957 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
967 class EmitNodeXFormMatcher : public Matcher {
972 : Matcher(EmitNodeXForm), Slot(slot), NodeXForm(nodeXForm) {} in EmitNodeXFormMatcher()
977 static bool classof(const Matcher *N) { in classof()
983 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()
991 class EmitNodeMatcherCommon : public Matcher {
1008 : Matcher(isMorphNodeTo ? MorphNodeTo : EmitNode), OpcodeName(opcodeName), in EmitNodeMatcherCommon()
1037 static bool classof(const Matcher *N) { in classof()
1043 bool isEqualImpl(const Matcher *M) const override;
1064 static bool classof(const Matcher *N) { in classof()
1088 static bool classof(const Matcher *N) { in classof()
1096 class CompleteMatchMatcher : public Matcher {
1102 : Matcher(CompleteMatch), Results(results.begin(), results.end()), in CompleteMatchMatcher()
1109 static bool classof(const Matcher *N) { in classof()
1115 bool isEqualImpl(const Matcher *M) const override { in isEqualImpl()