MLIR  17.0.0git
Namespaces | Macros | Functions | Variables
SPIRVOps.cpp File Reference
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "mlir/Dialect/SPIRV/IR/ParserUtils.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVAttributes.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVEnums.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOpTraits.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
#include "mlir/Dialect/SPIRV/IR/TargetAndABI.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/FunctionImplementation.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Interfaces/CallInterfaces.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/FormatVariadic.h"
#include <cassert>
#include <numeric>
#include "mlir/Dialect/SPIRV/IR/SPIRVAvailability.cpp.inc"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.cpp.inc"
#include "mlir/Dialect/SPIRV/IR/SPIRVOpAvailabilityImpl.inc"

Go to the source code of this file.

Namespaces

 mlir
 This header declares functions that assit transformations in the MemRef dialect.
 
 mlir::spirv
 

Macros

#define SPIRV_IMPL_INTEGER_DOT_PRODUCT_OP(OpName)
 
#define GET_OP_CLASSES
 

Functions

static ParseResult parseOneResultSameOperandTypeOp (OpAsmParser &parser, OperationState &result)
 
static void printOneResultOp (Operation *op, OpAsmPrinter &p)
 
static bool isNestedInFunctionOpInterface (Operation *op)
 Returns true if the given op is a function-like op or nested in a function-like op without a module-like op in the middle. More...
 
static bool isDirectInModuleLikeOp (Operation *op)
 Returns true if the given op is an module-like op that maintains a symbol table. More...
 
static LogicalResult extractValueFromConstOp (Operation *op, int32_t &value)
 
template<typename Ty >
static ArrayAttr getStrArrayAttrForEnumList (Builder &builder, ArrayRef< Ty > enumValues, function_ref< StringRef(Ty)> stringifyFn)
 
template<typename EnumClass >
static ParseResult parseEnumStrAttr (EnumClass &value, OpAsmParser &parser, StringRef attrName=spirv::attributeName< EnumClass >())
 Parses the next string attribute in parser as an enumerant of the given EnumClass. More...
 
template<typename EnumAttrClass , typename EnumClass = typename EnumAttrClass::ValueType>
static ParseResult parseEnumStrAttr (EnumClass &value, OpAsmParser &parser, OperationState &state, StringRef attrName=spirv::attributeName< EnumClass >())
 Parses the next string attribute in parser as an enumerant of the given EnumClass and inserts the enumerant into state as an 32-bit integer attribute with the enum class's name as attribute name. More...
 
template<typename EnumAttrClass , typename EnumClass = typename EnumAttrClass::ValueType>
static ParseResult parseEnumKeywordAttr (EnumClass &value, OpAsmParser &parser, OperationState &state, StringRef attrName=spirv::attributeName< EnumClass >())
 Parses the next keyword in parser as an enumerant of the given EnumClass and inserts the enumerant into state as an 32-bit integer attribute with the enum class's name as attribute name. More...
 
template<typename EnumAttrClass , typename EnumClass >
static ParseResult parseControlAttribute (OpAsmParser &parser, OperationState &state, StringRef attrName=spirv::attributeName< EnumClass >())
 Parses Function, Selection and Loop control attributes. More...
 
static ParseResult parseMemoryAccessAttributes (OpAsmParser &parser, OperationState &state)
 Parses optional memory access attributes attached to a memory access operand/pointer. More...
 
static ParseResult parseSourceMemoryAccessAttributes (OpAsmParser &parser, OperationState &state)
 
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 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)
 
static ParseResult parseImageOperands (OpAsmParser &parser, spirv::ImageOperandsAttr &attr)
 
static void printImageOperands (OpAsmPrinter &printer, Operation *imageOp, spirv::ImageOperandsAttr attr)
 
template<typename Op >
static LogicalResult verifyImageOperands (Op imageOp, spirv::ImageOperandsAttr attr, Operation::operand_range operands)
 
static LogicalResult verifyCastOp (Operation *op, bool requireSameBitWidth=true, bool skipBitWidthCheck=false)
 
template<typename MemoryOpTy >
static LogicalResult verifyMemoryAccessAttribute (MemoryOpTy memoryOp)
 
template<typename MemoryOpTy >
static LogicalResult verifySourceMemoryAccessAttribute (MemoryOpTy memoryOp)
 
