MLIR 22.0.0git
VectorUtils.h File Reference
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/UB/IR/UBOps.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/TypeSwitch.h"

Go to the source code of this file.

Classes

struct  mlir::vector::MaskableOpRewritePattern< SourceOp >
 A pattern for ops that implement MaskableOpInterface and that might be masked (i.e. More...

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::affine
namespace  mlir::vector

Typedefs

using mlir::vector::UnrollVectorOpFn
 Generic utility for unrolling n-D vector operations to (n-1)-D operations.

Functions

Value mlir::vector::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.
FailureOr< std::pair< int, int > > mlir::vector::isTranspose2DSlice (vector::TransposeOp op)
 Returns two dims that are greater than one if the transposition is applied on a 2D slice.
bool mlir::vector::isContiguousSlice (MemRefType memrefType, VectorType vectorType)
 Return true if vectorType is a contiguous slice of memrefType, in the sense that it can be read/written from/to a contiguous area of the memref.
std::optional< StaticTileOffsetRangemlir::vector::createUnrollIterator (VectorType vType, int64_t targetRank=1)
 Returns an iterator for all positions in the leading dimensions of vType up to the targetRank.
auto mlir::vector::makeVscaleConstantBuilder (PatternRewriter &rewriter, Location loc)
 Returns a functor (int64_t -> Value) which returns a constant vscale multiple.
auto mlir::vector::getDims (VectorType vType)
 Returns a range over the dims (size and scalability) of a VectorType.
SmallVector< OpFoldResultmlir::vector::getMixedSizesXfer (bool hasTensorSemantics, Operation *xfer, RewriterBase &rewriter)
 A wrapper for getMixedSizes for vector.transfer_read and vector.transfer_write Ops (for source and destination, respectively).
bool mlir::vector::isLinearizableVector (VectorType type)
 Returns true if the input Vector type can be linearized.
Value mlir::vector::createReadOrMaskedRead (OpBuilder &builder, Location loc, Value source, ArrayRef< int64_t > inputVectorSizes, std::optional< Value > padValue=std::nullopt, bool useInBoundsInsteadOfMasking=false, ArrayRef< bool > inputScalableVecDims={})
 Creates a TransferReadOp from source.
LogicalResult mlir::vector::isValidMaskedInputVector (ArrayRef< int64_t > shape, ArrayRef< int64_t > inputVectorSizes)
 Returns success if inputVectorSizes is a valid masking configuraion for given shape, i.e., it meets:
LogicalResult mlir::vector::unrollVectorOp (Operation *op, PatternRewriter &rewriter, UnrollVectorOpFn unrollFn)
FailureOr< SmallVector< Value > > mlir::vector::unrollVectorValue (TypedValue< VectorType >, RewriterBase &)
 Generic utility for unrolling values of type vector<NxAxBx...> to N values of type vector<AxBx...> using vector.extract.