Lines Matching refs: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 std::unique_ptr<Matcher> Next;
47 // Matcher state manipulation.
91 Matcher(KindTy K) : Kind(K) {}
93 virtual ~Matcher() {}
97 Matcher *getNext() { return Next.get(); }
98 const Matcher *getNext() const { return Next.get(); }
99 void setNext(Matcher *C) { Next.reset(C); }
100 Matcher *takeNext() { return Next.release(); }
102 std::unique_ptr<Matcher> &getNextPtr() { return Next; }
104 bool isEqual(const Matcher *M) const {
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 {
182 virtual bool isEqualImpl(const Matcher *M) const = 0;
184 virtual bool isContradictoryImpl(const Matcher *M) const { return false; }
190 class ScopeMatcher : public Matcher {
191 SmallVector<Matcher*, 4> Children;
193 ScopeMatcher(ArrayRef<Matcher *> children)
194 : Matcher(Scope), Children(children.begin(), children.end()) {
200 Matcher *getChild(unsigned i) { return Children[i]; }
201 const Matcher *getChild(unsigned i) const { return Children[i]; }
203 void resetChild(unsigned i, Matcher *N) {
208 Matcher *takeChild(unsigned i) {
209 Matcher *Res = Children[i];
223 static inline bool classof(const Matcher *N) {
229 bool isEqualImpl(const Matcher *M) const override { return false; }
234 class RecordMatcher : public Matcher {
244 : Matcher(RecordNode), WhatFor(whatfor), ResultNo(resultNo) {}
249 static inline bool classof(const Matcher *N) {
256 bool isEqualImpl(const Matcher *M) const override { return true; }
263 class RecordChildMatcher : public Matcher {
276 : Matcher(RecordChild), ChildNo(childno), WhatFor(whatfor),
283 static inline bool classof(const Matcher *N) {
291 bool isEqualImpl(const Matcher *M) const override {
298 class RecordMemRefMatcher : public Matcher {
300 RecordMemRefMatcher() : Matcher(RecordMemRef) {}
302 static inline bool classof(const Matcher *N) {
310 bool isEqualImpl(const Matcher *M) const override { return true; }
317 class CaptureGlueInputMatcher : public Matcher {
319 CaptureGlueInputMatcher() : Matcher(CaptureGlueInput) {}
321 static inline bool classof(const Matcher *N) {
329 bool isEqualImpl(const Matcher *M) const override { return true; }
335 class MoveChildMatcher : public Matcher {
338 MoveChildMatcher(unsigned childNo) : Matcher(MoveChild), ChildNo(childNo) {}
342 static inline bool classof(const Matcher *N) {
350 bool isEqualImpl(const Matcher *M) const override {
358 class MoveParentMatcher : public Matcher {
360 MoveParentMatcher() : Matcher(MoveParent) {}
362 static inline bool classof(const Matcher *N) {
370 bool isEqualImpl(const Matcher *M) const override { return true; }
377 class CheckSameMatcher : public Matcher {
381 : Matcher(CheckSame), MatchNumber(matchnumber) {}
385 static inline bool classof(const Matcher *N) {
393 bool isEqualImpl(const Matcher *M) const override {
402 class CheckChildSameMatcher : public Matcher {
407 : Matcher(CheckChildSame), ChildNo(childno), MatchNumber(matchnumber) {}
412 static inline bool classof(const Matcher *N) {
420 bool isEqualImpl(const Matcher *M) const override {
430 class CheckPatternPredicateMatcher : public Matcher {
434 : Matcher(CheckPatternPredicate), Predicate(predicate) {}
438 static inline bool classof(const Matcher *N) {
446 bool isEqualImpl(const Matcher *M) const override {
454 class CheckPredicateMatcher : public Matcher {
461 static inline bool classof(const Matcher *N) {
470 bool isEqualImpl(const Matcher *M) const override {
479 class CheckOpcodeMatcher : public Matcher {
483 : Matcher(CheckOpcode), Opcode(opcode) {}
487 static inline bool classof(const Matcher *N) {
495 bool isEqualImpl(const Matcher *M) const override;
497 bool isContradictoryImpl(const Matcher *M) const override;
504 class SwitchOpcodeMatcher : public Matcher {
505 SmallVector<std::pair<const SDNodeInfo*, Matcher*>, 8> Cases;
507 SwitchOpcodeMatcher(ArrayRef<std::pair<const SDNodeInfo*, Matcher*> > cases)
508 : Matcher(SwitchOpcode), Cases(cases.begin(), cases.end()) {}
511 static inline bool classof(const Matcher *N) {
518 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; }
519 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; }
523 bool isEqualImpl(const Matcher *M) const override { return false; }
529 class CheckTypeMatcher : public Matcher {
534 : Matcher(CheckType), Type(type), ResNo(resno) {}
539 static inline bool classof(const Matcher *N) {
547 bool isEqualImpl(const Matcher *M) const override {
551 bool isContradictoryImpl(const Matcher *M) const override;
558 class SwitchTypeMatcher : public Matcher {
559 SmallVector<std::pair<MVT::SimpleValueType, Matcher*>, 8> Cases;
561 SwitchTypeMatcher(ArrayRef<std::pair<MVT::SimpleValueType, Matcher*> > cases)
562 : Matcher(SwitchType), Cases(cases.begin(), cases.end()) {}
565 static inline bool classof(const Matcher *N) {
572 Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; }
573 const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; }
577 bool isEqualImpl(const Matcher *M) const override { return false; }
584 class CheckChildTypeMatcher : public Matcher {
589 : Matcher(CheckChildType), ChildNo(childno), Type(type) {}
594 static inline bool classof(const Matcher *N) {
602 bool isEqualImpl(const Matcher *M) const override {
607 bool isContradictoryImpl(const Matcher *M) const override;
613 class CheckIntegerMatcher : public Matcher {
617 : Matcher(CheckInteger), Value(value) {}
621 static inline bool classof(const Matcher *N) {
629 bool isEqualImpl(const Matcher *M) const override {
633 bool isContradictoryImpl(const Matcher *M) const override;
638 class CheckChildIntegerMatcher : public Matcher {
643 : Matcher(CheckChildInteger), ChildNo(childno), Value(value) {}
648 static inline bool classof(const Matcher *N) {
656 bool isEqualImpl(const Matcher *M) const override {
661 bool isContradictoryImpl(const Matcher *M) const override;
666 class CheckCondCodeMatcher : public Matcher {
670 : Matcher(CheckCondCode), CondCodeName(condcodename) {}
674 static inline bool classof(const Matcher *N) {
682 bool isEqualImpl(const Matcher *M) const override {
690 class CheckValueTypeMatcher : public Matcher {
694 : Matcher(CheckValueType), TypeName(type_name) {}
698 static inline bool classof(const Matcher *N) {
706 bool isEqualImpl(const Matcher *M) const override {
710 bool isContradictoryImpl(const Matcher *M) const override;
717 class CheckComplexPatMatcher : public Matcher {
733 : Matcher(CheckComplexPat), Pattern(pattern), MatchNumber(matchnumber),
742 static inline bool classof(const Matcher *N) {
751 bool isEqualImpl(const Matcher *M) const override {
762 class CheckAndImmMatcher : public Matcher {
766 : Matcher(CheckAndImm), Value(value) {}
770 static inline bool classof(const Matcher *N) {
778 bool isEqualImpl(const Matcher *M) const override {
786 class CheckOrImmMatcher : public Matcher {
790 : Matcher(CheckOrImm), Value(value) {}
794 static inline bool classof(const Matcher *N) {
802 bool isEqualImpl(const Matcher *M) const override {
810 class CheckFoldableChainNodeMatcher : public Matcher {
813 : Matcher(CheckFoldableChainNode) {}
815 static inline bool classof(const Matcher *N) {
823 bool isEqualImpl(const Matcher *M) const override { return true; }
828 class EmitIntegerMatcher : public Matcher {
833 : Matcher(EmitInteger), Val(val), VT(vt) {}
838 static inline bool classof(const Matcher *N) {
844 bool isEqualImpl(const Matcher *M) const override {
853 class EmitStringIntegerMatcher : public Matcher {
858 : Matcher(EmitStringInteger), Val(val), VT(vt) {}
863 static inline bool classof(const Matcher *N) {
869 bool isEqualImpl(const Matcher *M) const override {
877 class EmitRegisterMatcher : public Matcher {
884 : Matcher(EmitRegister), Reg(reg), VT(vt) {}
889 static inline bool classof(const Matcher *N) {
895 bool isEqualImpl(const Matcher *M) const override {
907 class EmitConvertToTargetMatcher : public Matcher {
911 : Matcher(EmitConvertToTarget), Slot(slot) {}
915 static inline bool classof(const Matcher *N) {
921 bool isEqualImpl(const Matcher *M) const override {
931 class EmitMergeInputChainsMatcher : public Matcher {
935 : Matcher(EmitMergeInputChains), ChainNodes(nodes.begin(), nodes.end()) {}
944 static inline bool classof(const Matcher *N) {
950 bool isEqualImpl(const Matcher *M) const override {
959 class EmitCopyToRegMatcher : public Matcher {
964 : Matcher(EmitCopyToReg), SrcSlot(srcSlot), DestPhysReg(destPhysReg) {}
969 static inline bool classof(const Matcher *N) {
975 bool isEqualImpl(const Matcher *M) const override {
988 class EmitNodeXFormMatcher : public Matcher {
993 : Matcher(EmitNodeXForm), Slot(slot), NodeXForm(nodeXForm) {}
998 static inline bool classof(const Matcher *N) {
1004 bool isEqualImpl(const Matcher *M) const override {
1015 class EmitNodeMatcherCommon : public Matcher {
1032 : Matcher(isMorphNodeTo ? MorphNodeTo : EmitNode), OpcodeName(opcodeName),
1061 static inline bool classof(const Matcher *N) {
1067 bool isEqualImpl(const Matcher *M) const override;
1089 static inline bool classof(const Matcher *N) {
1113 static inline bool classof(const Matcher *N) {
1121 class MarkGlueResultsMatcher : public Matcher {
1125 : Matcher(MarkGlueResults), GlueResultNodes(nodes.begin(), nodes.end()) {}
1134 static inline bool classof(const Matcher *N) {
1140 bool isEqualImpl(const Matcher *M) const override {
1149 class CompleteMatchMatcher : public Matcher {
1155 : Matcher(CompleteMatch), Results(results.begin(), results.end()),
1162 static inline bool classof(const Matcher *N) {
1168 bool isEqualImpl(const Matcher *M) const override {