MLIR  22.0.0git
Namespaces | Macros | Functions
FoldMemRefAliasOps.cpp File Reference
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/ViewLikeInterfaceUtils.h"
#include "mlir/Dialect/Arith/Utils/Utils.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/MemRef/Transforms/Passes.h"
#include "mlir/Dialect/MemRef/Transforms/Transforms.h"
#include "mlir/Dialect/MemRef/Utils/MemRefUtils.h"
#include "mlir/Dialect/NVGPU/IR/NVGPUDialect.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/Debug.h"
#include "mlir/Dialect/MemRef/Transforms/Passes.h.inc"

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::memref
 

Macros

#define DEBUG_TYPE   "fold-memref-alias-ops"
 
#define DBGS()   (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
 
#define GEN_PASS_DEF_FOLDMEMREFALIASOPSPASS
 

Functions

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< ValuecalculateExpandedAccessIndices (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)
 

Macro Definition Documentation

◆ DBGS

#define DBGS ( )    (llvm::dbgs() << "[" DEBUG_TYPE "]: ")

Definition at line 32 of file FoldMemRefAliasOps.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "fold-memref-alias-ops"

Definition at line 31 of file FoldMemRefAliasOps.cpp.

◆ GEN_PASS_DEF_FOLDMEMREFALIASOPSPASS

#define GEN_PASS_DEF_FOLDMEMREFALIASOPSPASS

Definition at line 36 of file FoldMemRefAliasOps.cpp.

Function Documentation

◆ calculateExpandedAccessIndices()

static SmallVector<Value> calculateExpandedAccessIndices ( AffineMap  affineMap,
const SmallVector< Value > &  indices,
Location  loc,
PatternRewriter rewriter 
)
static

◆ getMemRefOperand() [1/10]

static Value getMemRefOperand ( gpu::SubgroupMmaLoadMatrixOp  op)
static

Definition at line 73 of file FoldMemRefAliasOps.cpp.

◆ getMemRefOperand() [2/10]

static Value getMemRefOperand ( gpu::SubgroupMmaStoreMatrixOp  op)
static

Definition at line 77 of file FoldMemRefAliasOps.cpp.

◆ getMemRefOperand() [3/10]

template<typename LoadOrStoreOpTy >
static Value getMemRefOperand ( LoadOrStoreOpTy  op)
static

Helpers to access the memref operand for each op.

Definition at line 49 of file FoldMemRefAliasOps.cpp.

◆ getMemRefOperand() [4/10]

static Value getMemRefOperand ( nvgpu::LdMatrixOp  op)
static

Definition at line 57 of file FoldMemRefAliasOps.cpp.

◆ getMemRefOperand() [5/10]

static Value getMemRefOperand ( vector::LoadOp  op)
static

Definition at line 61 of file FoldMemRefAliasOps.cpp.

◆ getMemRefOperand() [6/10]

static Value getMemRefOperand ( vector::MaskedLoadOp  op)
static

Definition at line 65 of file FoldMemRefAliasOps.cpp.

◆ getMemRefOperand() [7/10]

static Value getMemRefOperand ( vector::MaskedStoreOp  op)
static

Definition at line 67 of file FoldMemRefAliasOps.cpp.

◆ getMemRefOperand() [8/10]

static Value getMemRefOperand ( vector::StoreOp  op)
static

Definition at line 63 of file FoldMemRefAliasOps.cpp.

◆ getMemRefOperand() [9/10]

static Value getMemRefOperand ( vector::TransferReadOp  op)
static

Definition at line 53 of file FoldMemRefAliasOps.cpp.

◆ getMemRefOperand() [10/10]

static Value getMemRefOperand ( vector::TransferWriteOp  op)
static

Definition at line 69 of file FoldMemRefAliasOps.cpp.

◆ preconditionsFoldSubViewOp() [1/3]

static LogicalResult preconditionsFoldSubViewOp ( RewriterBase rewriter,
Operation op,
memref::SubViewOp  subviewOp 
)
static

Definition at line 233 of file FoldMemRefAliasOps.cpp.

◆ preconditionsFoldSubViewOp() [2/3]

static LogicalResult preconditionsFoldSubViewOp ( RewriterBase rewriter,
vector::TransferReadOp  readOp,
memref::SubViewOp  subviewOp 
)
static

Definition at line 239 of file FoldMemRefAliasOps.cpp.

References preconditionsFoldSubViewOpImpl().

◆ preconditionsFoldSubViewOp() [3/3]

static LogicalResult preconditionsFoldSubViewOp ( RewriterBase rewriter,
vector::TransferWriteOp  writeOp,
memref::SubViewOp  subviewOp 
)
static

Definition at line 245 of file FoldMemRefAliasOps.cpp.

References preconditionsFoldSubViewOpImpl().

◆ preconditionsFoldSubViewOpImpl()

template<typename XferOp >
static LogicalResult preconditionsFoldSubViewOpImpl ( RewriterBase rewriter,
XferOp  xferOp,
memref::SubViewOp  subviewOp 
)
static