MLIR 22.0.0git
TosaToLinalg.h
Go to the documentation of this file.
1//===-- TosaToLinalg.h - TOSA optimization pass declarations ----------*- C++
2//-*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the passes for the TOSA Linalg Dialect in MLIR.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MLIR_CONVERSION_TOSATOLINALG_TOSATOLINALG_H
15#define MLIR_CONVERSION_TOSATOLINALG_TOSATOLINALG_H
16
18#include "mlir/Pass/Pass.h"
19
20namespace mlir {
21
22#define GEN_PASS_DECL_TOSATOLINALG
23#define GEN_PASS_DECL_TOSATOLINALGNAMED
24#include "mlir/Conversion/Passes.h.inc"
25
26namespace tosa {
27
28std::unique_ptr<Pass> createTosaToLinalg();
29std::unique_ptr<Pass> createTosaToLinalgNamed(
30 const TosaToLinalgNamedOptions &options = TosaToLinalgNamedOptions());
31
32/// Populates passes to convert from TOSA to Linalg on buffers. At the end of
33/// the pass, the function will only contain linalg ops or standard ops if the
34/// pipeline succeeds. The option to disable decompositions is available for
35/// benchmarking performance improvements from the canonicalizations.
37 OpPassManager &pm, const TosaToLinalgOptions &options,
38 const TosaToLinalgNamedOptions &tosaToLinalgNamedOptions =
39 TosaToLinalgNamedOptions(),
40 // Note: Default to 'none' level unless otherwise specified.
41 std::optional<tosa::TosaValidationOptions> validationOptions =
42 tosa::TosaValidationOptions{false, false});
43
44/// Populates TOSA to linalg pipelines
45/// Currently, this includes only the "tosa-to-linalg-pipeline".
47
48/// Populates conversion passes from TOSA dialect to Linalg dialect.
50 RewritePatternSet *patterns);
51
52/// Populates conversion passes from TOSA dialect to Linalg named operations.
54 const TypeConverter &converter, RewritePatternSet *patterns,
55 const TosaToLinalgNamedOptions &options);
56
57} // namespace tosa
58} // namespace mlir
59
60#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 on buffers.
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