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

Macro Definition Documentation

◆ GEN_PASS_DEF_AMDGPUTRANSFERREADTOLOADPASS

#define GEN_PASS_DEF_AMDGPUTRANSFERREADTOLOADPASS

Definition at line 21 of file TransferReadToLoad.cpp.

Function Documentation

◆ 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 40 of file TransferReadToLoad.cpp.

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