MLIR 23.0.0git
TosaToLinalg.h
Go to the documentation of this file.
1//===- TosaToLinalg.h - TOSA optimization pass declarations ---------------===//
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 passes for the TOSA Linalg Dialect in MLIR.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_CONVERSION_TOSATOLINALG_TOSATOLINALG_H
14#define MLIR_CONVERSION_TOSATOLINALG_TOSATOLINALG_H
15
17#include "mlir/Pass/Pass.h"
18
19namespace mlir {
20
21#define GEN_PASS_DECL_TOSATOLINALG
22#define GEN_PASS_DECL_TOSATOLINALGNAMED
23#include "mlir/Conversion/Passes.h.inc"
24
25namespace tosa {
26
27std::unique_ptr<Pass> createTosaToLinalg();
28std::unique_ptr<Pass> createTosaToLinalgNamed(
29 const TosaToLinalgNamedOptions &options = TosaToLinalgNamedOptions());
30
31/// Populates passes to convert from TOSA to Linalg. At the end of
32/// the pass, the function will only contain linalg ops or standard ops if the
33/// pipeline succeeds. The option to disable decompositions is available for
34/// benchmarking performance improvements from the canonicalizations.
36 OpPassManager &pm, const TosaToLinalgOptions &options,
37 const TosaToLinalgNamedOptions &tosaToLinalgNamedOptions =
38 TosaToLinalgNamedOptions(),
39 // Note: Default to 'none' level unless otherwise specified.
40 std::optional<tosa::TosaValidationOptions> validationOptions =
41 tosa::TosaValidationOptions{false, false});
42
43/// Populates TOSA to linalg pipelines
44/// Currently, this includes only the "tosa-to-linalg-pipeline".
46
47/// Populates conversion passes from TOSA dialect to Linalg dialect.
49 RewritePatternSet *patterns);
50
51/// Populates conversion passes from TOSA dialect to Linalg named operations.
53 const TypeConverter &converter, RewritePatternSet *patterns,
54 const TosaToLinalgNamedOptions &options);
55
56} // namespace tosa
57} // namespace mlir
58
59#endif // MLIR_CONVERSION_TOSATOLINALG_TOSATOLINALG_H
static llvm::ManagedStatic< PassManagerOptions > options
void populateTosaToLinalgConversionPatterns(const TypeConverter &converter, RewritePatternSet *patterns)
Populates conversion passes from TOSA dialect to Linalg dialect.
std::unique_ptr< Pass > createTosaToLinalgNamed(const TosaToLinalgNamedOptions &options=TosaToLinalgNamedOptions())
void addTosaToLinalgPasses(OpPassManager &pm, const TosaToLinalgOptions &options, const TosaToLinalgNamedOptions &tosaToLinalgNamedOptions=TosaToLinalgNamedOptions(), std::optional< tosa::TosaValidationOptions > validationOptions=tosa::TosaValidationOptions{false, false})
Populates passes to convert from TOSA to Linalg.
std::unique_ptr< Pass > createTosaToLinalg()
void registerTosaToLinalgPipelines()
Populates TOSA to linalg pipelines Currently, this includes only the "tosa-to-linalg-pipeline".
void populateTosaToLinalgNamedConversionPatterns(const TypeConverter &converter, RewritePatternSet *patterns, const TosaToLinalgNamedOptions &options)
Populates conversion passes from TOSA dialect to Linalg named operations.
Include the generated interface declarations.
const FrozenRewritePatternSet & patterns