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