|
MLIR 23.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/Matchers.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. | |
| static SmallVector< int64_t > | getReducedShape (ArrayRef< OpFoldResult > mixedSizes) |
| Converts OpFoldResults to int64_t shape without unit dims. | |
| static MemRefType | dropUnitDims (MemRefType inputType, ArrayRef< OpFoldResult > offsets, ArrayRef< OpFoldResult > sizes, ArrayRef< OpFoldResult > strides) |
| Drops unit dimensions from the input MemRefType. | |
| static Value | rankReducingSubviewDroppingUnitDims (PatternRewriter &rewriter, mlir::Location loc, Value input) |
| Creates a rank-reducing memref.subview op that drops unit dims from its input. | |
| static int | getReducedRank (ArrayRef< int64_t > shape) |
| Returns the number of dims that aren't unit dims. | |
| static VectorType | trimNonScalableUnitDims (VectorType oldType) |
| Trims non-scalable one dimensions from oldType and returns the result type. | |
| static bool | isUnitDimMask (Value maskDimSize) |
| static bool | isUnitDimMask (int64_t maskDimSize) |
| template<typename MaskOp> | |
| static FailureOr< Value > | maskDropNonScalableUnitDims (PatternRewriter &rewriter, Location loc, MaskOp op) |
| Rewrites a mask op to drop non-scalable unit dimensions. | |
| 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. | |
| 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. | |
| #define DEBUG_TYPE "vector-transfer-opt" |
Definition at line 32 of file VectorTransferOpTransforms.cpp.
|
static |
Creates a memref.collapse_shape collapsing all inner dimensions of the input starting at firstDimToCollapse.
Definition at line 704 of file VectorTransferOpTransforms.cpp.
References mlir::Value::getType().
|
static |
Drops unit dimensions from the input MemRefType.
Definition at line 384 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 38 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 721 of file VectorTransferOpTransforms.cpp.
References mlir::computeLinearIndex(), mlir::computeSuffixProduct(), mlir::arith::ConstantIndexOp::create(), mlir::getConstantIntValue(), indices, mlir::isZeroInteger(), and mlir::affine::makeComposedFoldedAffineApply().
Returns the number of dims that aren't unit dims.
Definition at line 415 of file VectorTransferOpTransforms.cpp.
|
static |
Converts OpFoldResults to int64_t shape without unit dims.
Definition at line 367 of file VectorTransferOpTransforms.cpp.
Referenced by dropUnitDims().
Definition at line 436 of file VectorTransferOpTransforms.cpp.
Definition at line 433 of file VectorTransferOpTransforms.cpp.
References mlir::m_One(), and mlir::matchPattern().
Referenced by maskDropNonScalableUnitDims().
|
static |
Rewrites a mask op to drop non-scalable unit dimensions.
Supports vector.create_mask and vector.constant_mask.
Definition at line 441 of file VectorTransferOpTransforms.cpp.
References isUnitDimMask(), and trimNonScalableUnitDims().
|
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 396 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 421 of file VectorTransferOpTransforms.cpp.
Referenced by maskDropNonScalableUnitDims().