MLIR
20.0.0git
|
#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 "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Debug.h"
#include <numeric>
#include <optional>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "vector-unroll" |
#define | DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ") |
#define | LDBG(X) LLVM_DEBUG(DBGS() << X << "\n") |
Functions | |
static SmallVector< Value > | sliceTransferIndices (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 Operation * | cloneOpWithOperandsAndTypes (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 . More... | |
static SmallVector< int64_t > | getUnrollOrder (unsigned numLoops, Operation *op, const vector::UnrollVectorOptions &options) |
#define DBGS | ( | ) | (llvm::dbgs() << "[" DEBUG_TYPE "]: ") |
Definition at line 25 of file VectorUnroll.cpp.
#define DEBUG_TYPE "vector-unroll" |
Definition at line 24 of file VectorUnroll.cpp.
#define LDBG | ( | X | ) | LLVM_DEBUG(DBGS() << X << "\n") |
Definition at line 26 of file VectorUnroll.cpp.
|
static |
Definition at line 60 of file VectorUnroll.cpp.
References mlir::OpBuilder::create(), mlir::Operation::getAttrs(), mlir::OperationName::getIdentifier(), and mlir::Operation::getName().
|
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 71 of file VectorUnroll.cpp.
References mlir::computeShapeRatio(), DBGS, mlir::Operation::getName(), mlir::OperationName::getStringRef(), LDBG, and options.
|
static |
Definition at line 117 of file VectorUnroll.cpp.
References options.
|
static |
Compute the indices of the slice index
for a tranfer op.
Definition at line 32 of file VectorUnroll.cpp.
References mlir::OpBuilder::create(), mlir::detail::enumerate(), mlir::AffineMap::get(), mlir::getAffineConstantExpr(), mlir::getAffineDimExpr(), mlir::Builder::getContext(), and mlir::AffineMap::getResults().