static LogicalResult verifyMemorySemantics (Operation *op, spirv::MemorySemantics memorySemantics)
 
template<typename LoadStoreOpTy >
static LogicalResult verifyLoadStorePtrAndValTypes (LoadStoreOpTy op, Value ptr, Value val)
 
template<typename BlockReadWriteOpTy >
static LogicalResult verifyBlockReadWritePtrAndValTypes (BlockReadWriteOpTy op, Value ptr, Value val)
 
static ParseResult parseVariableDecorations (OpAsmParser &parser, OperationState &state)
 
static void printVariableDecorations (Operation *op, OpAsmPrinter &printer, SmallVectorImpl< StringRef > &elidedAttrs)
 
static unsigned getBitWidth (Type type)
 
static Type getElementType (Type type, ArrayRef< int32_t > indices, function_ref< InFlightDiagnostic(StringRef)> emitErrorFn)
 Walks the given type hierarchy with the given indices, potentially down to component granularity, to select an element type. More...
 
static Type getElementType (Type type, Attribute indices, function_ref< InFlightDiagnostic(StringRef)> emitErrorFn)
 
static Type getElementType (Type type, Attribute indices, Location loc)
 
static Type getElementType (Type type, Attribute indices, OpAsmParser &parser, SMLoc loc)
 
static bool isMergeBlock (Block &block)
 Returns true if the given block only contains one spirv.mlir.merge op. More...
 
template<typename ExtendedBinaryOp >
static LogicalResult verifyArithmeticExtendedBinaryOp (ExtendedBinaryOp op)
 
static ParseResult parseArithmeticExtendedBinaryOp (OpAsmParser &parser, OperationState &result)
 
static void printArithmeticExtendedBinaryOp (Operation *op, OpAsmPrinter &printer)
 
static ParseResult parseAtomicUpdateOp (OpAsmParser &parser, OperationState &state, bool hasValue)
 
static void printAtomicUpdateOp (Operation *op, OpAsmPrinter &printer)
 
template<typename T >
static StringRef stringifyTypeName ()
 
template<>
StringRef stringifyTypeName< IntegerType > ()
 
template<>
StringRef stringifyTypeName< FloatType > ()
 
template<typename ExpectedElementType >
static LogicalResult verifyAtomicUpdateOp (Operation *op)
 
static ParseResult parseGroupNonUniformArithmeticOp (OpAsmParser &parser, OperationState &state)
 
static void printGroupNonUniformArithmeticOp (Operation *groupOp, OpAsmPrinter &printer)
 
static LogicalResult verifyGroupNonUniformArithmeticOp (Operation *groupOp)
 
static Type getUnaryOpResultType (Type operandType)
 Result of a logical op must be a scalar or vector of boolean type. More...
 
static LogicalResult verifyShiftOp (Operation *op)
 
static Type getElementPtrType (Type type, ValueRange indices, Location baseLoc)
 
template<typename Op >
static void printAccessChain (Op op, ValueRange indices, OpAsmPrinter &printer)
 
template<typename Op >
static LogicalResult verifyAccessChain (Op accessChainOp, ValueRange indices)
 
template<typename T >
static void printAtomicCompareExchangeImpl (T atomOp, OpAsmPrinter &printer)
 
static ParseResult parseAtomicCompareExchangeImpl (OpAsmParser &parser, OperationState &state)
 
template<typename T >
static LogicalResult verifyAtomicCompareExchangeImpl (T atomOp)
 
static LogicalResult verifyConstantType (spirv::ConstantOp op, Attribute value, Type opType)
 
template<typename OpTy >
static LogicalResult verifyGroupNonUniformShuffleOp (OpTy op)
 
static bool hasOneBranchOpTo (Block &srcBlock, Block &dstBlock)
 Returns true if the given srcBlock contains only one spirv.Branch to the given dstBlock. More...
 
static LogicalResult verifyPointerAndCoopMatrixType (Operation *op, Type pointer, Type coopMatrix)
 
static LogicalResult verifyCoopMatrixMulAdd (spirv::NVCooperativeMatrixMulAddOp op)
 
static LogicalResult verifyPointerAndJointMatrixType (Operation *op, Type pointer, Type jointMatrix)
 
static LogicalResult verifyJointMatrixMad (spirv::INTELJointMatrixMadOp op)
 
static ParseResult parsePtrAccessChainOpImpl (StringRef opName, OpAsmParser &parser, OperationState &state)
 
