xref: /llvm-project/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.h (revision 1eecc1346a9c13eab078c4fd981c755adfda97d5)
1 //===- LinalgTransformOps.h - Linalg transform ops --------------*- C++ -*-===//
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_LINALG_TRANSFORMOPS_LINALGTRANSFORMOPS_H
10 #define MLIR_DIALECT_LINALG_TRANSFORMOPS_LINALGTRANSFORMOPS_H
11 
12 #include "mlir/Dialect/Bufferization/IR/Bufferization.h"
13 #include "mlir/Dialect/Func/IR/FuncOps.h"
14 #include "mlir/Dialect/Linalg/IR/Linalg.h"
15 #include "mlir/Dialect/Transform/IR/TransformAttrs.h"
16 #include "mlir/Dialect/Transform/IR/TransformDialect.h"
17 #include "mlir/Dialect/Transform/IR/TransformTypes.h"
18 #include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.h"
19 #include "mlir/Dialect/Utils/StructuredOpsUtils.h"
20 #include "mlir/IR/OpImplementation.h"
21 #include "mlir/IR/RegionKindInterface.h"
22 
23 namespace mlir {
24 class TilingInterface;
25 class RewriterBase;
26 
27 namespace linalg {
28 class CopyOp;
29 struct ForallTilingResult;
30 class GenericOp;
31 class LinalgOp;
32 } // namespace linalg
33 
34 namespace scf {
35 struct SCFTilingResult;
36 } // namespace scf
37 
38 namespace tensor {
39 class InsertSliceOp;
40 class PackOp;
41 class PadOp;
42 class UnPackOp;
43 } // namespace tensor
44 
45 namespace transform {
46 // Types needed for builders.
47 struct TileSizesSpec {};
48 struct NumThreadsSpec {};
49 } // namespace transform
50 } // namespace mlir
51 
52 namespace mlir {
53 class DialectRegistry;
54 
55 namespace transform {
56 
57 /// Implementation of tiling operations using `scf.forall`.
58 DiagnosedSilenceableFailure
59 tileToForallOpImpl(RewriterBase &rewriter, transform::TransformState &state,
60                    TransformOpInterface transformOp, Operation *target,
61                    ArrayRef<OpFoldResult> mixedNumThreads,
62                    ArrayRef<OpFoldResult> mixedTileSizes,
63                    std::optional<ArrayAttr> mapping,
64                    scf::SCFTilingResult &tilingResult);
65 
66 } // namespace transform
67 } // namespace mlir
68 
69 //===----------------------------------------------------------------------===//
70 // Linalg Transform Operations
71 //===----------------------------------------------------------------------===//
72 
73 #include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOpsEnums.h.inc"
74 
75 #define GET_OP_CLASSES
76 #include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.h.inc"
77 
78 #endif // MLIR_DIALECT_LINALG_TRANSFORMOPS_LINALGTRANSFORMOPS_H
79