| 1 | //===- IRDLExtension.cpp - IRDL extension for the Transform dialect -------===// |
|---|---|
| 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 | #include "mlir/Dialect/Transform/IRDLExtension/IRDLExtension.h" |
| 10 | #include "mlir/Dialect/IRDL/IR/IRDL.h" |
| 11 | #include "mlir/Dialect/Transform/IR/TransformDialect.h" |
| 12 | #include "mlir/Dialect/Transform/IRDLExtension/IRDLExtensionOps.h" |
| 13 | #include "mlir/IR/DialectRegistry.h" |
| 14 | |
| 15 | using namespace mlir; |
| 16 | |
| 17 | namespace { |
| 18 | class IRDLExtension |
| 19 | : public transform::TransformDialectExtension<IRDLExtension> { |
| 20 | public: |
| 21 | MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(IRDLExtension) |
| 22 | |
| 23 | void init() { |
| 24 | registerTransformOps< |
| 25 | #define GET_OP_LIST |
| 26 | #include "mlir/Dialect/Transform/IRDLExtension/IRDLExtensionOps.cpp.inc" |
| 27 | >(); |
| 28 | |
| 29 | declareDependentDialect<irdl::IRDLDialect>(); |
| 30 | } |
| 31 | }; |
| 32 | } // namespace |
| 33 | |
| 34 | void mlir::transform::registerIRDLExtension(DialectRegistry &dialectRegistry) { |
| 35 | dialectRegistry.addExtensions<IRDLExtension>(); |
| 36 | } |
| 37 |
