xref: /llvm-project/mlir/include/mlir/Dialect/Transform/IRDLExtension/IRDLExtensionOps.td (revision 105c992c83aa527c6c50d60becd4d66b476b0a32)
1//===- IRDLExtensionOps.td - Transform dialect extension ---*- tablegen -*-===//
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#ifndef MLIR_DIALECT_TRANSFORM_IRDLEXTENSION_IRDLEXTENSIONOPS
10#define MLIR_DIALECT_TRANSFORM_IRDLEXTENSION_IRDLEXTENSIONOPS
11
12include "mlir/Dialect/Transform/IR/TransformDialect.td"
13include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.td"
14include "mlir/Interfaces/SideEffectInterfaces.td"
15include "mlir/IR/SymbolInterfaces.td"
16
17def IRDLCollectMatchingOp : TransformDialectOp<"irdl.collect_matching",
18    [DeclareOpInterfaceMethods<TransformOpInterface>,
19     DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
20     SymbolTable,
21     NoTerminator]> {
22  let summary =
23    "Finds ops that match the IRDL definition without registering them.";
24
25  let arguments = (ins TransformHandleTypeInterface:$root);
26  let regions = (region SizedRegion<1>:$body);
27  let results = (outs TransformHandleTypeInterface:$matched);
28
29  let assemblyFormat =
30    "`in` $root `:` functional-type(operands, results) attr-dict-with-keyword "
31    "regions";
32
33  let hasVerifier = 1;
34}
35
36#endif // MLIR_DIALECT_TRANSFORM_IRDLEXTENSION_IRDLEXTENSIONOPS
37