|
MLIR 23.0.0git
|
#include "mlir/Dialect/Quant/IR/Quant.h"#include "mlir/Dialect/Tensor/IR/Tensor.h"#include "mlir/Dialect/Tosa/IR/TargetEnv.h"#include "mlir/Dialect/Tosa/IR/TosaOps.h"#include "mlir/Dialect/Tosa/Utils/ConversionUtils.h"#include "mlir/Dialect/Tosa/Utils/QuantUtils.h"#include "mlir/Dialect/Traits.h"#include "mlir/IR/BuiltinTypeInterfaces.h"#include "mlir/IR/BuiltinTypes.h"#include "mlir/IR/IRMapping.h"#include "mlir/IR/Matchers.h"#include "mlir/IR/PatternMatch.h"#include "mlir/IR/TypeUtilities.h"#include "mlir/Transforms/FoldUtils.h"#include "mlir/Transforms/InliningUtils.h"#include "llvm/ADT/APFloat.h"#include "llvm/ADT/APInt.h"#include <functional>Go to the source code of this file.
Macros | |
| #define | REDUCE_FOLDER(OP) |
Functions | |
| static bool | checkMatchingPadConstAndZp (Value padConst, Value zp) |
| template<typename Folder> | |
| static DenseElementsAttr | binaryFolder (DenseElementsAttr lhs, DenseElementsAttr rhs, ShapedType returnTy, bool foldDenseValues=false) |
| template<typename Folder> | |
| static DenseElementsAttr | unaryFolder (DenseElementsAttr val, ShapedType returnTy, bool foldDenseValues=false) |
| static FailureOr< int64_t > | getSingleI64From1ElementTensor (Value v) |
| static bool | signsDiffer (const APInt &a, const APInt &b) |
| static bool | isSplatZero (Type elemType, DenseElementsAttr val) |
| static bool | isSplatOne (Type elemType, DenseElementsAttr val, int64_t shift) |
| static LogicalResult | verifyTileIsBroadcast (tosa::TileOp tileOp) |
| template<typename Op, typename OpFoldAdaptor> | |
| OpFoldResult | unaryShapeFold (Op *op) |
| template<typename Op, typename OpFoldAdaptor> | |
| OpFoldResult | binaryFold (Op *op) |
| OpFoldResult | concatShapeFold (tosa::ConcatShapeOp *op) |
| OpFoldResult | sliceShapeFold (tosa::SliceShapeOp *op) |
| #define REDUCE_FOLDER | ( | OP | ) |
Definition at line 2072 of file TosaCanonicalizations.cpp.
| OpFoldResult binaryFold | ( | Op * | op | ) |
Definition at line 2521 of file TosaCanonicalizations.cpp.
References binaryFolder().
|
static |
Definition at line 1359 of file TosaCanonicalizations.cpp.
References mlir::DenseElementsAttr::get(), mlir::DenseElementsAttr::getElementType(), lhs, and rhs.
Referenced by binaryFold().
Definition at line 52 of file TosaCanonicalizations.cpp.
References mlir::DenseIntElementsAttr::begin(), mlir::m_Constant(), mlir::matchPattern(), and mlir::DenseElementsAttr::size().
| OpFoldResult concatShapeFold | ( | tosa::ConcatShapeOp * | op | ) |
Definition at line 2552 of file TosaCanonicalizations.cpp.
References mlir::DenseElementsAttr::get().
Definition at line 1448 of file TosaCanonicalizations.cpp.
References mlir::m_Constant(), and mlir::matchPattern().
Referenced by sliceShapeFold().
|
static |
Definition at line 1705 of file TosaCanonicalizations.cpp.
References mlir::DenseElementsAttr::getSplatValue(), and mlir::DenseElementsAttr::isSplat().
|
static |
Definition at line 1697 of file TosaCanonicalizations.cpp.
References mlir::DenseElementsAttr::getSplatValue(), and mlir::DenseElementsAttr::isSplat().
|
static |
Definition at line 1520 of file TosaCanonicalizations.cpp.
References b.
Referenced by DivFoldAdaptor< Ceil >::fold().
| OpFoldResult sliceShapeFold | ( | tosa::SliceShapeOp * | op | ) |
Definition at line 2582 of file TosaCanonicalizations.cpp.
References mlir::DenseElementsAttr::get(), and getSingleI64From1ElementTensor().
|
static |
Definition at line 1410 of file TosaCanonicalizations.cpp.
References mlir::DenseElementsAttr::get(), mlir::DenseElementsAttr::getElementType(), mlir::DenseElementsAttr::getSplatValue(), mlir::DenseElementsAttr::getType(), mlir::DenseElementsAttr::getValues(), mlir::Type::isIntOrIndex(), and mlir::DenseElementsAttr::isSplat().
Referenced by unaryShapeFold().
| OpFoldResult unaryShapeFold | ( | Op * | op | ) |
Definition at line 2508 of file TosaCanonicalizations.cpp.
References unaryFolder().
|
static |
Definition at line 2331 of file TosaCanonicalizations.cpp.
References success().
Referenced by RemoveBroadcastTileFromBinaryElementwise::matchAndRewrite().