MLIR
20.0.0git
|
An NestedPattern captures nested patterns in the IR. More...
#include "mlir/Dialect/Affine/Analysis/NestedMatcher.h"
Public Member Functions | |
NestedMatch (const NestedMatch &)=default | |
NestedMatch & | operator= (const NestedMatch &)=default |
operator bool () | |
Operation * | getMatchedOperation () const |
ArrayRef< NestedMatch > | getMatchedChildren () |
Static Public Member Functions | |
static NestedMatch | build (Operation *operation, ArrayRef< NestedMatch > nestedMatches) |
Friends | |
class | NestedPattern |
class | NestedPatternContext |
An NestedPattern captures nested patterns in the IR.
It is used in conjunction with a scoped NestedPatternContext which is an llvm::BumpPtrAllocator that handles memory allocations efficiently and avoids ownership issues.
In order to use NestedPatterns, first create a scoped context. When the context goes out of scope, everything is freed. This design simplifies the API by avoiding references to the context and makes it clear that references to matchers must not escape.
Example: { NestedPatternContext context; auto gemmLike = Doall(Doall(Red(LoadStores()))); auto matches = gemmLike.match(f); // do work on matches } // everything is freed
Nested abstraction for matching results. Provides access to the nested Operation* captured by a Matcher.
A NestedMatch contains an Operation* and the children NestedMatch and is thus cheap to copy. NestedMatch is stored in a scoped bumper allocator whose lifetime is managed by an RAII NestedPatternContext.
Definition at line 47 of file NestedMatcher.h.
|
default |
|
static |
Definition at line 27 of file NestedMatcher.cpp.
|
inline |
Definition at line 57 of file NestedMatcher.h.
Referenced by getMatchedAffineLoopsRec().
|
inline |
Definition at line 56 of file NestedMatcher.h.
Referenced by getMatchedAffineLoopsRec().
|
inlineexplicit |
Definition at line 54 of file NestedMatcher.h.
|
default |
|
friend |
Definition at line 60 of file NestedMatcher.h.
|
friend |
Definition at line 61 of file NestedMatcher.h.