|
static LogicalResult | resolveSourceIndicesExpandShape (Location loc, PatternRewriter &rewriter, memref::ExpandShapeOp expandShapeOp, ValueRange indices, SmallVectorImpl< Value > &sourceIndices) |
| Given the 'indices' of a load/store operation where the memref is a result of a expand_shape op, returns the indices w.r.t to the source memref of the expand_shape op. More...
|
|
static LogicalResult | resolveSourceIndicesCollapseShape (Location loc, PatternRewriter &rewriter, memref::CollapseShapeOp collapseShapeOp, ValueRange indices, SmallVectorImpl< Value > &sourceIndices) |
| Given the 'indices' of a load/store operation where the memref is a result of a collapse_shape op, returns the indices w.r.t to the source memref of the collapse_shape op. More...
|
|
template<typename LoadOrStoreOpTy > |
static Value | getMemRefOperand (LoadOrStoreOpTy op) |
| Helpers to access the memref operand for each op. More...
|
|
static Value | getMemRefOperand (vector::TransferReadOp op) |
|
static Value | getMemRefOperand (nvgpu::LdMatrixOp op) |
|
static Value | getMemRefOperand (vector::LoadOp op) |
|
static Value | getMemRefOperand (vector::StoreOp op) |
|
static Value | getMemRefOperand (vector::MaskedLoadOp op) |
|
static Value | getMemRefOperand (vector::MaskedStoreOp op) |
|
static Value | getMemRefOperand (vector::TransferWriteOp op) |
|
static Value | getMemRefOperand (gpu::SubgroupMmaLoadMatrixOp op) |
|
static Value | getMemRefOperand (gpu::SubgroupMmaStoreMatrixOp op) |
|
static SmallVector< Value > | calculateExpandedAccessIndices (AffineMap affineMap, const SmallVector< Value > &indices, Location loc, PatternRewriter &rewriter) |
|
template<typename XferOp > |
static LogicalResult | preconditionsFoldSubViewOpImpl (RewriterBase &rewriter, XferOp xferOp, memref::SubViewOp subviewOp) |
|
static LogicalResult | preconditionsFoldSubViewOp (RewriterBase &rewriter, Operation *op, memref::SubViewOp subviewOp) |
|
static LogicalResult | preconditionsFoldSubViewOp (RewriterBase &rewriter, vector::TransferReadOp readOp, memref::SubViewOp subviewOp) |
|
static LogicalResult | preconditionsFoldSubViewOp (RewriterBase &rewriter, vector::TransferWriteOp writeOp, memref::SubViewOp subviewOp) |
|
Given the 'indices' of a load/store operation where the memref is a result of a collapse_shape op, returns the indices w.r.t to the source memref of the collapse_shape op.
For example
%0 = ... : memref<2x6x42xf32> %1 = memref.collapse_shape %0 [[0, 1], [2]] : memref<2x6x42xf32> into memref<12x42xf32> %2 = load %1[i1, i2] : memref<12x42xf32>
could be folded into
%2 = load %0[i1 / 6, i1 % 6, i2] : memref<2x6x42xf32>
Definition at line 166 of file FoldMemRefAliasOps.cpp.
References mlir::computeSuffixProduct(), mlir::delinearize(), mlir::AffineMap::get(), mlir::Builder::getAffineDimExpr(), mlir::Builder::getConstantAffineMap(), mlir::getValueOrCreateConstantIndexOp(), and mlir::affine::makeComposedFoldedAffineApply().
Given the 'indices' of a load/store operation where the memref is a result of a expand_shape op, returns the indices w.r.t to the source memref of the expand_shape op.
For example
%0 = ... : memref<12x42xf32> %1 = memref.expand_shape %0 [[0, 1], [2]] : memref<12x42xf32> into memref<2x6x42xf32> %2 = load %1[i1, i2, i3] : memref<2x6x42xf32
could be folded into
%2 = load %0[6 * i1 + i2, i3] : memref<12x42xf32>
Definition at line 63 of file FoldMemRefAliasOps.cpp.
References mlir::memref::computeSuffixProductIRBlock(), mlir::OpBuilder::create(), mlir::AffineMap::get(), mlir::Builder::getContext(), mlir::Builder::getIndexAttr(), mlir::Operation::getResult(), mlir::getValueOrCreateConstantIndexOp(), mlir::inferExpandShapeOutputShape(), mlir::linearize(), and mlir::affine::makeComposedFoldedAffineApply().