MLIR  16.0.0git
Functions
TosaToLinalg.cpp File Reference
#include "mlir/Conversion/TosaToLinalg/TosaToLinalg.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Tensor/Utils/Utils.h"
#include "mlir/Dialect/Tosa/IR/TosaOps.h"
#include "mlir/Dialect/Tosa/Utils/CoversionUtils.h"
#include "mlir/Dialect/Utils/ReshapeOpsUtils.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/DialectConversion.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include <numeric>
+ Include dependency graph for TosaToLinalg.cpp:

Go to the source code of this file.

Functions

template<typename T >
static arith::ConstantOp createConstFromIntAttribute (Operation *op, const std::string &attrName, Type requiredAttrType, OpBuilder &rewriter)
 
static Value createLinalgBodyCalculationForElementwiseOp (Operation *op, ValueRange args, ArrayRef< Type > resultTypes, PatternRewriter &rewriter)
 
static LogicalResult elementwiseMatchAndRewriteHelper (Operation *operation, PatternRewriter &rewriter)
 
static Attribute createInitialValueForReduceOp (Operation *op, Type elementTy, PatternRewriter &rewriter)
 
static Value createLinalgBodyCalculationForReduceOp (Operation *op, ValueRange args, Type elementTy, PatternRewriter &rewriter)
 
static LogicalResult reduceMatchAndRewriteHelper (Operation *op, uint64_t axis, PatternRewriter &rewriter)
 
static bool findIntermediateShape (ArrayRef< int64_t > lhsShape, ArrayRef< int64_t > rhsShape, SmallVector< int64_t > &intermediateShape, bool isDynamic)
 
static bool createReassociationMapsForCollapse (PatternRewriter &rewriter, ArrayRef< int64_t > srcShape, ArrayRef< int64_t > dstShape, SmallVector< ReassociationExprs, 4 > &reassociationMap, bool isDynamic)
 

Function Documentation

◆ createConstFromIntAttribute()

template<typename T >
static arith::ConstantOp createConstFromIntAttribute ( Operation op,
const std::string &  attrName,
Type  requiredAttrType,
OpBuilder rewriter 
)
static

◆ createInitialValueForReduceOp()

static Attribute createInitialValueForReduceOp ( Operation op,
Type  elementTy,
PatternRewriter rewriter 
)
static

◆ createLinalgBodyCalculationForElementwiseOp()

static Value createLinalgBodyCalculationForElementwiseOp ( Operation op,
ValueRange  args,
ArrayRef< Type resultTypes,
PatternRewriter rewriter 
)
static

◆ createLinalgBodyCalculationForReduceOp()

static Value createLinalgBodyCalculationForReduceOp ( Operation op,
ValueRange  args,
Type  elementTy,
PatternRewriter rewriter 
)
static

◆ createReassociationMapsForCollapse()

static bool createReassociationMapsForCollapse ( PatternRewriter rewriter,
ArrayRef< int64_t >  srcShape,
ArrayRef< int64_t >  dstShape,
SmallVector< ReassociationExprs, 4 > &  reassociationMap,
bool  isDynamic 
)
static

Definition at line 894 of file TosaToLinalg.cpp.

References mlir::Builder::getAffineDimExpr().

◆ elementwiseMatchAndRewriteHelper()

static LogicalResult elementwiseMatchAndRewriteHelper ( Operation operation,
PatternRewriter rewriter 
)
static

◆ findIntermediateShape()

static bool findIntermediateShape ( ArrayRef< int64_t >  lhsShape,
ArrayRef< int64_t >  rhsShape,
SmallVector< int64_t > &  intermediateShape,
bool  isDynamic 
)
static

Definition at line 841 of file TosaToLinalg.cpp.

◆ reduceMatchAndRewriteHelper()

static LogicalResult reduceMatchAndRewriteHelper ( Operation op,
uint64_t  axis,
PatternRewriter rewriter 
)
static