template<typename Op >
static auto concatElemAndIndices (Op op)
 
template<typename Op >
static LogicalResult verifyGroupOp (Op op)
 
static LogicalResult verifyIntegerDotProduct (Operation *op)
 
static std::optional< spirv::Version > getIntegerDotProductMinVersion ()
 
static std::optional< spirv::Version > getIntegerDotProductMaxVersion ()
 
static SmallVector< ArrayRef< spirv::Extension >, 1 > getIntegerDotProductExtensions ()
 
static SmallVector< ArrayRef< spirv::Capability >, 1 > getIntegerDotProductCapabilities (Operation *op)
 

Variables

constexpr char kAlignmentAttrName [] = "alignment"
 
constexpr char kBranchWeightAttrName [] = "branch_weights"
 
constexpr char kCallee [] = "callee"
 
constexpr char kClusterSize [] = "cluster_size"
 
constexpr char kControl [] = "control"
 
constexpr char kDefaultValueAttrName [] = "default_value"
 
constexpr char kEqualSemanticsAttrName [] = "equal_semantics"
 
constexpr char kExecutionScopeAttrName [] = "execution_scope"
 
constexpr char kFnNameAttrName [] = "fn"
 
constexpr char kGroupOperationAttrName [] = "group_operation"
 
constexpr char kIndicesAttrName [] = "indices"
 
constexpr char kInitializerAttrName [] = "initializer"
 
constexpr char kInterfaceAttrName [] = "interface"
 
constexpr char kMemoryAccessAttrName [] = "memory_access"
 
constexpr char kMemoryScopeAttrName [] = "memory_scope"
 
constexpr char kPackedVectorFormatAttrName [] = "format"
 
constexpr char kSemanticsAttrName [] = "semantics"
 
constexpr char kSourceAlignmentAttrName [] = "source_alignment"
 
constexpr char kSourceMemoryAccessAttrName [] = "source_memory_access"
 
constexpr char kSpecIdAttrName [] = "spec_id"
 
constexpr char kTypeAttrName [] = "type"
 
constexpr char kUnequalSemanticsAttrName [] = "unequal_semantics"
 
constexpr char kValueAttrName [] = "value"
 
constexpr char kValuesAttrName [] = "values"
 
constexpr char kCompositeSpecConstituentsName [] = "constituents"
 

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 5041 of file SPIRVOps.cpp.

◆ SPIRV_IMPL_INTEGER_DOT_PRODUCT_OP

#define SPIRV_IMPL_INTEGER_DOT_PRODUCT_OP (   OpName)
Value:
SmallVector<ArrayRef<spirv::Extension>, 1> OpName::getExtensions() { \
} \
SmallVector<ArrayRef<spirv::Capability>, 1> OpName::getCapabilities() { \
} \
std::optional<spirv::Version> OpName::getMinVersion() { \
} \
std::optional<spirv::Version> OpName::getMaxVersion() { \
}
static std::optional< spirv::Version > getIntegerDotProductMinVersion()
Definition: SPIRVOps.cpp:4961
static LogicalResult verifyIntegerDotProduct(Operation *op)
Definition: SPIRVOps.cpp:4906
static SmallVector< ArrayRef< spirv::Extension >, 1 > getIntegerDotProductExtensions()
Definition: SPIRVOps.cpp:4970
static SmallVector< ArrayRef< spirv::Capability >, 1 > getIntegerDotProductCapabilities(Operation *op)
Definition: SPIRVOps.cpp:4978
static std::optional< spirv::Version > getIntegerDotProductMaxVersion()
Definition: SPIRVOps.cpp:4965
LogicalResult verify(Operation *op, bool verifyRecursively=true)
Perform (potentially expensive) checks of invariants, used to detect compiler bugs,...
Definition: Verifier.cpp:374
This class represents an efficient way to signal success or failure.
Definition: LogicalResult.h:26

Definition at line 5012 of file SPIRVOps.cpp.

Function Documentation

◆ concatElemAndIndices()

template<typename Op >
static auto concatElemAndIndices ( Op  op)
static

Definition at line 4796 of file SPIRVOps.cpp.

◆ extractValueFromConstOp()

static LogicalResult extractValueFromConstOp ( Operation op,
int32_t &  value 
)
static

Definition at line 138 of file SPIRVOps.cpp.

