MLIR 22.0.0git
VectorUnroll.cpp File Reference
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Vector/Transforms/LoweringPatterns.h"
#include "mlir/Dialect/Vector/Transforms/VectorTransforms.h"
#include "mlir/Interfaces/VectorInterfaces.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/DebugLog.h"
#include "llvm/Support/InterleavedRange.h"
#include <optional>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "vector-unroll"

Functions

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 transfer op.
static SmallVector< ValuesliceLoadStoreIndices (PatternRewriter &rewriter, Location loc, OperandRange originalIndices, ArrayRef< int64_t > offsets)
static OperationcloneOpWithOperandsAndTypes (OpBuilder &builder, Location loc, Operation *op, ArrayRef< Value > operands, ArrayRef< Type > resultTypes)
static std::optional< SmallVector< int64_t > > getTargetShape (const vector::UnrollVectorOptions &options, Operation *op)
 Return the target shape for unrolling for the given op.
static SmallVector< int64_tgetUnrollOrder (unsigned numLoops, Operation *op, const vector::UnrollVectorOptions &options)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "vector-unroll"

Definition at line 24 of file VectorUnroll.cpp.

Function Documentation

◆ cloneOpWithOperandsAndTypes()

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

◆ getTargetShape()

std::optional< SmallVector< int64_t > > getTargetShape ( const vector::UnrollVectorOptions & options,
Operation * op )
static

Return the target shape for unrolling for the given op.

Return std::nullopt if the op shouldn't be or cannot be unrolled.

Definition at line 91 of file VectorUnroll.cpp.

References mlir::computeShapeRatio(), mlir::Operation::getName(), mlir::OperationName::getStringRef(), and options.

◆ getUnrollOrder()

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

Definition at line 133 of file VectorUnroll.cpp.

References options.

◆ sliceLoadStoreIndices()

SmallVector< Value > sliceLoadStoreIndices ( PatternRewriter & rewriter,
Location loc,
OperandRange originalIndices,
ArrayRef< int64_t > offsets )
static

Definition at line 59 of file VectorUnroll.cpp.

References mlir::arith::ConstantIndexOp::create(), and indices.

◆ sliceTransferIndices()

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

Compute the indices of the slice index for a transfer op.

Definition at line 30 of file VectorUnroll.cpp.

References mlir::AffineMap::get(), mlir::getAffineConstantExpr(), mlir::getAffineDimExpr(), mlir::Builder::getContext(), mlir::AffineMap::getResults(), and indices.