MLIR 24.0.0git
TosaToLinalg.h File Reference
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Tosa/Transforms/Passes.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
#include "llvm/ADT/DenseMap.h"
#include <optional>
#include <utility>
#include "mlir/Conversion/Passes.h.inc"

Go to the source code of this file.

Classes

struct  mlir::TosaToLinalgOptions
struct  mlir::TosaToLinalgNamedOptions

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::tosa

Macros

#define GEN_PASS_DECL_TOSATOLINALG
#define GEN_PASS_DECL_TOSATOLINALGNAMED

Typedefs

using mlir::tosa::IndexPool = llvm::DenseMap<int64_t, Value>
 Caches the arith.constant index values created for a set of dimension indices so that broadcasting helpers can avoid emitting redundant constants.

Functions

std::unique_ptr< Pass > mlir::tosa::createTosaToLinalg (const TosaToLinalgOptions &options=TosaToLinalgOptions())
std::unique_ptr< Pass > mlir::tosa::createTosaToLinalgNamed (const TosaToLinalgNamedOptions &options=TosaToLinalgNamedOptions())
void mlir::tosa::addTosaToLinalgPasses (OpPassManager &pm, const TosaToLinalgOptions &options, const TosaToLinalgNamedOptions &tosaToLinalgNamedOptions=TosaToLinalgNamedOptions(), std::optional< tosa::TosaValidationOptions > validationOptions=tosa::TosaValidationOptions{false, false}, std::optional< TosaAttachTargetOptions > attachTargetOptions=std::nullopt)
 Populates passes to convert from TOSA to Linalg.
void mlir::tosa::registerTosaToLinalgPipelines ()
 Populates TOSA to linalg pipelines Currently, this includes only the "tosa-to-linalg-pipeline".
void mlir::tosa::populateTosaToLinalgConversionPatterns (const TypeConverter &converter, RewritePatternSet *patterns, const TosaToLinalgOptions &options=TosaToLinalgOptions())
 Populates conversion passes from TOSA dialect to Linalg dialect.
void mlir::tosa::populateTosaToLinalgNamedConversionPatterns (const TypeConverter &converter, RewritePatternSet *patterns, const TosaToLinalgNamedOptions &options)
 Populates conversion passes from TOSA dialect to Linalg named operations.
std::optional< linalg::ElementwiseKind > mlir::tosa::isConvertibleToLinalgElementwise (Operation *op)
 Returns the linalg.elementwise kind that the TosaToLinalgNamed conversion lowers op to, or std::nullopt if op has no such counterpart.
std::pair< OpFoldResult, Value > mlir::tosa::computeTargetSize (PatternRewriter &rewriter, Location loc, IndexPool &indexPool, ValueRange operands, int64_t dim)
 Compute the broadcasted runtime size of dimension dim of an elementwise operation whose operands all share the same rank (TOSA's SameOperandsAndResultRank and ResultsBroadcastableShape traits).

Macro Definition Documentation

◆ GEN_PASS_DECL_TOSATOLINALG

#define GEN_PASS_DECL_TOSATOLINALG

Definition at line 26 of file TosaToLinalg.h.

◆ GEN_PASS_DECL_TOSATOLINALGNAMED

#define GEN_PASS_DECL_TOSATOLINALGNAMED

Definition at line 27 of file TosaToLinalg.h.