Referenced by verifyGroupNonUniformArithmeticOp().

◆ getBitWidth()

static unsigned getBitWidth ( Type  type)
static

◆ getElementPtrType()

static Type getElementPtrType ( Type  type,
ValueRange  indices,
Location  baseLoc 
)
static

Definition at line 1013 of file SPIRVOps.cpp.

References mlir::emitError().

Referenced by parsePtrAccessChainOpImpl(), and verifyAccessChain().

◆ getElementType() [1/4]

static Type getElementType ( Type  type,
ArrayRef< int32_t >  indices,
function_ref< InFlightDiagnostic(StringRef)>  emitErrorFn 
)
static

Walks the given type hierarchy with the given indices, potentially down to component granularity, to select an element type.

Returns null type and emits errors with the given loc on failure.

Definition at line 699 of file SPIRVOps.cpp.

Referenced by mlir::convertMMAToLLVMType(), mlir::detail::DenseArrayAttrImpl< T >::get(), getCuSparseDataTypeFrom(), getElementType(), mlirComplexTypeGetElementType(), mlirPDLRangeTypeGetElementType(), mlirShapedTypeGetElementType(), and mlirUnrankedTensorTypeGetElementType().

◆ getElementType() [2/4]

static Type getElementType ( Type  type,
Attribute  indices,
function_ref< InFlightDiagnostic(StringRef)>  emitErrorFn 
)
static

Definition at line 725 of file SPIRVOps.cpp.

References getElementType().

◆ getElementType() [3/4]

static Type getElementType ( Type  type,
Attribute  indices,
Location  loc 
)
static

Definition at line 750 of file SPIRVOps.cpp.

References mlir::emitError(), and getElementType().

◆ getElementType() [4/4]

static Type getElementType ( Type  type,
Attribute  indices,
OpAsmParser parser,
SMLoc  loc 
)
static

Definition at line 757 of file SPIRVOps.cpp.

References mlir::AsmParser::emitError(), and getElementType().

◆ getIntegerDotProductCapabilities()

static SmallVector<ArrayRef<spirv::Capability>, 1> getIntegerDotProductCapabilities ( Operation op)
static

Definition at line 4978 of file SPIRVOps.cpp.

◆ getIntegerDotProductExtensions()

static SmallVector<ArrayRef<spirv::Extension>, 1> getIntegerDotProductExtensions ( )
static

Definition at line 4970 of file SPIRVOps.cpp.

◆ getIntegerDotProductMaxVersion()

static std::optional<spirv::Version> getIntegerDotProductMaxVersion ( )
static

Definition at line 4965 of file SPIRVOps.cpp.

◆ getIntegerDotProductMinVersion()

static std::optional<spirv::Version> getIntegerDotProductMinVersion ( )
static

Definition at line 4961 of file SPIRVOps.cpp.

◆ getStrArrayAttrForEnumList()

template<typename Ty >
static ArrayAttr getStrArrayAttrForEnumList ( Builder builder,
ArrayRef< Ty >  enumValues,
function_ref< StringRef(Ty)>  stringifyFn 
)
static

Definition at line 159 of file SPIRVOps.cpp.

References mlir::Builder::getStrArrayAttr().

◆ getUnaryOpResultType()

static Type getUnaryOpResultType ( Type  operandType)
static

Result of a logical op must be a scalar or vector of boolean type.

Definition at line 991 of file SPIRVOps.cpp.

References mlir::get(), mlir::Type::getContext(), and mlir::Builder::getIntegerType().

◆ hasOneBranchOpTo()

static bool hasOneBranchOpTo ( Block srcBlock,
Block dstBlock 
)
inlinestatic

Returns true if the given srcBlock contains only one spirv.Branch to the given dstBlock.

Definition at line 3272 of file SPIRVOps.cpp.

References mlir::Block::back().

◆ isDirectInModuleLikeOp()

static bool isDirectInModuleLikeOp ( Operation op)
static

Returns true if the given op is an module-like op that maintains a symbol table.

Definition at line 134 of file SPIRVOps.cpp.

◆ isMergeBlock()

static bool isMergeBlock ( Block block)
inlinestatic

Returns true if the given block only contains one spirv.mlir.merge op.

Definition at line 766 of file SPIRVOps.cpp.

References mlir::Block::begin(), mlir::Block::empty(), mlir::Block::end(), and mlir::Block::front().

