MLIR 23.0.0git
Passes.h
Go to the documentation of this file.
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 specializes for loop for unrolling and
24/// vectorization.
25std::unique_ptr<Pass> createForLoopSpecializationPass();
26
27/// Creates a pass that canonicalizes affine.min and affine.max operations
28/// inside of scf.for loops with known lower and upper bounds.
29std::unique_ptr<Pass> createSCFForLoopCanonicalizationPass();
30
31/// Creates a pass that transforms a single ParallelLoop over N induction
32/// variables into another ParallelLoop over less than N induction variables.
33std::unique_ptr<Pass> createTestSCFParallelLoopCollapsingPass();
34
35/// Creates a loop fusion pass which fuses parallel loops.
36std::unique_ptr<Pass> createParallelLoopFusionPass();
37
38/// Creates a pass that specializes parallel loop for unrolling and
39/// vectorization.
40std::unique_ptr<Pass> createParallelLoopSpecializationPass();
41
42/// Creates a pass which tiles innermost parallel loops.
43/// If noMinMaxBounds, the upper bound of the inner loop will
44/// be a same value among different outter loop iterations, and
45/// an additional inbound check will be emitted inside the internal
46/// loops.
47std::unique_ptr<Pass>
49 bool noMinMaxBounds = false);
50
51/// Creates a pass which folds arith ops on induction variable into
52/// loop range.
53std::unique_ptr<Pass> createForLoopRangeFoldingPass();
54
55/// Creates a pass that converts SCF forall loops to SCF for loops.
56std::unique_ptr<Pass> createForallToForLoopPass();
57
58/// Creates a pass that converts SCF forall loops to SCF parallel loops.
59std::unique_ptr<Pass> createForallToParallelLoopPass();
60
61/// Creates a pass that converts SCF forall loops to SCF parallel loops.
62std::unique_ptr<Pass> createParallelForToNestedForsPass();
63
64// Creates a pass which lowers for loops into while loops.
65std::unique_ptr<Pass> createForToWhileLoopPass();
66
67//===----------------------------------------------------------------------===//
68// Registration
69//===----------------------------------------------------------------------===//
70
71/// Generate the code for registering passes.
72#define GEN_PASS_REGISTRATION
73#include "mlir/Dialect/SCF/Transforms/Passes.h.inc"
74
75} // namespace mlir
76
77#endif // MLIR_DIALECT_SCF_TRANSFORMS_PASSES_H_
Include the generated interface declarations.
std::unique_ptr< Pass > createForallToParallelLoopPass()
Creates a pass that converts SCF forall loops to SCF parallel loops.
std::unique_ptr< Pass > createParallelLoopSpecializationPass()
Creates a pass that specializes parallel loop for unrolling and vectorization.
std::unique_ptr< Pass > createForLoopSpecializationPass()
Creates a pass that specializes for loop for unrolling and vectorization.
std::unique_ptr< Pass > createForallToForLoopPass()
Creates a pass that converts SCF forall loops to SCF for loops.
std::unique_ptr< Pass > createParallelLoopTilingPass(llvm::ArrayRef< int64_t > tileSize={}, bool noMinMaxBounds=false)
Creates a pass which tiles innermost parallel loops.
std::unique_ptr< Pass > createForLoopRangeFoldingPass()
Creates a pass which folds arith ops on induction variable into loop range.
std::unique_ptr< Pass > createParallelForToNestedForsPass()
Creates a pass that converts SCF forall loops to SCF parallel loops.
std::unique_ptr< Pass > createForToWhileLoopPass()
std::unique_ptr< Pass > createTestSCFParallelLoopCollapsingPass()
Creates a pass that transforms a single ParallelLoop over N induction variables into another Parallel...
std::unique_ptr< Pass > createSCFForLoopCanonicalizationPass()
Creates a pass that canonicalizes affine.min and affine.max operations inside of scf....
std::unique_ptr< Pass > createParallelLoopFusionPass()
Creates a loop fusion pass which fuses parallel loops.