#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Matchers.h"
#include "mlir/Interfaces/FunctionInterfaces.h"
#include "mlir/Pass/Pass.h"
usingnamespacemlir;
namespace {
struct TestMatchers
: public PassWrapper<TestMatchers, InterfacePass<FunctionOpInterface>> { … };
}
template <typename Matcher>
static unsigned countMatches(FunctionOpInterface f, Matcher &matcher) { … }
m_Any;
m_Val;
static void test1(FunctionOpInterface f) { … }
void test2(FunctionOpInterface f) { … }
void test3(FunctionOpInterface f) { … }
void TestMatchers::runOnOperation() { … }
namespace mlir {
void registerTestMatchers() { … }
}