◆ isNestedInFunctionOpInterface()

static bool isNestedInFunctionOpInterface ( Operation op)
static

Returns true if the given op is a function-like op or nested in a function-like op without a module-like op in the middle.

Definition at line 122 of file SPIRVOps.cpp.

◆ parseArithmeticExtendedBinaryOp()

static ParseResult parseArithmeticExtendedBinaryOp ( OpAsmParser parser,
OperationState result 
)
static

◆ parseAtomicCompareExchangeImpl()

static ParseResult parseAtomicCompareExchangeImpl ( OpAsmParser parser,
OperationState state 
)
static

◆ parseAtomicUpdateOp()

static ParseResult parseAtomicUpdateOp ( OpAsmParser parser,
OperationState state,
bool  hasValue 
)
static

◆ parseControlAttribute()

template<typename EnumAttrClass , typename EnumClass >
static ParseResult parseControlAttribute ( OpAsmParser parser,
OperationState state,
StringRef  attrName = spirv::attributeName<EnumClass>() 
)
static

Parses Function, Selection and Loop control attributes.

If no control is specified, "None" is used as a default.

Definition at line 231 of file SPIRVOps.cpp.

References mlir::OperationState::addAttribute(), mlir::failure(), mlir::Builder::getAttr(), mlir::AsmParser::getBuilder(), kControl, mlir::AsmParser::parseLParen(), mlir::AsmParser::parseOptionalKeyword(), mlir::AsmParser::parseRParen(), mlir::succeeded(), and mlir::success().

◆ parseEnumKeywordAttr()

template<typename EnumAttrClass , typename EnumClass = typename EnumAttrClass::ValueType>
static ParseResult parseEnumKeywordAttr ( EnumClass &  value,
OpAsmParser parser,
OperationState state,
StringRef  attrName = spirv::attributeName<EnumClass>() 
)
static

Parses the next keyword in parser as an enumerant of the given EnumClass and inserts the enumerant into state as an 32-bit integer attribute with the enum class's name as attribute name.

Definition at line 217 of file SPIRVOps.cpp.

References mlir::OperationState::addAttribute(), mlir::failure(), mlir::Builder::getAttr(), mlir::AsmParser::getBuilder(), mlir::parseEnumKeywordAttr(), and mlir::success().

◆ parseEnumStrAttr() [1/2]

template<typename EnumAttrClass , typename EnumClass = typename EnumAttrClass::ValueType>
static ParseResult parseEnumStrAttr ( EnumClass &  value,
OpAsmParser parser,
OperationState state,
StringRef  attrName = spirv::attributeName<EnumClass>() 
)
static

Parses the next string attribute in parser as an enumerant of the given EnumClass and inserts the enumerant into state as an 32-bit integer attribute with the enum class's name as attribute name.

Definition at line 202 of file SPIRVOps.cpp.

References mlir::OperationState::addAttribute(), mlir::failure(), mlir::Builder::getAttr(), mlir::AsmParser::getBuilder(), parseEnumStrAttr(), and mlir::success().

◆ parseEnumStrAttr() [2/2]

template<typename EnumClass >
static ParseResult parseEnumStrAttr ( EnumClass &  value,
OpAsmParser parser,
StringRef  attrName = spirv::attributeName<EnumClass>() 
)
static

Parses the next string attribute in parser as an enumerant of the given EnumClass.

Definition at line 176 of file SPIRVOps.cpp.

References mlir::AsmParser::emitError(), mlir::failure(), mlir::AsmParser::getBuilder(), mlir::AsmParser::getCurrentLocation(), mlir::Builder::getNoneType(), mlir::AsmParser::parseAttribute(), and mlir::success().

Referenced by parseEnumStrAttr(), and parseImageOperands().

◆ parseGroupNonUniformArithmeticOp()

static ParseResult parseGroupNonUniformArithmeticOp ( OpAsmParser parser,
OperationState state 
)
static

◆ parseImageOperands()

static ParseResult parseImageOperands ( OpAsmParser parser,
spirv::ImageOperandsAttr &  attr 
)
static

◆ parseMemoryAccessAttributes()

static ParseResult parseMemoryAccessAttributes ( OpAsmParser parser,
OperationState state 
)
static

Parses optional memory access attributes attached to a memory access operand/pointer.

