MLIR
21.0.0git
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
a
c
f
h
i
k
m
n
o
p
r
s
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
m
n
o
p
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
f
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
c
d
e
f
g
h
i
k
l
m
n
p
r
s
u
v
Related Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Variables
_
a
b
c
d
e
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
h
i
m
n
o
r
s
t
u
v
y
Enumerations
Enumerator
a
b
c
e
f
g
i
m
n
s
t
w
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
y
z
include
mlir
Query
Matcher
MatchFinder.h
Go to the documentation of this file.
1
//===- MatchFinder.h - ------------------------------------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file contains the MatchFinder class, which is used to find operations
10
// that match a given matcher.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef MLIR_TOOLS_MLIRQUERY_MATCHER_MATCHERFINDER_H
15
#define MLIR_TOOLS_MLIRQUERY_MATCHER_MATCHERFINDER_H
16
17
#include "
MatchersInternal.h
"
18
19
namespace
mlir::query::matcher
{
20
21
// MatchFinder is used to find all operations that match a given matcher.
22
class
MatchFinder
{
23
public
:
24
// Returns all operations that match the given matcher.
25
static
std::vector<Operation *>
getMatches
(
Operation
*root,
26
DynMatcher
matcher) {
27
std::vector<Operation *> matches;
28
29
// Simple match finding with walk.
30
root->
walk
([&](
Operation
*subOp) {
31
if
(matcher.
match
(subOp))
32
matches.push_back(subOp);
33
});
34
35
return
matches;
36
}
37
};
38
39
}
// namespace mlir::query::matcher
40
41
#endif
// MLIR_TOOLS_MLIRQUERY_MATCHER_MATCHERFINDER_H
MatchersInternal.h
mlir::Operation
Operation is the basic unit of execution within MLIR.
Definition:
Operation.h:88
mlir::Operation::walk
std::enable_if_t< llvm::function_traits< std::decay_t< FnT > >::num_args==1, RetT > walk(FnT &&callback)
Walk the operation by calling the callback for each nested operation (including this one),...
Definition:
Operation.h:798
mlir::query::matcher::DynMatcher
Definition:
MatchersInternal.h:51
mlir::query::matcher::DynMatcher::match
bool match(Operation *op) const
Definition:
MatchersInternal.h:64
mlir::query::matcher::MatchFinder
Definition:
MatchFinder.h:22
mlir::query::matcher::MatchFinder::getMatches
static std::vector< Operation * > getMatches(Operation *root, DynMatcher matcher)
Definition:
MatchFinder.h:25
mlir::query::matcher
Definition:
ErrorBuilder.h:20
Generated on Fri May 2 2025 16:32:40 for MLIR by
1.9.1