xref: /llvm-project/mlir/lib/Dialect/Transform/LoopExtension/LoopExtension.cpp (revision 84cc1865ef9202af39404ff4524a9b13df80cfc1)
1b9fe461eSMatthias Springer //===- LoopExtension.cpp - Loop extension for the Transform dialect -------===//
2b9fe461eSMatthias Springer //
3b9fe461eSMatthias Springer // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4b9fe461eSMatthias Springer // See https://llvm.org/LICENSE.txt for license information.
5b9fe461eSMatthias Springer // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6b9fe461eSMatthias Springer //
7b9fe461eSMatthias Springer //===----------------------------------------------------------------------===//
8b9fe461eSMatthias Springer 
9b9fe461eSMatthias Springer #include "mlir/Dialect/Transform/LoopExtension/LoopExtension.h"
10b9fe461eSMatthias Springer 
11b9fe461eSMatthias Springer #include "mlir/Dialect/Transform/IR/TransformDialect.h"
12b9fe461eSMatthias Springer #include "mlir/Dialect/Transform/LoopExtension/LoopExtensionOps.h"
13b9fe461eSMatthias Springer #include "mlir/IR/DialectRegistry.h"
14b9fe461eSMatthias Springer 
15b9fe461eSMatthias Springer using namespace mlir;
16b9fe461eSMatthias Springer 
17b9fe461eSMatthias Springer namespace {
18b9fe461eSMatthias Springer /// Loop extension of the Transform dialect. This provides "core" transform
19b9fe461eSMatthias Springer /// operations for loop-like ops.
20b9fe461eSMatthias Springer class LoopExtension
21b9fe461eSMatthias Springer     : public transform::TransformDialectExtension<LoopExtension> {
22b9fe461eSMatthias Springer public:
23*84cc1865SNikhil Kalra   MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(LoopExtension)
24*84cc1865SNikhil Kalra 
25b9fe461eSMatthias Springer   void init() {
26b9fe461eSMatthias Springer     registerTransformOps<
27b9fe461eSMatthias Springer #define GET_OP_LIST
28b9fe461eSMatthias Springer #include "mlir/Dialect/Transform/LoopExtension/LoopExtensionOps.cpp.inc"
29b9fe461eSMatthias Springer         >();
30b9fe461eSMatthias Springer   }
31b9fe461eSMatthias Springer };
32b9fe461eSMatthias Springer } // namespace
33b9fe461eSMatthias Springer 
34b9fe461eSMatthias Springer void mlir::transform::registerLoopExtension(DialectRegistry &dialectRegistry) {
35b9fe461eSMatthias Springer   dialectRegistry.addExtensions<LoopExtension>();
36b9fe461eSMatthias Springer }
37