|
MLIR 22.0.0git
|
#include "mlir/Dialect/Arith/IR/Arith.h"#include "mlir/Dialect/MemRef/IR/MemRef.h"#include "mlir/Dialect/Utils/IndexingUtils.h"#include "mlir/Dialect/Utils/StructuredOpsUtils.h"#include "mlir/Dialect/Vector/IR/VectorOps.h"#include "mlir/Dialect/Vector/Transforms/LoweringPatterns.h"#include "mlir/Dialect/Vector/Utils/VectorUtils.h"#include "mlir/IR/BuiltinTypes.h"#include "mlir/IR/Location.h"#include "mlir/IR/PatternMatch.h"#include "mlir/IR/TypeUtilities.h"Go to the source code of this file.
Classes | |
| struct | ContractOpToElementwise |
| Lower vector.contract with all size one reduction dimensions to elementwise ops when possible. More... | |
| class | OuterProductOpLowering |
| Progressive lowering of OuterProductOp. More... | |
Macros | |
| #define | DEBUG_TYPE "vector-contract-lowering" |
Functions | |
| static std::optional< int64_t > | getResultIndex (AffineMap map, int64_t index) |
| static SmallVector< Attribute > | adjustIter (ArrayAttr iteratorTypes, int64_t index) |
| static AffineMap | adjustMap (AffineMap map, int64_t index, PatternRewriter &rewriter) |
| static Value | reshapeLoad (Location loc, Value val, VectorType type, int64_t index, int64_t pos, PatternRewriter &rewriter) |
| static Value | reshapeStore (Location loc, Value val, Value result, VectorType type, int64_t index, int64_t pos, PatternRewriter &rewriter) |
| static std::optional< Value > | createContractArithOp (Location loc, Value x, Value y, Value acc, vector::CombiningKind kind, PatternRewriter &rewriter, bool isInt, Value mask=Value()) |
| Helper to create arithmetic operation associated with a kind of contraction. | |
| static SmallVector< int64_t > | getReductionIndex (AffineMap map, ArrayAttr iteratorTypes) |
| Return the positions of the reductions in the given map. | |
| static std::optional< unsigned > | getDimPosition (AffineMap map, unsigned dim) |
| Look for a given dimension in an affine map and return its position. | |
| static Value | createAdd (Location loc, Value x, Value y, bool isInt, PatternRewriter &rewriter) |
| Creates an AddIOp if isInt is true otherwise create an arith::AddFOp using operands x and y. | |
| #define DEBUG_TYPE "vector-contract-lowering" |
Definition at line 26 of file LowerVectorContract.cpp.
|
static |
Definition at line 45 of file LowerVectorContract.cpp.
References ArrayAttr().
|
static |
Definition at line 58 of file LowerVectorContract.cpp.
References mlir::AffineMap::get(), mlir::getAffineDimExpr(), mlir::Builder::getContext(), mlir::AffineMap::getDimPosition(), mlir::AffineMap::getNumDims(), and mlir::AffineMap::getNumResults().
Creates an AddIOp if isInt is true otherwise create an arith::AddFOp using operands x and y.
Definition at line 186 of file LowerVectorContract.cpp.
|
static |
Helper to create arithmetic operation associated with a kind of contraction.
Definition at line 124 of file LowerVectorContract.cpp.
References mlir::vector::makeArithReduction(), mul, and mlir::vector::selectPassthru().
Referenced by OuterProductOpLowering::matchAndRewrite(), and ContractOpToElementwise::matchAndRewriteMaskableOp().
Look for a given dimension in an affine map and return its position.
Return std::nullopt if the dimension is not in the map results.
Definition at line 176 of file LowerVectorContract.cpp.
References mlir::AffineMap::getDimPosition(), and mlir::AffineMap::getNumResults().
Referenced by ContractOpToElementwise::matchAndRewriteMaskableOp().
|
static |
Return the positions of the reductions in the given map.
Definition at line 164 of file LowerVectorContract.cpp.
References ArrayAttr(), mlir::AffineMap::getDimPosition(), mlir::AffineMap::getNumResults(), and mlir::vector::isReductionIterator().
Referenced by ContractOpToElementwise::matchAndRewriteMaskableOp().
Definition at line 35 of file LowerVectorContract.cpp.
References mlir::AffineMap::getDimPosition(), and mlir::AffineMap::getNumResults().
|
static |
Definition at line 76 of file LowerVectorContract.cpp.
References mlir::VectorType::Builder::dropDim(), mlir::Builder::getZeroAttr(), load, reshapeLoad(), and result.
Referenced by reshapeLoad().
|
static |
Definition at line 101 of file LowerVectorContract.cpp.
References mlir::VectorType::Builder::dropDim(), reshapeStore(), and result.
Referenced by reshapeStore().