MLIR  15.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::spirv::SPIRVType Class Reference

#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"

+ Inheritance diagram for mlir::spirv::SPIRVType:
+ Collaboration diagram for mlir::spirv::SPIRVType:

Public Types

using ExtensionArrayRefVector = SmallVectorImpl< ArrayRef< Extension > >
 The extension requirements for each type are following the ((Extension::A OR Extension::B) AND (Extension::C OR Extension::D)) convention. More...
 
using CapabilityArrayRefVector = SmallVectorImpl< ArrayRef< Capability > >
 The capability requirements for each type are following the ((Capability::A OR Extension::B) AND (Capability::C OR Capability::D)) convention. More...
 
- Public Types inherited from mlir::Type
template<typename ConcreteType , typename BaseType , typename StorageType , template< typename T > class... Traits>
using TypeBase = detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits... >
 Utility class for implementing types. More...
 
using ImplType = TypeStorage
 
using AbstractTy = AbstractType
 

Public Member Functions

bool isScalarOrVector ()
 
void getExtensions (ExtensionArrayRefVector &extensions, Optional< StorageClass > storage=llvm::None)
 Appends to extensions the extensions needed for this type to appear in the given storage class. More...
 
void getCapabilities (CapabilityArrayRefVector &capabilities, Optional< StorageClass > storage=llvm::None)
 Appends to capabilities the capabilities needed for this type to appear in the given storage class. More...
 
Optional< int64_t > getSizeInBytes ()
 Returns the size in bytes for each type. More...
 
- Public Member Functions inherited from mlir::Type
constexpr Type ()
 
 Type (const ImplType *impl)
 
 Type (const Type &other)=default
 
Typeoperator= (const Type &other)=default
 
bool operator== (Type other) const
 
bool operator!= (Type other) const
 
 operator bool () const
 
bool operator! () const
 
template<typename U >
bool isa () const
 
template<typename First , typename Second , typename... Rest>
bool isa () const
 
template<typename U >
dyn_cast () const
 
template<typename U >
dyn_cast_or_null () const
 
template<typename U >
cast () const
 
TypeID getTypeID ()
 Return a unique identifier for the concrete type. More...
 
MLIRContextgetContext () const
 Return the MLIRContext in which this type was uniqued. More...
 
DialectgetDialect () const
 Get the dialect this type is registered to. More...
 
bool isIndex () const
 
bool isBF16 () const
 
bool isF16 () const
 
bool isF32 () const
 
bool isF64 () const
 
bool isF80 () const
 
bool isF128 () const
 
bool isInteger (unsigned width) const
 Return true if this is an integer type with the specified width. More...
 
bool isSignlessInteger () const
 Return true if this is a signless integer type (with the specified width). More...
 
bool isSignlessInteger (unsigned width) const
 
bool isSignedInteger () const
 Return true if this is a signed integer type (with the specified width). More...
 
bool isSignedInteger (unsigned width) const
 
bool isUnsignedInteger () const
 Return true if this is an unsigned integer type (with the specified width). More...
 
bool isUnsignedInteger (unsigned width) const
 
unsigned getIntOrFloatBitWidth () const
 Return the bit width of an integer or a float type, assert failure on other types. More...
 
bool isSignlessIntOrIndex () const
 Return true if this is a signless integer or index type. More...
 
bool isSignlessIntOrIndexOrFloat () const
 Return true if this is a signless integer, index, or float type. More...
 
bool isSignlessIntOrFloat () const
 Return true of this is a signless integer or a float type. More...
 
bool isIntOrIndex () const
 Return true if this is an integer (of any signedness) or an index type. More...
 
bool isIntOrFloat () const
 Return true if this is an integer (of any signedness) or a float type. More...
 
bool isIntOrIndexOrFloat () const
 Return true if this is an integer (of any signedness), index, or float type. More...
 
void print (raw_ostream &os) const
 Print the current type. More...
 
void dump () const
 
const voidgetAsOpaquePointer () const
 Methods for supporting PointerLikeTypeTraits. More...
 
template<template< typename T > class Trait>
bool hasTrait ()
 Returns true if the type was registered with a particular trait. More...
 
const AbstractTygetAbstractType ()
 Return the abstract type descriptor for this type. More...
 

Static Public Member Functions

static bool classof (Type type)
 
- Static Public Member Functions inherited from mlir::Type
static bool classof (Type)
 
static Type getFromOpaquePointer (const void *pointer)
 

Additional Inherited Members

- Protected Attributes inherited from mlir::Type
ImplTypeimpl {nullptr}
 

Detailed Description

Definition at line 41 of file SPIRVTypes.h.

Member Typedef Documentation

◆ CapabilityArrayRefVector

The capability requirements for each type are following the ((Capability::A OR Extension::B) AND (Capability::C OR Capability::D)) convention.

Definition at line 63 of file SPIRVTypes.h.

◆ ExtensionArrayRefVector

The extension requirements for each type are following the ((Extension::A OR Extension::B) AND (Extension::C OR Extension::D)) convention.

Definition at line 52 of file SPIRVTypes.h.

Member Function Documentation

◆ classof()

bool SPIRVType::classof ( Type  type)
static

◆ getCapabilities()

void SPIRVType::getCapabilities ( SPIRVType::CapabilityArrayRefVector capabilities,
Optional< StorageClass >  storage = llvm::None 
)

Appends to capabilities the capabilities needed for this type to appear in the given storage class.

This method does not guarantee the uniqueness of capabilities; the same capability may be appended multiple times.

Definition at line 676 of file SPIRVTypes.cpp.

◆ getExtensions()

void SPIRVType::getExtensions ( SPIRVType::ExtensionArrayRefVector extensions,
Optional< StorageClass >  storage = llvm::None 
)

Appends to extensions the extensions needed for this type to appear in the given storage class.

This method does not guarantee the uniqueness of extensions; the same extension may be appended multiple times.

Definition at line 657 of file SPIRVTypes.cpp.

◆ getSizeInBytes()

Optional< int64_t > SPIRVType::getSizeInBytes ( )

Returns the size in bytes for each type.

If no size can be calculated, returns llvm::None. Note that if the type has explicit layout, it is also taken into account in calculation.

Definition at line 696 of file SPIRVTypes.cpp.

Referenced by ConvertAccessChain::matchAndRewrite().

◆ isScalarOrVector()

bool SPIRVType::isScalarOrVector ( )

Definition at line 653 of file SPIRVTypes.cpp.

Referenced by createGlobalVarForEntryPointArgument().


The documentation for this class was generated from the following files: