9 #ifndef MLIR_DIALECT_VECTOR_UTILS_VECTORUTILS_H_ 10 #define MLIR_DIALECT_VECTOR_UTILS_VECTORUTILS_H_ 16 #include "llvm/ADT/DenseMap.h" 31 class VectorTransferOpInterface;
51 ArrayRef<int64_t> sizes);
55 SmallVector<int64_t, 4>
57 ArrayRef<int64_t> vectorOffsets);
71 Optional<SmallVector<int64_t, 4>>
shapeRatio(ArrayRef<int64_t> superShape,
72 ArrayRef<int64_t> subShape);
78 Optional<SmallVector<int64_t, 4>>
shapeRatio(VectorType superVectorType,
79 VectorType subVectorType);
150 const DenseMap<Operation *, unsigned> &loopToVectorDim);
153 const DenseMap<Operation *, unsigned> &loopToVectorDim);
165 bool operatesOnSuperVectorsOf(Operation &op, VectorType subVectorType);
170 #endif // MLIR_DIALECT_VECTOR_UTILS_VECTORUTILS_H_ Include the generated interface declarations.
SmallVector< int64_t, 4 > computeStrides(ArrayRef< int64_t > shape, ArrayRef< int64_t > sizes)
Given the shape and sizes of a vector, returns the corresponding strides for each dimension...
Optional< SmallVector< int64_t, 4 > > shapeRatio(ArrayRef< int64_t > superShape, ArrayRef< int64_t > subShape)
Computes and returns the multi-dimensional ratio of superShape to subShape.
SmallVector< int64_t, 4 > computeElementOffsetsFromVectorSliceOffsets(ArrayRef< int64_t > sizes, ArrayRef< int64_t > vectorOffsets)
Given the target sizes of a vector, together with vector-space offsets, returns the element-space off...
static AffineMap makePermutationMap(ArrayRef< Value > indices, const DenseMap< Operation *, unsigned > &enclosingLoopToVectorDim)
Constructs a permutation map from memref indices to vector dimension.
int64_t computeMaxLinearIndex(ArrayRef< int64_t > basis)
Return the number of elements of basis, 0 if empty.
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...
Value makeArithReduction(OpBuilder &b, Location loc, CombiningKind kind, Value v1, Value v2)
Return the result value of reducing two scalar/vector values with the corresponding arith operation...