MLIR  16.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"
+ Include dependency graph for SPIRVOps.cpp:

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 
 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, Optional< spirv::MemoryAccess > memoryAccessAtrrValue=std::nullopt, Optional< uint32_t > alignmentAttrValue=std::nullopt)
 
template<typename MemoryOpTy >
static void printSourceMemoryAccessAttribute (MemoryOpTy memoryOp, OpAsmPrinter &printer, SmallVectorImpl< StringRef > &elidedAttrs, Optional< spirv::MemoryAccess > memoryAccessAtrrValue=std::nullopt, 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 void buildLogicalBinaryOp (OpBuilder &builder, OperationState &state, Value lhs, Value rhs)
 
static void buildLogicalUnaryOp (OpBuilder &builder, OperationState &state, Value value)
 
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 Optional< spirv::Version > getIntegerDotProductMinVersion ()
 
static 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 4935 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() { \
} \
Optional<spirv::Version> OpName::getMinVersion() { \
} \
Optional<spirv::Version> OpName::getMaxVersion() { \
}
static Optional< spirv::Version > getIntegerDotProductMaxVersion()
Definition: SPIRVOps.cpp:4859
static Optional< spirv::Version > getIntegerDotProductMinVersion()
Definition: SPIRVOps.cpp:4855
static LogicalResult verifyIntegerDotProduct(Operation *op)
Definition: SPIRVOps.cpp:4800
static SmallVector< ArrayRef< spirv::Extension >, 1 > getIntegerDotProductExtensions()
Definition: SPIRVOps.cpp:4864
static SmallVector< ArrayRef< spirv::Capability >, 1 > getIntegerDotProductCapabilities(Operation *op)
Definition: SPIRVOps.cpp:4872
LogicalResult verify(Operation *op, bool verifyRecursively=true)
Perform (potentially expensive) checks of invariants, used to detect compiler bugs,...
Definition: Verifier.cpp:372
This class represents an efficient way to signal success or failure.
Definition: LogicalResult.h:26

Definition at line 4906 of file SPIRVOps.cpp.

Function Documentation

◆ buildLogicalBinaryOp()

static void buildLogicalBinaryOp ( OpBuilder builder,
OperationState state,
Value  lhs,
Value  rhs 
)
static

Definition at line 1008 of file SPIRVOps.cpp.

◆ buildLogicalUnaryOp()

static void buildLogicalUnaryOp ( OpBuilder builder,
OperationState state,
Value  value 
)
static

◆ concatElemAndIndices()

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

Definition at line 4690 of file SPIRVOps.cpp.

References copy().

◆ extractValueFromConstOp()

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

Definition at line 138 of file SPIRVOps.cpp.

References mlir::failure(), mlir::success(), and value.

Referenced by getElementPtrType(), and verifyGroupNonUniformArithmeticOp().

◆ getBitWidth()

static unsigned getBitWidth ( Type  type)
static

◆ getElementPtrType()

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

◆ getElementType() [1/4]

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

◆ getElementType() [2/4]

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

Definition at line 724 of file SPIRVOps.cpp.

References mlir::Attribute::dyn_cast(), and getElementType().

◆ getElementType() [3/4]

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

Definition at line 749 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 756 of file SPIRVOps.cpp.

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

◆ getIntegerDotProductCapabilities()

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

◆ getIntegerDotProductExtensions()

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

Definition at line 4864 of file SPIRVOps.cpp.

◆ getIntegerDotProductMaxVersion()

static Optional<spirv::Version> getIntegerDotProductMaxVersion ( )
static

Definition at line 4859 of file SPIRVOps.cpp.

◆ getIntegerDotProductMinVersion()

static Optional<spirv::Version> getIntegerDotProductMinVersion ( )
static

Definition at line 4855 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 990 of file SPIRVOps.cpp.

References mlir::Type::dyn_cast(), 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 3193 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.

References mlir::Operation::hasTrait().

◆ isMergeBlock()

static bool isMergeBlock ( Block block)
inlinestatic

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

Definition at line 765 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.

References mlir::Operation::getParentOp(), and mlir::Operation::hasTrait().

◆ 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(), mlir::success(), and value.

◆ 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(), mlir::success(), and value.

◆ parseEnumStrAttr() [2/2]

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

◆ 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 1142 of file SPIRVOps.cpp.

References mlir::ValueRange::getTypes().

◆ printArithmeticExtendedBinaryOp()

static void printArithmeticExtendedBinaryOp ( Operation op,
OpAsmPrinter printer 
)
static

◆ printAtomicCompareExchangeImpl()

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

Definition at line 1200 of file SPIRVOps.cpp.

◆ printAtomicUpdateOp()

static void printAtomicUpdateOp ( Operation op,
OpAsmPrinter printer 
)
static

◆ 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,
Optional< spirv::MemoryAccess >  memoryAccessAtrrValue = std::nullopt,
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

◆ printSourceMemoryAccessAttribute()

template<typename MemoryOpTy >
static void printSourceMemoryAccessAttribute ( MemoryOpTy  memoryOp,
OpAsmPrinter printer,
SmallVectorImpl< StringRef > &  elidedAttrs,
Optional< spirv::MemoryAccess >  memoryAccessAtrrValue = std::nullopt,
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

◆ stringifyTypeName()

template<typename T >
static StringRef stringifyTypeName ( )
static

◆ stringifyTypeName< FloatType >()

template<>
StringRef stringifyTypeName< FloatType > ( )

Definition at line 873 of file SPIRVOps.cpp.

◆ stringifyTypeName< IntegerType >()

template<>
StringRef stringifyTypeName< IntegerType > ( )

Definition at line 868 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 771 of file SPIRVOps.cpp.

References mlir::success().

◆ verifyAtomicCompareExchangeImpl()

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

Definition at line 1240 of file SPIRVOps.cpp.

References mlir::success().

◆ verifyAtomicUpdateOp()

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

◆ verifyBlockReadWritePtrAndValTypes()

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

◆ verifyCastOp()

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

◆ verifyConstantType()

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

◆ verifyCoopMatrixMulAdd()

static LogicalResult verifyCoopMatrixMulAdd ( spirv::NVCooperativeMatrixMulAddOp  op)
static

◆ verifyGroupNonUniformArithmeticOp()

static LogicalResult verifyGroupNonUniformArithmeticOp ( Operation groupOp)
static

◆ verifyGroupNonUniformShuffleOp()

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

Definition at line 2768 of file SPIRVOps.cpp.

References mlir::success().

◆ verifyGroupOp()

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

Definition at line 4768 of file SPIRVOps.cpp.

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

◆ 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

◆ verifyJointMatrixMad()

static LogicalResult verifyJointMatrixMad ( spirv::INTELJointMatrixMadOp  op)
static

◆ verifyLoadStorePtrAndValTypes()

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

◆ verifyMemoryAccessAttribute()

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

Definition at line 476 of file SPIRVOps.cpp.

References kAlignmentAttrName, kMemoryAccessAttrName, and mlir::success().

◆ verifyMemorySemantics()

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

Definition at line 560 of file SPIRVOps.cpp.

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

Referenced by verifyAtomicUpdateOp().

◆ verifyPointerAndCoopMatrixType()

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

◆ verifyPointerAndJointMatrixType()

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

◆ verifyShiftOp()

static LogicalResult verifyShiftOp ( Operation op)
static

◆ verifySourceMemoryAccessAttribute()

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

Variable Documentation

◆ kAlignmentAttrName

constexpr char kAlignmentAttrName[] = "alignment"
constexpr

◆ 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

◆ kMemoryScopeAttrName

constexpr char kMemoryScopeAttrName[] = "memory_scope"
constexpr

◆ kPackedVectorFormatAttrName

constexpr char kPackedVectorFormatAttrName[] = "format"
constexpr

Definition at line 57 of file SPIRVOps.cpp.

Referenced by getIntegerDotProductCapabilities(), and verifyIntegerDotProduct().

◆ kSemanticsAttrName

constexpr char kSemanticsAttrName[] = "semantics"
constexpr

Definition at line 58 of file SPIRVOps.cpp.

Referenced by parseAtomicUpdateOp(), printAtomicUpdateOp(), and verifyAtomicUpdateOp().

◆ 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.