MLIR  15.0.0git
Macros | Functions
VectorUnrollDistribute.cpp File Reference
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Vector/Transforms/VectorTransforms.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/Interfaces/VectorInterfaces.h"
#include "mlir/Support/MathExtras.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include <numeric>
+ Include dependency graph for VectorUnrollDistribute.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "vector-unrolling"
 

Functions

static SmallVector< int64_t, 4 > getVectorOffset (ArrayRef< int64_t > originalShape, ArrayRef< int64_t > targetShape, int64_t index)
 During unrolling from originalShape to targetShape return the offset for the slice index. More...
 
static SmallVector< ValuesliceTransferIndices (ArrayRef< int64_t > elementOffsets, ArrayRef< Value > indices, AffineMap permutationMap, Location loc, OpBuilder &builder)
 Compute the indices of the slice index for a tranfer op. More...
 
static OperationcloneOpWithOperandsAndTypes (OpBuilder &builder, Location loc, Operation *op, ArrayRef< Value > operands, ArrayRef< Type > resultTypes)
 
static Optional< SmallVector< int64_t, 4 > > getTargetShape (const vector::UnrollVectorOptions &options, Operation *op)
 Return the target shape for unrolling for the given op. More...
 
static SmallVector< int64_t > getUnrollOrder (unsigned numLoops, Operation *op, const vector::UnrollVectorOptions &options)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "vector-unrolling"

Definition at line 23 of file VectorUnrollDistribute.cpp.

Function Documentation

◆ cloneOpWithOperandsAndTypes()

static Operation* cloneOpWithOperandsAndTypes ( OpBuilder builder,
Location  loc,
Operation op,
ArrayRef< Value operands,
ArrayRef< Type resultTypes 
)
static

◆ getTargetShape()

static Optional<SmallVector<int64_t, 4> > getTargetShape ( const vector::UnrollVectorOptions options,
Operation op 
)
static

Return the target shape for unrolling for the given op.

Return llvm::None if the op shouldn't be or cannot be unrolled.

Definition at line 143 of file VectorUnrollDistribute.cpp.

References mlir::failed(), mlir::vector::UnrollVectorOptions::filterConstraint, mlir::vector::UnrollVectorOptions::nativeShape, mlir::vector::None, and mlir::shapeRatio().

Referenced by getUnrollOrder().

◆ getUnrollOrder()

static SmallVector<int64_t> getUnrollOrder ( unsigned  numLoops,
Operation op,
const vector::UnrollVectorOptions options 
)
static

◆ getVectorOffset()

static SmallVector<int64_t, 4> getVectorOffset ( ArrayRef< int64_t >  originalShape,
ArrayRef< int64_t >  targetShape,
int64_t  index 
)
static

During unrolling from originalShape to targetShape return the offset for the slice index.

Definition at line 30 of file VectorUnrollDistribute.cpp.

References mlir::ceilDiv(), mlir::computeElementOffsetsFromVectorSliceOffsets(), mlir::computeStrides(), mlir::delinearize(), and vectorShape().

◆ sliceTransferIndices()

static SmallVector<Value> sliceTransferIndices ( ArrayRef< int64_t >  elementOffsets,
ArrayRef< Value indices,
AffineMap  permutationMap,
Location  loc,
OpBuilder builder 
)
static