My Project
Passes.h
Go to the documentation of this file.
1 //===- Passes.h - Pass Entrypoints ------------------------------*- C++ -*-===//
2 //
3 // Part of the MLIR 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 in the loop
10 // transformation library.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MLIR_TRANSFORMS_PASSES_H
15 #define MLIR_TRANSFORMS_PASSES_H
16 
17 #include "mlir/Support/LLVM.h"
18 #include <functional>
19 #include <limits>
20 
21 namespace mlir {
22 
23 class AffineForOp;
24 class FuncOp;
25 class ModuleOp;
26 class Pass;
27 template <typename T> class OpPassBase;
28 
30 std::unique_ptr<Pass> createCanonicalizerPass();
31 
33 std::unique_ptr<Pass> createCSEPass();
34 
37 std::unique_ptr<OpPassBase<FuncOp>>
38 createVectorizePass(ArrayRef<int64_t> virtualVectorSize);
39 
42 std::unique_ptr<OpPassBase<FuncOp>> createVectorizerTestPass();
43 
45 std::unique_ptr<OpPassBase<FuncOp>>
46 createMaterializeVectorsPass(ArrayRef<int64_t> vectorSize);
47 
54 std::unique_ptr<OpPassBase<FuncOp>> createLoopUnrollPass(
55  int unrollFactor = -1, int unrollFull = -1,
56  const std::function<unsigned(AffineForOp)> &getUnrollFactor = nullptr);
57 
61 std::unique_ptr<OpPassBase<FuncOp>>
62 createLoopUnrollAndJamPass(int unrollJamFactor = -1);
63 
67 std::unique_ptr<OpPassBase<FuncOp>> createSimplifyAffineStructuresPass();
68 
72 std::unique_ptr<OpPassBase<FuncOp>>
73 createLoopFusionPass(unsigned fastMemorySpace = 0,
74  uint64_t localBufSizeThreshold = 0,
75  bool maximalFusion = false);
76 
79 std::unique_ptr<Pass> createLoopInvariantCodeMotionPass();
80 
83 std::unique_ptr<OpPassBase<FuncOp>> createAffineLoopInvariantCodeMotionPass();
84 
87 std::unique_ptr<OpPassBase<FuncOp>> createPipelineDataTransferPass();
88 
92 std::unique_ptr<OpPassBase<FuncOp>> createLowerAffinePass();
93 
95 std::unique_ptr<OpPassBase<FuncOp>>
96 createLoopTilingPass(uint64_t cacheSizeBytes);
97 
101 std::unique_ptr<OpPassBase<FuncOp>>
102 createSimpleParametricTilingPass(ArrayRef<int64_t> outerLoopSizes);
103 
106 std::unique_ptr<OpPassBase<FuncOp>> createLoopCoalescingPass();
107 
111 std::unique_ptr<OpPassBase<FuncOp>> createAffineDataCopyGenerationPass(
112  unsigned slowMemorySpace, unsigned fastMemorySpace,
113  unsigned tagMemorySpace = 0, int minDmaTransferSize = 1024,
114  uint64_t fastMemCapacityBytes = std::numeric_limits<uint64_t>::max());
115 
118 std::unique_ptr<OpPassBase<FuncOp>> createMemRefDataFlowOptPass();
119 
121 std::unique_ptr<OpPassBase<FuncOp>> createStripDebugInfoPass();
122 
124 std::unique_ptr<OpPassBase<FuncOp>> createTestLoopFusionPass();
125 
128 std::unique_ptr<Pass> createInlinerPass();
129 } // end namespace mlir
130 
131 #endif // MLIR_TRANSFORMS_PASSES_H
Definition: InferTypeOpInterface.cpp:20
std::unique_ptr< OpPassBase< FuncOp > > createLowerAffinePass()
Definition: AffineToStandard.cpp:544
std::unique_ptr< OpPassBase< FuncOp > > createTestLoopFusionPass()
Creates a pass which tests loop fusion utilities.
std::unique_ptr< OpPassBase< FuncOp > > createStripDebugInfoPass()
Creates a pass to strip debug information from a function.
Definition: StripDebugInfo.cpp:32
std::unique_ptr< OpPassBase< FuncOp > > createAffineDataCopyGenerationPass(unsigned slowMemorySpace, unsigned fastMemorySpace, unsigned tagMemorySpace=0, int minDmaTransferSize=1024, uint64_t fastMemCapacityBytes=std::numeric_limits< uint64_t >::max())
Definition: AffineDataCopyGeneration.cpp:133
std::unique_ptr< OpPassBase< FuncOp > > createVectorizerTestPass()
std::unique_ptr< OpPassBase< FuncOp > > createVectorizePass(ArrayRef< int64_t > virtualVectorSize)
Definition: Vectorize.cpp:1286
std::unique_ptr< Pass > createInlinerPass()
Definition: Inliner.cpp:292
std::unique_ptr< OpPassBase< FuncOp > > createLoopTilingPass(uint64_t cacheSizeBytes)
Creates a pass to perform tiling on loop nests.
Definition: LoopTiling.cpp:76
std::unique_ptr< Pass > createCSEPass()
Creates a pass to perform common sub expression elimination.
Definition: CSE.cpp:261
std::unique_ptr< OpPassBase< FuncOp > > createSimpleParametricTilingPass(ArrayRef< int64_t > outerLoopSizes)
std::unique_ptr< OpPassBase< FuncOp > > createSimplifyAffineStructuresPass()
Definition: SimplifyAffineStructures.cpp:80
std::unique_ptr< OpPassBase< FuncOp > > createPipelineDataTransferPass()
Definition: PipelineDataTransfer.cpp:43
std::unique_ptr< OpPassBase< FuncOp > > createMemRefDataFlowOptPass()
Definition: MemRefDataFlowOpt.cpp:82
std::unique_ptr< OpPassBase< FuncOp > > createMaterializeVectorsPass(ArrayRef< int64_t > vectorSize)
Creates a pass to lower super-vectors to target-dependent HW vectors.
std::unique_ptr< OpPassBase< FuncOp > > createLoopFusionPass(unsigned fastMemorySpace=0, uint64_t localBufSizeThreshold=0, bool maximalFusion=false)
Definition: LoopFusion.cpp:106
std::unique_ptr< OpPassBase< FuncOp > > createLoopCoalescingPass()
Definition: LoopCoalescing.cpp:90
std::unique_ptr< OpPassBase< FuncOp > > createLoopUnrollAndJamPass(int unrollJamFactor=-1)
Definition: LoopUnrollAndJam.cpp:77
std::unique_ptr< OpPassBase< FuncOp > > createLoopUnrollPass(int unrollFactor=-1, int unrollFull=-1, const std::function< unsigned(AffineForOp)> &getUnrollFactor=nullptr)
Definition: LoopUnroll.cpp:174
std::unique_ptr< OpPassBase< FuncOp > > createAffineLoopInvariantCodeMotionPass()
Definition: AffineLoopInvariantCodeMotion.cpp:233
std::unique_ptr< Pass > createCanonicalizerPass()
Creates an instance of the Canonicalizer pass.
Definition: Canonicalizer.cpp:40
std::unique_ptr< Pass > createLoopInvariantCodeMotionPass()
Definition: LoopInvariantCodeMotion.cpp:134