MLIR
17.0.0git
|
#include "mlir/Dialect/Linalg/IR/LinalgInterfaces.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/Complex/IR/Complex.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/IR/AffineExprVisitor.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/TypeUtilities.h"
#include "llvm/ADT/SmallBitVector.h"
#include "mlir/Dialect/Linalg/IR/LinalgInterfaces.cpp.inc"
Go to the source code of this file.
Classes | |
struct | HasAffineDimExprVisitor |
Visitor to check if any of the given set of positions from AffineDimExprs are used within an AffineExpr. More... | |
Namespaces | |
mlir | |
This header declares functions that assist transformations in the MemRef dialect. | |
mlir::linalg | |
mlir::linalg::detail | |
Functions | |
static bool | isChainOfUnaryOpsFrom (Value v, Value from) |
Return true if the use-def chain from v to from consists of 0 or more unary single-operand operations. More... | |
template<typename OpType > | |
static OpType | getSingleOpOfType (Block &block) |
Return the unique instance of OpType in block if it is indeed unique. More... | |
template<typename AddOpType , typename MulOpType > | |
static bool | isAddMul (Block &block) |
Detect whether res is any permutation of u5(u1(c) + u2(u3(a) * u4(b))) on the field (AddOpType, MulOpType), where u1, u2, u3, u4 and u5 represent unary operations that may change the type. More... | |
static MatchContractionResult | isContractionInterfaceImpl (Operation *op) |
template<typename T > | |
static T | getAffineExprOfType (AffineExpr lhs, AffineExpr rhs) |
Of the given two expressions returns one that is of type T (lhs gets preference over rhs ) More... | |
static llvm::SmallDenseSet< unsigned > | getPreservedDims (AffineMap map) |
static MatchFillResult | isFillInterfaceImpl (Operation *op) |
static Value | createOrFoldDimOp (OpBuilder &b, Location loc, Value source, int64_t dim) |
Helper function that creates a memref::DimOp or tensor::DimOp depending on the type of source . More... | |
static OpFoldResult | createFoldedDimOp (OpBuilder &b, Location loc, Value source, int64_t dim) |
static std::pair< int64_t, int64_t > | getResultsPositionInLoopsToShapeMap (LinalgOp &op) |
|
strong |
Enumerator | |
---|---|
Success | |
NotLinalgOp | |
WrongNumOperands | |
NoReduction | |
NotProjectedPermutations | |
NotAddMul |
Definition at line 115 of file LinalgInterfaces.cpp.
|
strong |
Enumerator | |
---|---|
Success | |
NotLinalgOp | |
WrongNumOperands | |
NotScalarInput |
Definition at line 468 of file LinalgInterfaces.cpp.
|
static |
Definition at line 515 of file LinalgInterfaces.cpp.
References mlir::linalg::createOrFoldDimOp(), mlir::Builder::getIndexAttr(), and mlir::Value::getType().
Referenced by mlir::linalg::computeSliceParameters().
Helper function that creates a memref::DimOp or tensor::DimOp depending on the type of source
.
Definition at line 507 of file LinalgInterfaces.cpp.
References mlir::OpBuilder::createOrFold(), and mlir::Value::getType().
|
static |
Of the given two expressions returns one that is of type T (lhs
gets preference over rhs
)
Definition at line 188 of file LinalgInterfaces.cpp.
References mlir::AffineExpr::cast(), and mlir::AffineExpr::isa().
|
static |
Definition at line 262 of file LinalgInterfaces.cpp.
References mlir::AffineExpr::cast(), mlir::AffineDimExpr::getPosition(), mlir::AffineMap::getResults(), and mlir::AffineMap::isProjectedPermutation().
|
static |
Definition at line 595 of file LinalgInterfaces.cpp.
|
static |
Return the unique instance of OpType in block
if it is indeed unique.
Return null if none or more than 1 instances exist.
Definition at line 69 of file LinalgInterfaces.cpp.
References mlir::Block::walk().
|
static |
Detect whether res is any permutation of u5(u1(c) + u2(u3(a) * u4(b)))
on the field (AddOpType, MulOpType), where u1, u2, u3, u4 and u5 represent unary operations that may change the type.
Definition at line 86 of file LinalgInterfaces.cpp.
References mlir::Block::getArgument(), mlir::Block::getNumArguments(), mlir::Operation::getNumOperands(), mlir::Operation::getOperand(), mlir::Block::getTerminator(), isChainOfUnaryOpsFrom(), and mlir::success().
Return true if the use-def chain from v
to from
consists of 0 or more unary single-operand operations.
Definition at line 55 of file LinalgInterfaces.cpp.
Referenced by isAddMul().
|
static |
Definition at line 123 of file LinalgInterfaces.cpp.
|
static |
Definition at line 475 of file LinalgInterfaces.cpp.