MLIR
21.0.0git
|
#include "mlir/Conversion/TosaToLinalg/TosaToLinalg.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/Index/IR/IndexOps.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/Tosa/IR/TosaOps.h"
#include "mlir/Dialect/Tosa/Utils/ConversionUtils.h"
#include "mlir/Dialect/Utils/ReshapeOpsUtils.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/DialectConversion.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
#include <numeric>
#include <type_traits>
Go to the source code of this file.
Typedefs | |
using | IndexPool = DenseMap< int64_t, Value > |
Definition at line 758 of file TosaToLinalg.cpp.
|
static |
Definition at line 864 of file TosaToLinalg.cpp.
References mlir::OpBuilder::create(), createIndex(), mlir::OpBuilder::createOrFold(), mlir::AffineMap::get(), mlir::Builder::getAffineConstantExpr(), mlir::Builder::getAffineDimExpr(), mlir::Builder::getContext(), mlir::Builder::getMultiDimIdentityMap(), mlir::tosa::getNParallelLoopsAttrs(), getOrFoldTensorDim(), mlir::Operation::getResult(), getTensorDim(), and mlir::Value::getType().
Referenced by broadcastDynamicDimensions().
|
static |
Definition at line 947 of file TosaToLinalg.cpp.
References broadcastDynamicDimension(), and mlir::Value::getType().
Referenced by broadcastDynamicDimensions(), and elementwiseMatchAndRewriteHelper().
|
static |
Definition at line 962 of file TosaToLinalg.cpp.
References broadcastDynamicDimensions().
|
static |
Definition at line 849 of file TosaToLinalg.cpp.
References computeTargetSize(), and mlir::ValueRange::getType().
Referenced by elementwiseMatchAndRewriteHelper().
|
static |
Definition at line 808 of file TosaToLinalg.cpp.
References mlir::OpBuilder::create(), mlir::Builder::getIndexAttr(), getTensorDim(), and mlir::Value::getType().
Referenced by computeTargetShape().
|
static |
Definition at line 87 of file TosaToLinalg.cpp.
References mlir::OpBuilder::create(), mlir::get(), and mlir::Operation::getLoc().
|
static |
Definition at line 763 of file TosaToLinalg.cpp.
References mlir::OpBuilder::create(), and mlir::Builder::getIndexAttr().
Referenced by broadcastDynamicDimension(), and getTensorDim().
|
static |
Definition at line 1074 of file TosaToLinalg.cpp.
References mlir::Builder::getFloatAttr(), mlir::Builder::getIntegerAttr(), mlir::Type::getIntOrFloatBitWidth(), getZero(), and mlir::Type::isInteger().
Referenced by reduceMatchAndRewriteHelper().
|
static |
Definition at line 94 of file TosaToLinalg.cpp.
References mlir::presburger::abs(), clamp(), mlir::tosa::clampFloatHelper(), mlir::tosa::clampIntHelper(), mlir::OpBuilder::create(), mlir::get(), mlir::Operation::getAttr(), mlir::Builder::getContext(), mlir::getElementTypeOrSelf(), mlir::Builder::getFloatAttr(), mlir::Builder::getI32Type(), mlir::Builder::getIntegerAttr(), mlir::Builder::getIntegerType(), mlir::Type::getIntOrFloatBitWidth(), mlir::Operation::getLoc(), mlir::Operation::getOperand(), mlir::Operation::getResult(), mlir::Builder::getStringAttr(), mlir::Value::getType(), mlir::DenseElementsAttr::getValues(), mlir::Builder::getZeroAttr(), mlir::Type::isInteger(), mlir::Type::isIntOrFloat(), mlir::Type::isUnsignedInteger(), mlir::m_Constant(), mlir::matchPattern(), materializeBinaryNanCheckIfRequired(), max(), min(), mlir::RewriterBase::notifyMatchFailure(), and mlir::presburger::round().
Referenced by emitElementwiseComputation().
|
static |
Definition at line 1126 of file TosaToLinalg.cpp.
References mlir::OpBuilder::create(), mlir::Operation::getLoc(), and mlir::Type::isInteger().
Referenced by reduceMatchAndRewriteHelper().
|
static |
Definition at line 1040 of file TosaToLinalg.cpp.
References broadcastDynamicDimensions(), computeTargetShape(), emitElementwiseComputation(), expandInputRanks(), mlir::ValueTypeRange< ValueRangeT >::front(), mlir::Operation::getLoc(), mlir::Operation::getNumOperands(), mlir::Operation::getNumResults(), mlir::Operation::getResultTypes(), mlir::RewriterBase::notifyMatchFailure(), and operandsAndResultsRanked().
|
static |
Definition at line 978 of file TosaToLinalg.cpp.
References mlir::TypeConverter::convertType(), mlir::OpBuilder::create(), createLinalgBodyCalculationForElementwiseOp(), mlir::OpBuilder::createOrFold(), mlir::detail::enumerate(), mlir::ValueTypeRange< ValueRangeT >::front(), mlir::AffineMap::get(), mlir::Builder::getAffineConstantExpr(), mlir::Builder::getAffineDimExpr(), mlir::Builder::getContext(), mlir::Builder::getMultiDimIdentityMap(), mlir::tosa::getNParallelLoopsAttrs(), mlir::Operation::getNumOperands(), mlir::Operation::getResultTypes(), mlir::Value::getType(), mlir::RewriterBase::notifyMatchFailure(), and mlir::ConversionPatternRewriter::replaceOp().
Referenced by elementwiseMatchAndRewriteHelper().
|
static |
Definition at line 750 of file TosaToLinalg.cpp.
References expandRank().
Referenced by elementwiseMatchAndRewriteHelper().
|
static |
Definition at line 714 of file TosaToLinalg.cpp.
References mlir::OpBuilder::create(), mlir::get(), and mlir::Value::getType().
Referenced by expandInputRanks().
|
static |
Definition at line 778 of file TosaToLinalg.cpp.
References mlir::Builder::getIndexAttr(), getTensorDim(), and mlir::Value::getType().
Referenced by broadcastDynamicDimension().
|
static |
Definition at line 772 of file TosaToLinalg.cpp.
References mlir::OpBuilder::create(), and createIndex().
Referenced by broadcastDynamicDimension(), computeTargetSize(), and getOrFoldTensorDim().
|
static |
Definition at line 64 of file TosaToLinalg.cpp.
References mlir::OpBuilder::create(), and mlir::getElementTypeOrSelf().
Referenced by createLinalgBodyCalculationForElementwiseOp().
|
static |
Definition at line 789 of file TosaToLinalg.cpp.
References mlir::Operation::getOperands(), and mlir::Operation::getResults().
Referenced by elementwiseMatchAndRewriteHelper().
|
static |
Definition at line 1176 of file TosaToLinalg.cpp.
References mlir::OpBuilder::create(), createInitialValueForReduceOp(), createLinalgBodyCalculationForReduceOp(), mlir::Builder::getAffineDimExpr(), mlir::Builder::getBoolAttr(), mlir::Builder::getFloatAttr(), mlir::RewriterBase::notifyMatchFailure(), and mlir::RewriterBase::replaceOpWithNewOp().