Specifically, parses the following syntax: ([ memory-access ])? where: memory-access ::= "None" | "Volatile" | "Aligned", integer-literal | "NonTemporal"

Definition at line 254 of file SPIRVOps.cpp.

References mlir::OperationState::attributes, mlir::failure(), mlir::AsmParser::getBuilder(), mlir::Builder::getIntegerType(), kAlignmentAttrName, kMemoryAccessAttrName, mlir::AsmParser::parseAttribute(), mlir::AsmParser::parseComma(), mlir::AsmParser::parseOptionalLSquare(), mlir::AsmParser::parseRSquare(), and mlir::success().

◆ parseOneResultSameOperandTypeOp()

static ParseResult parseOneResultSameOperandTypeOp ( OpAsmParser parser,
OperationState result 
)
static

◆ parsePtrAccessChainOpImpl()

static ParseResult parsePtrAccessChainOpImpl ( StringRef  opName,
OpAsmParser parser,
OperationState state 
)
static

◆ parseSourceMemoryAccessAttributes()

static ParseResult parseSourceMemoryAccessAttributes ( OpAsmParser parser,
OperationState state 
)
static

◆ parseVariableDecorations()

static ParseResult parseVariableDecorations ( OpAsmParser parser,
OperationState state 
)
static

◆ printAccessChain()

template<typename Op >
static void printAccessChain ( Op  op,
ValueRange  indices,
OpAsmPrinter printer 
)
static

Definition at line 1121 of file SPIRVOps.cpp.

◆ printArithmeticExtendedBinaryOp()

static void printArithmeticExtendedBinaryOp ( Operation op,
OpAsmPrinter printer 
)
static

Definition at line 810 of file SPIRVOps.cpp.

◆ printAtomicCompareExchangeImpl()

template<typename T >
static void printAtomicCompareExchangeImpl ( atomOp,
OpAsmPrinter printer 
)
static

Definition at line 1179 of file SPIRVOps.cpp.

◆ printAtomicUpdateOp()

static void printAtomicUpdateOp ( Operation op,
OpAsmPrinter printer 
)
static

Definition at line 855 of file SPIRVOps.cpp.

◆ printGroupNonUniformArithmeticOp()

static void printGroupNonUniformArithmeticOp ( Operation groupOp,
OpAsmPrinter printer 
)
static

◆ printImageOperands()

static void printImageOperands ( OpAsmPrinter printer,
Operation imageOp,
spirv::ImageOperandsAttr  attr 
)
static

Definition at line 386 of file SPIRVOps.cpp.

◆ printMemoryAccessAttribute()

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 
)
static

Definition at line 313 of file SPIRVOps.cpp.

References kAlignmentAttrName, and kMemoryAccessAttrName.

◆ printOneResultOp()

static void printOneResultOp ( Operation op,
OpAsmPrinter p 
)
static

Definition at line 101 of file SPIRVOps.cpp.

◆ printSourceMemoryAccessAttribute()

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 
)
static

Definition at line 343 of file SPIRVOps.cpp.

References kSourceAlignmentAttrName, and kSourceMemoryAccessAttrName.

◆ printVariableDecorations()

static void printVariableDecorations ( Operation op,
OpAsmPrinter printer,
SmallVectorImpl< StringRef > &  elidedAttrs 
)
static

Definition at line 649 of file SPIRVOps.cpp.

◆ stringifyTypeName()

template<typename T >
static StringRef stringifyTypeName ( )
static

◆ stringifyTypeName< FloatType >()

template<>
StringRef stringifyTypeName< FloatType > ( )

Definition at line 874 of file SPIRVOps.cpp.

◆ stringifyTypeName< IntegerType >()

template<>
StringRef stringifyTypeName< IntegerType > ( )

Definition at line 869 of file SPIRVOps.cpp.

◆ verifyAccessChain()

template<typename Op >
static LogicalResult verifyAccessChain ( Op  accessChainOp,
ValueRange  indices 
)
static

◆ verifyArithmeticExtendedBinaryOp()

template<typename ExtendedBinaryOp >
static LogicalResult verifyArithmeticExtendedBinaryOp ( ExtendedBinaryOp  op)
static

Definition at line 772 of file SPIRVOps.cpp.

◆ verifyAtomicCompareExchangeImpl()

template<typename T >
static LogicalResult verifyAtomicCompareExchangeImpl ( atomOp)
static

