MLIR
22.0.0git
|
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/MemRef/Utils/MemRefUtils.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/Dialect/Vector/Transforms/LoweringPatterns.h"
#include "mlir/Dialect/Vector/Transforms/VectorTransforms.h"
#include "mlir/Dialect/Vector/Utils/VectorUtils.h"
#include "mlir/IR/Dominance.h"
#include "mlir/IR/Operation.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DebugLog.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "vector-transfer-opt" |
Functions | |
static Operation * | findAncestorOpInRegion (Region *region, Operation *op) |
Return the ancestor op in the region or nullptr if the region is not an ancestor of the op. More... | |
static SmallVector< int64_t > | getReducedShape (ArrayRef< OpFoldResult > mixedSizes) |
Converts OpFoldResults to int64_t shape without unit dims. More... | |
static MemRefType | dropUnitDims (MemRefType inputType, ArrayRef< OpFoldResult > offsets, ArrayRef< OpFoldResult > sizes, ArrayRef< OpFoldResult > strides) |
Drops unit dimensions from the input MemRefType. More... | |
static Value | rankReducingSubviewDroppingUnitDims (PatternRewriter &rewriter, mlir::Location loc, Value input) |
Creates a rank-reducing memref.subview op that drops unit dims from its input. More... | |
static int | getReducedRank (ArrayRef< int64_t > shape) |
Returns the number of dims that aren't unit dims. More... | |
static VectorType | trimNonScalableUnitDims (VectorType oldType) |
Trims non-scalable one dimensions from oldType and returns the result type. More... | |
static FailureOr< Value > | createMaskDropNonScalableUnitDims (PatternRewriter &rewriter, Location loc, vector::CreateMaskOp op) |
static Value | collapseInnerDims (PatternRewriter &rewriter, mlir::Location loc, Value input, int64_t firstDimToCollapse) |
Creates a memref.collapse_shape collapsing all inner dimensions of the input starting at firstDimToCollapse . More... | |
static SmallVector< Value > | getCollapsedIndices (RewriterBase &rewriter, Location loc, ArrayRef< int64_t > shape, ValueRange indices, int64_t firstDimToCollapse) |
Returns the new indices that collapses the inner dimensions starting from the firstDimToCollapse dimension. More... | |
#define DEBUG_TYPE "vector-transfer-opt" |
Definition at line 31 of file VectorTransferOpTransforms.cpp.
|
static |
Creates a memref.collapse_shape collapsing all inner dimensions of the input starting at firstDimToCollapse
.
Definition at line 697 of file VectorTransferOpTransforms.cpp.
References mlir::Value::getType().
|
static |
Definition at line 434 of file VectorTransferOpTransforms.cpp.
References trimNonScalableUnitDims().
|
static |
Drops unit dimensions from the input MemRefType.
Definition at line 383 of file VectorTransferOpTransforms.cpp.
References getReducedShape().
Referenced by rankReducingSubviewDroppingUnitDims().
Return the ancestor op in the region or nullptr if the region is not an ancestor of the op.
Definition at line 37 of file VectorTransferOpTransforms.cpp.
References mlir::Operation::getParentOp(), and mlir::Operation::getParentRegion().
Referenced by mlir::applyOpPatternsGreedily().
|
static |
Returns the new indices that collapses the inner dimensions starting from the firstDimToCollapse
dimension.
Definition at line 714 of file VectorTransferOpTransforms.cpp.
References mlir::computeLinearIndex(), mlir::computeSuffixProduct(), mlir::arith::ConstantIndexOp::create(), mlir::getConstantIntValue(), mlir::isZeroInteger(), and mlir::affine::makeComposedFoldedAffineApply().
|
static |
Returns the number of dims that aren't unit dims.
Definition at line 414 of file VectorTransferOpTransforms.cpp.
|
static |
Converts OpFoldResults to int64_t shape without unit dims.
Definition at line 366 of file VectorTransferOpTransforms.cpp.
Referenced by dropUnitDims().
|
static |
Creates a rank-reducing memref.subview op that drops unit dims from its input.
Or just returns the input if it was already without unit dims.
Definition at line 395 of file VectorTransferOpTransforms.cpp.
References dropUnitDims(), mlir::Builder::getIndexAttr(), mlir::memref::getMixedSizes(), and mlir::Value::getType().
|
static |
Trims non-scalable one dimensions from oldType
and returns the result type.
Definition at line 420 of file VectorTransferOpTransforms.cpp.
References mlir::detail::enumerate(), and mlir::get().
Referenced by createMaskDropNonScalableUnitDims().