MLIR  22.0.0git
MatchersInternal.cpp
Go to the documentation of this file.
1 //===--- MatchersInternal.cpp----------------------------------------------===//
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 
10 
11 namespace mlir::query::matcher {
12 
13 namespace internal {
14 
16  ArrayRef<DynMatcher> innerMatchers) {
17  return llvm::all_of(innerMatchers, [&](const DynMatcher &matcher) {
18  if (matchedOps)
19  return matcher.match(op, *matchedOps);
20  return matcher.match(op);
21  });
22 }
24  ArrayRef<DynMatcher> innerMatchers) {
25  return llvm::any_of(innerMatchers, [&](const DynMatcher &matcher) {
26  if (matchedOps)
27  return matcher.match(op, *matchedOps);
28  return matcher.match(op);
29  });
30 }
31 } // namespace internal
32 } // namespace mlir::query::matcher
Operation is the basic unit of execution within MLIR.
Definition: Operation.h:88
bool match(Operation *op) const
bool anyOfVariadicOperator(Operation *op, SetVector< Operation * > *matchedOps, ArrayRef< DynMatcher > innerMatchers)
bool allOfVariadicOperator(Operation *op, SetVector< Operation * > *matchedOps, ArrayRef< DynMatcher > innerMatchers)
Computes the backward-slice of all transitive defs reachable from rootOp, if innerMatcher matches.
Definition: ErrorBuilder.h:20