Definition at line 1219 of file SPIRVOps.cpp.

References mlir::success().

◆ verifyAtomicUpdateOp()

template<typename ExpectedElementType >
static LogicalResult verifyAtomicUpdateOp ( Operation op)
static

Definition at line 880 of file SPIRVOps.cpp.

◆ verifyBlockReadWritePtrAndValTypes()

template<typename BlockReadWriteOpTy >
static LogicalResult verifyBlockReadWritePtrAndValTypes ( BlockReadWriteOpTy  op,
Value  ptr,
Value  val 
)
static

Definition at line 599 of file SPIRVOps.cpp.

◆ verifyCastOp()

static LogicalResult verifyCastOp ( Operation op,
bool  requireSameBitWidth = true,
bool  skipBitWidthCheck = false 
)
static

Definition at line 422 of file SPIRVOps.cpp.

◆ verifyConstantType()

static LogicalResult verifyConstantType ( spirv::ConstantOp  op,
Attribute  value,
Type  opType 
)
static

Definition at line 2007 of file SPIRVOps.cpp.

◆ verifyCoopMatrixMulAdd()

static LogicalResult verifyCoopMatrixMulAdd ( spirv::NVCooperativeMatrixMulAddOp  op)
static

Definition at line 4126 of file SPIRVOps.cpp.

◆ verifyGroupNonUniformArithmeticOp()

static LogicalResult verifyGroupNonUniformArithmeticOp ( Operation groupOp)
static

◆ verifyGroupNonUniformShuffleOp()

template<typename OpTy >
static LogicalResult verifyGroupNonUniformShuffleOp ( OpTy  op)
static

Definition at line 2847 of file SPIRVOps.cpp.

◆ verifyGroupOp()

template<typename Op >
static LogicalResult verifyGroupOp ( Op  op)
static

Definition at line 4874 of file SPIRVOps.cpp.

◆ verifyImageOperands()

template<typename Op >
static LogicalResult verifyImageOperands ( Op  imageOp,
spirv::ImageOperandsAttr  attr,
Operation::operand_range  operands 
)
static

Definition at line 395 of file SPIRVOps.cpp.

References mlir::OpState::emitError(), and mlir::success().

◆ verifyIntegerDotProduct()

static LogicalResult verifyIntegerDotProduct ( Operation op)
static

Definition at line 4906 of file SPIRVOps.cpp.

◆ verifyJointMatrixMad()

static LogicalResult verifyJointMatrixMad ( spirv::INTELJointMatrixMadOp  op)
static

Definition at line 4204 of file SPIRVOps.cpp.

◆ verifyLoadStorePtrAndValTypes()

template<typename LoadStoreOpTy >
static LogicalResult verifyLoadStorePtrAndValTypes ( LoadStoreOpTy  op,
Value  ptr,
Value  val 
)
static

Definition at line 584 of file SPIRVOps.cpp.

◆ verifyMemoryAccessAttribute()

template<typename MemoryOpTy >
static LogicalResult verifyMemoryAccessAttribute ( MemoryOpTy  memoryOp)
static

Definition at line 476 of file SPIRVOps.cpp.

◆ verifyMemorySemantics()

static LogicalResult verifyMemorySemantics ( Operation op,
spirv::MemorySemantics  memorySemantics 
)
static

Definition at line 560 of file SPIRVOps.cpp.

◆ verifyPointerAndCoopMatrixType()

static LogicalResult verifyPointerAndCoopMatrixType ( Operation op,
Type  pointer,
Type  coopMatrix 
)
static

Definition at line 4056 of file SPIRVOps.cpp.

◆ verifyPointerAndJointMatrixType()

static LogicalResult verifyPointerAndJointMatrixType ( Operation op,
Type  pointer,
Type  jointMatrix 
)
static

Definition at line 4163 of file SPIRVOps.cpp.

◆ verifyShiftOp()

static LogicalResult verifyShiftOp ( Operation op)
static

Definition at line 999 of file SPIRVOps.cpp.

◆ verifySourceMemoryAccessAttribute()

template<typename MemoryOpTy >
static LogicalResult verifySourceMemoryAccessAttribute ( MemoryOpTy  memoryOp)
static

Definition at line 520 of file SPIRVOps.cpp.

Variable Documentation

◆ kAlignmentAttrName

