MLIR 22.0.0git
AMDGPUDialect.cpp File Reference
#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/LLVMIR/ROCDLDialect.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/MemRef/Utils/MemRefUtils.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Transforms/InliningUtils.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/TypeSwitch.h"
#include <algorithm>
#include <cstdint>
#include <limits>
#include <optional>
#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.cpp.inc"
#include "mlir/Dialect/AMDGPU/IR/AMDGPU.cpp.inc"
#include "mlir/Dialect/AMDGPU/IR/AMDGPUTypes.cpp.inc"
#include "mlir/Dialect/AMDGPU/IR/AMDGPUAttributes.cpp.inc"
#include "mlir/Dialect/AMDGPU/IR/AMDGPUEnums.cpp.inc"

Go to the source code of this file.

Macros

#define GET_OP_LIST
#define GET_TYPEDEF_LIST
#define GET_ATTRDEF_LIST
#define GET_ATTRDEF_CLASSES
#define GET_TYPEDEF_CLASSES
#define GET_OP_CLASSES

Functions

static FailureOr< MemRefType > getFatRawBufferTypeLike (MemRefType source, bool resetOffset)
 Convert the type source to one with the same sizes and strides - and offset, unless stripOffset is true, in which case the offset is reset to 0, if the offset should be reset but the layout of source isn't either the identity layout or a strided layout, this function fails.
static bool hasGlobalMemorySpace (Attribute memorySpace)
static bool hasWorkgroupMemorySpace (Attribute memorySpace)
static bool hasFatRawBufferMemorySpace (Attribute memorySpace)
template<typename T>
static LogicalResult verifyRawBufferOp (T &op)
static std::optional< uint32_t > getConstantUint32 (Value v)
template<typename OpType>
static bool staticallyOutOfBounds (OpType op)
template<typename BaseOp>
static LogicalResult verifyBase (BaseOp op)
template<typename DescriptorOp>
static LogicalResult verifyDescriptorOp (DescriptorOp op)
template<typename DescriptorOp, typename FoldAdaptor>
static OpFoldResult foldDescriptorOp (DescriptorOp op, FoldAdaptor adaptor)

Macro Definition Documentation

◆ GET_ATTRDEF_CLASSES

#define GET_ATTRDEF_CLASSES

Definition at line 1227 of file AMDGPUDialect.cpp.

◆ GET_ATTRDEF_LIST

#define GET_ATTRDEF_LIST

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 1233 of file AMDGPUDialect.cpp.

◆ GET_OP_LIST

#define GET_OP_LIST

◆ GET_TYPEDEF_CLASSES

#define GET_TYPEDEF_CLASSES

Definition at line 1230 of file AMDGPUDialect.cpp.

◆ GET_TYPEDEF_LIST

#define GET_TYPEDEF_LIST

Function Documentation

◆ foldDescriptorOp()

template<typename DescriptorOp, typename FoldAdaptor>
OpFoldResult foldDescriptorOp ( DescriptorOp op,
FoldAdaptor adaptor )
static

◆ getConstantUint32()

std::optional< uint32_t > getConstantUint32 ( Value v)
static

◆ getFatRawBufferTypeLike()

FailureOr< MemRefType > getFatRawBufferTypeLike ( MemRefType source,
bool resetOffset )
static

Convert the type source to one with the same sizes and strides - and offset, unless stripOffset is true, in which case the offset is reset to 0, if the offset should be reset but the layout of source isn't either the identity layout or a strided layout, this function fails.

Definition at line 102 of file AMDGPUDialect.cpp.

References mlir::computeSuffixProduct(), mlir::AffineMap::getMultiDimIdentityMap(), mlir::MemRefType::Builder::setLayout(), and mlir::MemRefType::Builder::setMemorySpace().

◆ hasFatRawBufferMemorySpace()

bool hasFatRawBufferMemorySpace ( Attribute memorySpace)
static

Definition at line 189 of file AMDGPUDialect.cpp.

◆ hasGlobalMemorySpace()

bool hasGlobalMemorySpace ( Attribute memorySpace)
static

Definition at line 169 of file AMDGPUDialect.cpp.

Referenced by verifyBase(), and verifyRawBufferOp().

◆ hasWorkgroupMemorySpace()

bool hasWorkgroupMemorySpace ( Attribute memorySpace)
static

Definition at line 179 of file AMDGPUDialect.cpp.

Referenced by verifyBase(), and verifyDescriptorOp().

◆ staticallyOutOfBounds()

template<typename OpType>
bool staticallyOutOfBounds ( OpType op)
static

Definition at line 253 of file AMDGPUDialect.cpp.

References getConstantUint32(), and result.

◆ verifyBase()

template<typename BaseOp>
LogicalResult verifyBase ( BaseOp op)
static

◆ verifyDescriptorOp()

template<typename DescriptorOp>
LogicalResult verifyDescriptorOp ( DescriptorOp op)
static

Definition at line 986 of file AMDGPUDialect.cpp.

References hasWorkgroupMemorySpace(), and success().

◆ verifyRawBufferOp()

template<typename T>
LogicalResult verifyRawBufferOp ( T & op)
static

Definition at line 203 of file AMDGPUDialect.cpp.

References hasGlobalMemorySpace(), and success().