MLIR  19.0.0git
Functions
SPIRVOps.cpp File Reference
#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 "mlir/Support/LogicalResult.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>

Go to the source code of this file.

Functions

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)
 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)
 
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)
 
static LogicalResult verifyConstantType (spirv::ConstantOp op, Attribute value, Type opType)
 

Function Documentation

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

Referenced by mlir::convertMMAToLLVMType(), mlir::detail::DenseArrayAttrImpl< T >::get(), mlir::sparse_tensor::SparseTensorType::getCOOType(), 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 242 of file SPIRVOps.cpp.

References getElementType().

◆ getElementType() [3/4]

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

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

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

◆ parseArithmeticExtendedBinaryOp()

static ParseResult parseArithmeticExtendedBinaryOp ( OpAsmParser parser,
OperationState result 
)
static

◆ parseOneResultSameOperandTypeOp()

static ParseResult parseOneResultSameOperandTypeOp ( OpAsmParser parser,
OperationState result 
)
static

◆ printArithmeticExtendedBinaryOp()

static void printArithmeticExtendedBinaryOp ( Operation op,
OpAsmPrinter printer 
)
static

Definition at line 321 of file SPIRVOps.cpp.

◆ printOneResultOp()

static void printOneResultOp ( Operation op,
OpAsmPrinter p 
)
static

Definition at line 151 of file SPIRVOps.cpp.

◆ verifyArithmeticExtendedBinaryOp()

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

Definition at line 283 of file SPIRVOps.cpp.

◆ verifyBlockReadWritePtrAndValTypes()

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

Definition at line 199 of file SPIRVOps.cpp.

◆ verifyConstantType()

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

Definition at line 587 of file SPIRVOps.cpp.

◆ verifyImageOperands()

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

Definition at line 171 of file SPIRVOps.cpp.

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

◆ verifyShiftOp()

static LogicalResult verifyShiftOp ( Operation op)
static

Definition at line 329 of file SPIRVOps.cpp.