constexpr char kAlignmentAttrName[] = "alignment"
constexpr

Definition at line 42 of file SPIRVOps.cpp.

Referenced by parseMemoryAccessAttributes(), and printMemoryAccessAttribute().

◆ kBranchWeightAttrName

constexpr char kBranchWeightAttrName[] = "branch_weights"
constexpr

Definition at line 43 of file SPIRVOps.cpp.

◆ kCallee

constexpr char kCallee[] = "callee"
constexpr

Definition at line 44 of file SPIRVOps.cpp.

◆ kClusterSize

constexpr char kClusterSize[] = "cluster_size"
constexpr

◆ kCompositeSpecConstituentsName

constexpr char kCompositeSpecConstituentsName[] = "constituents"
constexpr

Definition at line 66 of file SPIRVOps.cpp.

◆ kControl

constexpr char kControl[] = "control"
constexpr

Definition at line 46 of file SPIRVOps.cpp.

Referenced by parseControlAttribute().

◆ kDefaultValueAttrName

constexpr char kDefaultValueAttrName[] = "default_value"
constexpr

Definition at line 47 of file SPIRVOps.cpp.

◆ kEqualSemanticsAttrName

constexpr char kEqualSemanticsAttrName[] = "equal_semantics"
constexpr

Definition at line 48 of file SPIRVOps.cpp.

Referenced by parseAtomicCompareExchangeImpl().

◆ kExecutionScopeAttrName

constexpr char kExecutionScopeAttrName[] = "execution_scope"
constexpr

◆ kFnNameAttrName

constexpr char kFnNameAttrName[] = "fn"
constexpr

Definition at line 50 of file SPIRVOps.cpp.

◆ kGroupOperationAttrName

constexpr char kGroupOperationAttrName[] = "group_operation"
constexpr

◆ kIndicesAttrName

constexpr char kIndicesAttrName[] = "indices"
constexpr

Definition at line 52 of file SPIRVOps.cpp.

◆ kInitializerAttrName

constexpr char kInitializerAttrName[] = "initializer"
constexpr

Definition at line 53 of file SPIRVOps.cpp.

◆ kInterfaceAttrName

constexpr char kInterfaceAttrName[] = "interface"
constexpr

Definition at line 54 of file SPIRVOps.cpp.

◆ kMemoryAccessAttrName

constexpr char kMemoryAccessAttrName[] = "memory_access"
constexpr

Definition at line 55 of file SPIRVOps.cpp.

Referenced by parseMemoryAccessAttributes(), and printMemoryAccessAttribute().

◆ kMemoryScopeAttrName

constexpr char kMemoryScopeAttrName[] = "memory_scope"
constexpr

Definition at line 56 of file SPIRVOps.cpp.

Referenced by parseAtomicCompareExchangeImpl(), and parseAtomicUpdateOp().

◆ kPackedVectorFormatAttrName

constexpr char kPackedVectorFormatAttrName[] = "format"
constexpr

Definition at line 57 of file SPIRVOps.cpp.

◆ kSemanticsAttrName

constexpr char kSemanticsAttrName[] = "semantics"
constexpr

Definition at line 58 of file SPIRVOps.cpp.

Referenced by parseAtomicUpdateOp().

◆ kSourceAlignmentAttrName

constexpr char kSourceAlignmentAttrName[] = "source_alignment"
constexpr

◆ kSourceMemoryAccessAttrName

constexpr char kSourceMemoryAccessAttrName[] = "source_memory_access"
constexpr

◆ kSpecIdAttrName

constexpr char kSpecIdAttrName[] = "spec_id"
constexpr

Definition at line 61 of file SPIRVOps.cpp.

◆ kTypeAttrName

constexpr char kTypeAttrName[] = "type"
constexpr

Definition at line 62 of file SPIRVOps.cpp.

◆ kUnequalSemanticsAttrName

constexpr char kUnequalSemanticsAttrName[] = "unequal_semantics"
constexpr

Definition at line 63 of file SPIRVOps.cpp.

Referenced by parseAtomicCompareExchangeImpl().

◆ kValueAttrName

constexpr char kValueAttrName[] = "value"
constexpr

Definition at line 64 of file SPIRVOps.cpp.

◆ kValuesAttrName

constexpr char kValuesAttrName[] = "values"
constexpr

Definition at line 65 of file SPIRVOps.cpp.