#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "SPIRVOpUtils.h"
#include "SPIRVParsingUtils.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/Matchers.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Interfaces/FunctionImplementation.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/ADT/TypeSwitch.h"
#include <cassert>
#include <numeric>
#include <optional>
#include <type_traits>
usingnamespacemlir;
usingnamespacemlir::spirv::AttrNames;
LogicalResult spirv::extractValueFromConstOp(Operation *op, int32_t &value) { … }
LogicalResult
spirv::verifyMemorySemantics(Operation *op,
spirv::MemorySemantics memorySemantics) { … }
void spirv::printVariableDecorations(Operation *op, OpAsmPrinter &printer,
SmallVectorImpl<StringRef> &elidedAttrs) { … }
static ParseResult parseOneResultSameOperandTypeOp(OpAsmParser &parser,
OperationState &result) { … }
static void printOneResultOp(Operation *op, OpAsmPrinter &p) { … }
template <typename Op>
static LogicalResult verifyImageOperands(Op imageOp,
spirv::ImageOperandsAttr attr,
Operation::operand_range operands) { … }
template <typename BlockReadWriteOpTy>
static LogicalResult verifyBlockReadWritePtrAndValTypes(BlockReadWriteOpTy op,
Value ptr, Value val) { … }
static Type
getElementType(Type type, ArrayRef<int32_t> indices,
function_ref<InFlightDiagnostic(StringRef)> emitErrorFn) { … }
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) { … }
template <typename ExtendedBinaryOp>
static LogicalResult verifyArithmeticExtendedBinaryOp(ExtendedBinaryOp op) { … }
static ParseResult parseArithmeticExtendedBinaryOp(OpAsmParser &parser,
OperationState &result) { … }
static void printArithmeticExtendedBinaryOp(Operation *op,
OpAsmPrinter &printer) { … }
static LogicalResult verifyShiftOp(Operation *op) { … }
void spirv::AddressOfOp::build(OpBuilder &builder, OperationState &state,
spirv::GlobalVariableOp var) { … }
LogicalResult spirv::AddressOfOp::verify() { … }
LogicalResult spirv::CompositeConstructOp::verify() { … }
void spirv::CompositeExtractOp::build(OpBuilder &builder, OperationState &state,
Value composite,
ArrayRef<int32_t> indices) { … }
ParseResult spirv::CompositeExtractOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::CompositeExtractOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::CompositeExtractOp::verify() { … }
void spirv::CompositeInsertOp::build(OpBuilder &builder, OperationState &state,
Value object, Value composite,
ArrayRef<int32_t> indices) { … }
ParseResult spirv::CompositeInsertOp::parse(OpAsmParser &parser,
OperationState &result) { … }
LogicalResult spirv::CompositeInsertOp::verify() { … }
void spirv::CompositeInsertOp::print(OpAsmPrinter &printer) { … }
ParseResult spirv::ConstantOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::ConstantOp::print(OpAsmPrinter &printer) { … }
static LogicalResult verifyConstantType(spirv::ConstantOp op, Attribute value,
Type opType) { … }
LogicalResult spirv::ConstantOp::verify() { … }
bool spirv::ConstantOp::isBuildableWith(Type type) { … }
spirv::ConstantOp spirv::ConstantOp::getZero(Type type, Location loc,
OpBuilder &builder) { … }
spirv::ConstantOp spirv::ConstantOp::getOne(Type type, Location loc,
OpBuilder &builder) { … }
void mlir::spirv::ConstantOp::getAsmResultNames(
llvm::function_ref<void(mlir::Value, llvm::StringRef)> setNameFn) { … }
void mlir::spirv::AddressOfOp::getAsmResultNames(
llvm::function_ref<void(mlir::Value, llvm::StringRef)> setNameFn) { … }
LogicalResult spirv::ControlBarrierOp::verify() { … }
void spirv::EntryPointOp::build(OpBuilder &builder, OperationState &state,
spirv::ExecutionModel executionModel,
spirv::FuncOp function,
ArrayRef<Attribute> interfaceVars) { … }
ParseResult spirv::EntryPointOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::EntryPointOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::EntryPointOp::verify() { … }
void spirv::ExecutionModeOp::build(OpBuilder &builder, OperationState &state,
spirv::FuncOp function,
spirv::ExecutionMode executionMode,
ArrayRef<int32_t> params) { … }
ParseResult spirv::ExecutionModeOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::ExecutionModeOp::print(OpAsmPrinter &printer) { … }
ParseResult spirv::FuncOp::parse(OpAsmParser &parser, OperationState &result) { … }
void spirv::FuncOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::FuncOp::verifyType() { … }
LogicalResult spirv::FuncOp::verifyBody() { … }
void spirv::FuncOp::build(OpBuilder &builder, OperationState &state,
StringRef name, FunctionType type,
spirv::FunctionControl control,
ArrayRef<NamedAttribute> attrs) { … }
ParseResult spirv::GLFClampOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::GLFClampOp::print(OpAsmPrinter &p) { … }
ParseResult spirv::GLUClampOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::GLUClampOp::print(OpAsmPrinter &p) { … }
ParseResult spirv::GLSClampOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::GLSClampOp::print(OpAsmPrinter &p) { … }
ParseResult spirv::GLFmaOp::parse(OpAsmParser &parser, OperationState &result) { … }
void spirv::GLFmaOp::print(OpAsmPrinter &p) { … }
void spirv::GlobalVariableOp::build(OpBuilder &builder, OperationState &state,
Type type, StringRef name,
unsigned descriptorSet, unsigned binding) { … }
void spirv::GlobalVariableOp::build(OpBuilder &builder, OperationState &state,
Type type, StringRef name,
spirv::BuiltIn builtin) { … }
ParseResult spirv::GlobalVariableOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::GlobalVariableOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::GlobalVariableOp::verify() { … }
ParseResult spirv::INTELSubgroupBlockReadOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::INTELSubgroupBlockReadOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::INTELSubgroupBlockReadOp::verify() { … }
ParseResult spirv::INTELSubgroupBlockWriteOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::INTELSubgroupBlockWriteOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::INTELSubgroupBlockWriteOp::verify() { … }
LogicalResult spirv::IAddCarryOp::verify() { … }
ParseResult spirv::IAddCarryOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::IAddCarryOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::ISubBorrowOp::verify() { … }
ParseResult spirv::ISubBorrowOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::ISubBorrowOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::SMulExtendedOp::verify() { … }
ParseResult spirv::SMulExtendedOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::SMulExtendedOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::UMulExtendedOp::verify() { … }
ParseResult spirv::UMulExtendedOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::UMulExtendedOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::MemoryBarrierOp::verify() { … }
void spirv::ModuleOp::build(OpBuilder &builder, OperationState &state,
std::optional<StringRef> name) { … }
void spirv::ModuleOp::build(OpBuilder &builder, OperationState &state,
spirv::AddressingModel addressingModel,
spirv::MemoryModel memoryModel,
std::optional<VerCapExtAttr> vceTriple,
std::optional<StringRef> name) { … }
ParseResult spirv::ModuleOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::ModuleOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::ModuleOp::verifyRegions() { … }
LogicalResult spirv::ReferenceOfOp::verify() { … }
ParseResult spirv::SpecConstantOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::SpecConstantOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::SpecConstantOp::verify() { … }
LogicalResult spirv::VectorShuffleOp::verify() { … }
LogicalResult spirv::MatrixTimesScalarOp::verify() { … }
LogicalResult spirv::TransposeOp::verify() { … }
LogicalResult spirv::MatrixTimesMatrixOp::verify() { … }
ParseResult spirv::SpecConstantCompositeOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::SpecConstantCompositeOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::SpecConstantCompositeOp::verify() { … }
ParseResult spirv::SpecConstantOperationOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void spirv::SpecConstantOperationOp::print(OpAsmPrinter &printer) { … }
LogicalResult spirv::SpecConstantOperationOp::verifyRegions() { … }
LogicalResult spirv::GLFrexpStructOp::verify() { … }
LogicalResult spirv::GLLdexpOp::verify() { … }
LogicalResult spirv::ImageDrefGatherOp::verify() { … }
LogicalResult spirv::ShiftLeftLogicalOp::verify() { … }
LogicalResult spirv::ShiftRightArithmeticOp::verify() { … }
LogicalResult spirv::ShiftRightLogicalOp::verify() { … }
LogicalResult spirv::ImageQuerySizeOp::verify() { … }
LogicalResult spirv::VectorTimesScalarOp::verify() { … }