MLIR  17.0.0git
Passes.h
Go to the documentation of this file.
1 //===-- Passes.h - TOSA optimization pass declarations ----------*- 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 file declares the optimization passes for the TOSA Dialect in MLIR.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_DIALECT_TOSA_TRANSFORMS_PASSES_H
14 #define MLIR_DIALECT_TOSA_TRANSFORMS_PASSES_H
15 
17 #include "mlir/Dialect/Tosa/Transforms/PassesEnums.h.inc"
18 #include "mlir/Pass/Pass.h"
19 
20 namespace mlir {
21 namespace tosa {
22 
23 #define GEN_PASS_DECL
24 #include "mlir/Dialect/Tosa/Transforms/Passes.h.inc"
25 
26 // Expose Rewrite Functions that decompose TOSA Ops into further TOSA Ops.
27 // The rewrites can be selectively added to a conversion pass.
28 void populateTosaDecomposeConv2D(MLIRContext *ctx, RewritePatternSet &patterns);
29 void populateTosaDecomposeTransposeConv(MLIRContext *ctx,
30  RewritePatternSet &patterns);
31 void populateTosaDecomposeDepthwise(MLIRContext *ctx,
32  RewritePatternSet &patterns);
33 void populateTosaFoldConstantTransposePatterns(MLIRContext *ctx,
34  RewritePatternSet &patterns);
35 
36 std::unique_ptr<Pass> createTosaLayerwiseConstantFoldPass();
37 std::unique_ptr<Pass> createTosaInferShapesPass();
38 std::unique_ptr<Pass> createTosaMakeBroadcastablePass();
39 std::unique_ptr<Pass> createTosaTestQuantUtilAPIPass();
40 std::unique_ptr<Pass> createTosaOptionalDecompositions();
41 std::unique_ptr<Pass> createTosaValidationPass();
42 
43 #define GEN_PASS_REGISTRATION
44 #include "mlir/Dialect/Tosa/Transforms/Passes.h.inc"
45 
46 } // namespace tosa
47 } // namespace mlir
48 
49 #endif // MLIR_DIALECT_TOSA_TRANSFORMS_PASSES_H
std::unique_ptr< Pass > createTosaMakeBroadcastablePass()
void populateTosaDecomposeDepthwise(MLIRContext *ctx, RewritePatternSet &patterns)
void populateTosaDecomposeConv2D(MLIRContext *ctx, RewritePatternSet &patterns)
std::unique_ptr< Pass > createTosaTestQuantUtilAPIPass()
std::unique_ptr< Pass > createTosaOptionalDecompositions()
std::unique_ptr< Pass > createTosaValidationPass()
void populateTosaDecomposeTransposeConv(MLIRContext *ctx, RewritePatternSet &patterns)
std::unique_ptr< Pass > createTosaLayerwiseConstantFoldPass()
std::unique_ptr< Pass > createTosaInferShapesPass()
void populateTosaFoldConstantTransposePatterns(MLIRContext *ctx, RewritePatternSet &patterns)
Include the generated interface declarations.