MLIR  21.0.0git
Classes | Namespaces | Macros | Functions | Variables
TransferReadToLoad.cpp File Reference
#include "mlir/Dialect/AMDGPU/Transforms/Passes.h"
#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h"
#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/SCF/IR/SCF.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Support/LogicalResult.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/Support/MathExtras.h"
#include "mlir/Dialect/AMDGPU/Transforms/Passes.h.inc"

Go to the source code of this file.

Classes

struct  AmdgpuTransferReadToLoadPass
 

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::amdgpu
 

Macros

#define GEN_PASS_DEF_AMDGPUTRANSFERREADTOLOADPASS
 

Functions

static LogicalResult transferPreconditions (PatternRewriter &rewriter, VectorTransferOpInterface xferOp, bool &requiresBroadcasting, VectorType &unbroadcastedVectorType)
 This pattern supports lowering of: vector.transfer_read to a combination of vector.load, arith.select and vector.broadcast if all of the following hold: More...
 
static Value createVectorLoadForMaskedLoad (OpBuilder &builder, Location loc, vector::TransferReadOp readOp, bool requiresBroadcasting, VectorType unbroadcastedVectorType)
 

Variables

static constexpr char kTransferReadNeedsMask []
 

Macro Definition Documentation

◆ GEN_PASS_DEF_AMDGPUTRANSFERREADTOLOADPASS

#define GEN_PASS_DEF_AMDGPUTRANSFERREADTOLOADPASS

Definition at line 28 of file TransferReadToLoad.cpp.

Function Documentation

◆ createVectorLoadForMaskedLoad()

static Value createVectorLoadForMaskedLoad ( OpBuilder builder,
Location  loc,
vector::TransferReadOp  readOp,
bool  requiresBroadcasting,
VectorType  unbroadcastedVectorType 
)
static

Definition at line 114 of file TransferReadToLoad.cpp.

References mlir::OpBuilder::create().

◆ transferPreconditions()

static LogicalResult transferPreconditions ( PatternRewriter rewriter,
VectorTransferOpInterface  xferOp,
bool &  requiresBroadcasting,
VectorType &  unbroadcastedVectorType 
)
static

This pattern supports lowering of: vector.transfer_read to a combination of vector.load, arith.select and vector.broadcast if all of the following hold:

  • The transfer op is masked.
  • The memref is in buffer address space.
  • Stride of most minor memref dimension must be 1.
  • Out-of-bounds masking is not required.
  • If the memref's element type is a vector type then it coincides with the result type.
  • The permutation map doesn't perform permutation (broadcasting is allowed). Note: those conditions mostly come from TransferReadToVectorLoadLowering pass.

Definition at line 47 of file TransferReadToLoad.cpp.

References mlir::RewriterBase::notifyMatchFailure(), and vectorShape().

Variable Documentation

◆ kTransferReadNeedsMask

constexpr char kTransferReadNeedsMask[]
staticconstexpr
Initial value:
=
"amdgpu.buffer_transfer_read_needs_mask"

Definition at line 131 of file TransferReadToLoad.cpp.