#include "mlir/Dialect/SPIRV/IR/SPIRVEnums.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "SPIRVOpUtils.h"
#include "SPIRVParsingUtils.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
#include "mlir/IR/Diagnostics.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Casting.h"
usingnamespacemlir::spirv::AttrNames;
namespace mlir::spirv {
template <typename MemoryOpTy>
ParseResult parseMemoryAccessAttributes(OpAsmParser &parser,
OperationState &state) { … }
template <typename MemoryOpTy>
static ParseResult parseSourceMemoryAccessAttributes(OpAsmParser &parser,
OperationState &state) { … }
template <typename MemoryOpTy>
static void printSourceMemoryAccessAttribute(
MemoryOpTy memoryOp, OpAsmPrinter &printer,
SmallVectorImpl<StringRef> &elidedAttrs,
std::optional<spirv::MemoryAccess> memoryAccessAtrrValue = std::nullopt,
std::optional<uint32_t> alignmentAttrValue = std::nullopt) { … }
template <typename MemoryOpTy>
static void printMemoryAccessAttribute(
MemoryOpTy memoryOp, OpAsmPrinter &printer,
SmallVectorImpl<StringRef> &elidedAttrs,
std::optional<spirv::MemoryAccess> memoryAccessAtrrValue = std::nullopt,
std::optional<uint32_t> alignmentAttrValue = std::nullopt) { … }
template <typename LoadStoreOpTy>
static LogicalResult verifyLoadStorePtrAndValTypes(LoadStoreOpTy op, Value ptr,
Value val) { … }
template <typename MemoryOpTy>
static LogicalResult verifyMemoryAccessAttribute(MemoryOpTy memoryOp) { … }
template <typename MemoryOpTy>
static LogicalResult verifySourceMemoryAccessAttribute(MemoryOpTy memoryOp) { … }
static Type getElementPtrType(Type type, ValueRange indices, Location baseLoc) { … }
void AccessChainOp::build(OpBuilder &builder, OperationState &state,
Value basePtr, ValueRange indices) { … }
ParseResult AccessChainOp::parse(OpAsmParser &parser, OperationState &result) { … }
template <typename Op>
static void printAccessChain(Op op, ValueRange indices, OpAsmPrinter &printer) { … }
void spirv::AccessChainOp::print(OpAsmPrinter &printer) { … }
template <typename Op>
static LogicalResult verifyAccessChain(Op accessChainOp, ValueRange indices) { … }
LogicalResult AccessChainOp::verify() { … }
void LoadOp::build(OpBuilder &builder, OperationState &state, Value basePtr,
MemoryAccessAttr memoryAccess, IntegerAttr alignment) { … }
ParseResult LoadOp::parse(OpAsmParser &parser, OperationState &result) { … }
void LoadOp::print(OpAsmPrinter &printer) { … }
LogicalResult LoadOp::verify() { … }
ParseResult StoreOp::parse(OpAsmParser &parser, OperationState &result) { … }
void StoreOp::print(OpAsmPrinter &printer) { … }
LogicalResult StoreOp::verify() { … }
void CopyMemoryOp::print(OpAsmPrinter &printer) { … }
ParseResult CopyMemoryOp::parse(OpAsmParser &parser, OperationState &result) { … }
LogicalResult CopyMemoryOp::verify() { … }
static ParseResult parsePtrAccessChainOpImpl(StringRef opName,
OpAsmParser &parser,
OperationState &state) { … }
template <typename Op>
static auto concatElemAndIndices(Op op) { … }
void InBoundsPtrAccessChainOp::build(OpBuilder &builder, OperationState &state,
Value basePtr, Value element,
ValueRange indices) { … }
ParseResult InBoundsPtrAccessChainOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void InBoundsPtrAccessChainOp::print(OpAsmPrinter &printer) { … }
LogicalResult InBoundsPtrAccessChainOp::verify() { … }
void PtrAccessChainOp::build(OpBuilder &builder, OperationState &state,
Value basePtr, Value element, ValueRange indices) { … }
ParseResult PtrAccessChainOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void PtrAccessChainOp::print(OpAsmPrinter &printer) { … }
LogicalResult PtrAccessChainOp::verify() { … }
ParseResult VariableOp::parse(OpAsmParser &parser, OperationState &result) { … }
void VariableOp::print(OpAsmPrinter &printer) { … }
LogicalResult VariableOp::verify() { … }
}