9 #ifndef MLIR_ANALYSIS_MLFUNCTIONMATCHER_H_ 10 #define MLIR_ANALYSIS_MLFUNCTIONMATCHER_H_ 14 #include "llvm/Support/Allocator.h" 53 explicit operator bool() {
return matchedOperation !=
nullptr; }
63 static llvm::BumpPtrAllocator *&allocator();
106 op->
walk([&](
Operation *child) { matchOne(child, matches); });
110 unsigned getDepth()
const;
118 static llvm::BumpPtrAllocator *&allocator();
152 assert(NestedMatch::allocator() ==
nullptr &&
153 "Only a single NestedPatternContext is supported");
154 assert(NestedPattern::allocator() ==
nullptr &&
155 "Only a single NestedPatternContext is supported");
156 NestedMatch::allocator() = &allocator;
157 NestedPattern::allocator() = &allocator;
160 NestedMatch::allocator() =
nullptr;
161 NestedPattern::allocator() =
nullptr;
187 #endif // MLIR_ANALYSIS_MLFUNCTIONMATCHER_H_ Definition: InferTypeOpInterface.cpp:20
~NestedPatternContext()
Definition: NestedMatcher.h:159
Definition: Operation.h:27
friend class NestedPattern
Definition: NestedMatcher.h:59
bool isLoadOrStore(Operation &op)
Definition: NestedMatcher.cpp:147
Definition: NestedMatcher.h:149
ArrayRef< NestedMatch > getMatchedChildren()
Definition: NestedMatcher.h:56
NestedPattern If(NestedPattern child)
Definition: NestedMatcher.cpp:115
bool defaultFilterFunction(Operation &)
Definition: NestedMatcher.h:91
Operation * getMatchedOperation()
Definition: NestedMatcher.h:55
Definition: Function.h:32
static NestedMatch build(Operation *operation, ArrayRef< NestedMatch > nestedMatches)
Definition: NestedMatcher.cpp:25
std::function< bool(Operation &)> FilterFunctionType
Definition: NestedMatcher.h:90
void match(FuncOp func, SmallVectorImpl< NestedMatch > *matches)
Returns all the top-level matches in func.
Definition: NestedMatcher.h:100
NestedPattern For(NestedPattern child)
Definition: NestedMatcher.cpp:132
void match(Operation *op, SmallVectorImpl< NestedMatch > *matches)
Returns all the top-level matches in op.
Definition: NestedMatcher.h:105
bool isParallelLoop(Operation &op)
Definition: NestedMatcher.h:46
bool isReductionLoop(Operation &op)
Definition: NestedMatcher.h:92
NestedPattern Op(FilterFunctionType filter)
Definition: NestedMatcher.cpp:111
NestedMatch & operator=(const NestedMatch &)=default
RetT walk(FnT &&callback)
Definition: OpDefinition.h:210
NestedPatternContext()
Definition: NestedMatcher.h:151
RetT walk(FnT &&callback)
Definition: Operation.h:530
llvm::BumpPtrAllocator allocator
Definition: NestedMatcher.h:163