MLIR
15.0.0git
|
#include "mlir/Dialect/Vector/Transforms/VectorTransforms.h"
#include <type_traits>
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
#include "mlir/Dialect/Arithmetic/Utils/Utils.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include "mlir/Dialect/Vector/Utils/VectorUtils.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Interfaces/VectorInterfaces.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
Go to the source code of this file.
Classes | |
struct | TransferReadToVectorLoadLowering |
Progressive lowering of transfer_read. More... | |
struct | VectorLoadToMemrefLoadLowering |
Replace a 0-d vector.load with a memref.load + vector.broadcast. More... | |
struct | VectorStoreToMemrefStoreLowering |
Replace a 0-d vector.store with a vector.extractelement + memref.store. More... | |
struct | TransferWriteToVectorStoreLowering |
Progressive lowering of transfer_write. More... | |
struct | BubbleDownVectorBitCastForExtract |
struct | BubbleDownBitCastForStridedSliceExtract |
struct | BubbleUpBitCastForStridedSliceInsert |
struct | MaterializeTransferMask< ConcreteOp > |
class | VectorCreateMaskOpConversion |
Conversion pattern for a vector.create_mask (0-D and 1-D only). More... | |
class | DropInnerMostUnitDims |
Namespaces | |
mlir | |
TODO: Remove this file when SCCP and integer range analysis have been ported to the new framework. | |
Macros | |
#define | DEBUG_TYPE "vector-to-vector" |
Functions | |
static Optional< int64_t > | getResultIndex (AffineMap map, int64_t index) |
static SmallVector< Attribute, 4 > | 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) |
template<typename IntType > | |
static SmallVector< IntType, 4 > | extractVector (ArrayAttr arrayAttr) |
static Optional< Value > | createContractArithOp (Location loc, Value x, Value y, Value acc, vector::CombiningKind kind, PatternRewriter &rewriter, bool isInt) |
Helper to create arithmetic operation associated with a kind of contraction. More... | |
static SmallVector< int64_t > | getReductionIndex (AffineMap map, ArrayAttr iteratorTypes) |
Return the positions of the reductions in the given map. More... | |
static llvm::Optional< unsigned > | getDimPosition (AffineMap map, unsigned dim) |
Look for a given dimension in an affine map and return its position. More... | |
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 . More... | |
static Value | createMul (Location loc, Value x, Value y, bool isInt, PatternRewriter &rewriter) |
Creates a MulIOp if isInt is true otherwise create an MulFOp using operands x and y`. More... | |
static SmallVector< int64_t, 4 > | getIntValueVector (ArrayAttr arrayAttr) |
static Value | buildVectorComparison (PatternRewriter &rewriter, Operation *op, bool force32BitVectorIndices, int64_t dim, Value b, Value *off=nullptr) |
#define DEBUG_TYPE "vector-to-vector" |
Definition at line 39 of file VectorTransforms.cpp.
|
static |
Definition at line 55 of file VectorTransforms.cpp.
References mlir::detail::enumerate().
|
static |
Definition at line 68 of file VectorTransforms.cpp.
References mlir::AffineMap::get(), mlir::getAffineDimExpr(), mlir::Builder::getContext(), mlir::AffineMap::getDimPosition(), mlir::AffineMap::getNumDims(), and mlir::AffineMap::getNumResults().
|
static |
Definition at line 2427 of file VectorTransforms.cpp.
References mlir::OpBuilder::create(), mlir::DenseIntElementsAttr::get(), mlir::Builder::getI32Type(), mlir::Builder::getI32VectorAttr(), mlir::Builder::getI64Type(), mlir::Builder::getI64VectorAttr(), mlir::Operation::getLoc(), mlir::Value::getType(), and mlir::getValueOrCreateCastToIndexLike().
Referenced by VectorCreateMaskOpConversion::matchAndRewrite().
|
static |
Creates an AddIOp if isInt
is true otherwise create an arith::AddFOp using operands x
and y
.
Definition at line 1310 of file VectorTransforms.cpp.
References mlir::OpBuilder::create().
|
static |
Helper to create arithmetic operation associated with a kind of contraction.
Definition at line 148 of file VectorTransforms.cpp.
|
static |
Creates a MulIOp if isInt
is true otherwise create an MulFOp using operands x and
y`.
Definition at line 1319 of file VectorTransforms.cpp.
References mlir::OpBuilder::create().
|
static |
Definition at line 141 of file VectorTransforms.cpp.
|
static |
Look for a given dimension in an affine map and return its position.
Return llvm::None if the dimension is not in the map results.
Definition at line 192 of file VectorTransforms.cpp.
References mlir::applyPermutationToVector(), mlir::computeStrides(), mlir::OpBuilder::create(), mlir::delinearize(), mlir::failure(), mlir::vector::Flat, mlir::AffineMap::getDimPosition(), mlir::Builder::getI32IntegerAttr(), getNumElements(), mlir::AffineMap::getNumResults(), mlir::Builder::getZeroAttr(), mlir::vector::None, mlir::RewriterBase::notifyMatchFailure(), mlir::RewriterBase::replaceOp(), mlir::RewriterBase::replaceOpWithNewOp(), mlir::vector::Shuffle, mlir::success(), and mlir::vector::VectorTransformsOptions::vectorTransposeLowering.
Referenced by mlir::AffineMap::getPermutedPosition(), and mlir::AffineMap::operator!=().
|
static |
Definition at line 2181 of file VectorTransforms.cpp.
Referenced by BubbleDownBitCastForStridedSliceExtract::matchAndRewrite(), and BubbleUpBitCastForStridedSliceInsert::matchAndRewrite().
|
static |
Return the positions of the reductions in the given map.
Definition at line 180 of file VectorTransforms.cpp.
References mlir::AffineMap::getDimPosition(), mlir::AffineMap::getNumResults(), and mlir::isReductionIterator().
|
static |
Definition at line 45 of file VectorTransforms.cpp.
References mlir::AffineMap::getDimPosition(), and mlir::AffineMap::getNumResults().
|
static |
Definition at line 86 of file VectorTransforms.cpp.
References mlir::Type::cast(), mlir::OpBuilder::create(), mlir::VectorType::Builder::dropDim(), mlir::Builder::getI64ArrayAttr(), and mlir::Builder::getZeroAttr().
|
static |
Definition at line 115 of file VectorTransforms.cpp.
References mlir::OpBuilder::create(), mlir::VectorType::Builder::dropDim(), and mlir::Builder::getI64ArrayAttr().
StringRef strRef |
Definition at line 1442 of file VectorTransforms.cpp.
Referenced by mlir::StructuredGenerator< StructuredOpInterface >::IteratorType::isOfType(), and twineToStrRef().