1//===- Passes.h - Pass Entrypoints ------------------------------*- 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// This header file defines prototypes that expose pass constructors.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_DIALECT_SCF_TRANSFORMS_PASSES_H_
14#define MLIR_DIALECT_SCF_TRANSFORMS_PASSES_H_
15
16#include "mlir/Pass/Pass.h"
17
18namespace mlir {
19
20#define GEN_PASS_DECL
21#include "mlir/Dialect/SCF/Transforms/Passes.h.inc"
22
23/// Creates a pass that bufferizes the SCF dialect.
24std::unique_ptr<Pass> createSCFBufferizePass();
25
26/// Creates a pass that specializes for loop for unrolling and
27/// vectorization.
28std::unique_ptr<Pass> createForLoopSpecializationPass();
29
30/// Creates a pass that peels for loops at their upper bounds for
31/// better vectorization.
32std::unique_ptr<Pass> createForLoopPeelingPass();
33
34/// Creates a pass that canonicalizes affine.min and affine.max operations
35/// inside of scf.for loops with known lower and upper bounds.
36std::unique_ptr<Pass> createSCFForLoopCanonicalizationPass();
37
38/// Creates a pass that transforms a single ParallelLoop over N induction
39/// variables into another ParallelLoop over less than N induction variables.
40std::unique_ptr<Pass> createTestSCFParallelLoopCollapsingPass();
41
42/// Creates a loop fusion pass which fuses parallel loops.
43std::unique_ptr<Pass> createParallelLoopFusionPass();
44
45/// Creates a pass that specializes parallel loop for unrolling and
46/// vectorization.
47std::unique_ptr<Pass> createParallelLoopSpecializationPass();
48
49/// Creates a pass which tiles innermost parallel loops.
50/// If noMinMaxBounds, the upper bound of the inner loop will
51/// be a same value among different outter loop iterations, and
52/// an additional inbound check will be emitted inside the internal
53/// loops.
54std::unique_ptr<Pass>
55createParallelLoopTilingPass(llvm::ArrayRef<int64_t> tileSize = {},
56 bool noMinMaxBounds = false);
57
58/// Creates a pass which folds arith ops on induction variable into
59/// loop range.
60std::unique_ptr<Pass> createForLoopRangeFoldingPass();
61
62/// Creates a pass that converts SCF forall loops to SCF for loops.
63std::unique_ptr<Pass> createForallToForLoopPass();
64
65// Creates a pass which lowers for loops into while loops.
66std::unique_ptr<Pass> createForToWhileLoopPass();
67
68//===----------------------------------------------------------------------===//
69// Registration
70//===----------------------------------------------------------------------===//
71
72/// Generate the code for registering passes.
73#define GEN_PASS_REGISTRATION
74#include "mlir/Dialect/SCF/Transforms/Passes.h.inc"
75
76} // namespace mlir
77
78#endif // MLIR_DIALECT_SCF_TRANSFORMS_PASSES_H_
79

source code of mlir/include/mlir/Dialect/SCF/Transforms/Passes.h