|
MLIR 22.0.0git
|
This class provides a shared interface for ranked and unranked memref types. More...
#include "mlir/IR/BuiltinTypes.h"
Public Member Functions | |
| Type | getElementType () const |
| Returns the element type of this memref type. | |
| bool | hasRank () const |
| Returns if this type is ranked, i.e. it has a known number of dimensions. | |
| ArrayRef< int64_t > | getShape () const |
| Returns the shape of this memref type. | |
| BaseMemRefType | cloneWith (std::optional< ArrayRef< int64_t > > shape, Type elementType) const |
| Clone this type with the given shape and element type. | |
| FailureOr< PtrLikeTypeInterface > | clonePtrWith (Attribute memorySpace, std::optional< Type > elementType) const |
| Clone this type with the given memory space and element type. | |
| MemRefType | clone (ArrayRef< int64_t > shape, Type elementType) const |
| Return a clone of this type with the given new shape and element type. | |
| MemRefType | clone (ArrayRef< int64_t > shape) const |
| Return a clone of this type with the given new shape. | |
| Attribute | getMemorySpace () const |
| Returns the memory space in which data referred to by this memref resides. | |
| unsigned | getMemorySpaceAsInt () const |
| [deprecated] Returns the memory space in old raw integer representation. | |
| bool | hasPtrMetadata () const |
| Returns that this ptr-like object has non-empty ptr metadata. | |
| operator ShapedType () const | |
| Allow implicit conversion to ShapedType. | |
| operator PtrLikeTypeInterface () const | |
| Allow implicit conversion to PtrLikeTypeInterface. | |
| constexpr | Type ()=default |
| Type (const ImplType *impl) | |
| Type (const Type &other)=default | |
| Public Member Functions inherited from mlir::Type | |
| constexpr | Type ()=default |
| Type (const ImplType *impl) | |
| Type (const Type &other)=default | |
| Type & | operator= (const Type &other)=default |
| bool | operator== (Type other) const |
| bool | operator!= (Type other) const |
| operator bool () const | |
| bool | operator! () const |
| TypeID | getTypeID () |
| Return a unique identifier for the concrete type. | |
| MLIRContext * | getContext () const |
| Return the MLIRContext in which this type was uniqued. | |
| Dialect & | getDialect () const |
| Get the dialect this type is registered to. | |
| bool | isIndex () const |
| bool | isBF16 () const |
| bool | isF16 () const |
| bool | isTF32 () const |
| bool | isF32 () const |
| bool | isF64 () const |
| bool | isF80 () const |
| bool | isF128 () const |
| bool | isFloat () const |
| Return true if this is an float type (with the specified width). | |
| bool | isFloat (unsigned width) const |
| Return true if this is a float type with the specified width. | |
| bool | isInteger () const |
| Return true if this is an integer type (with the specified width). | |
| bool | isInteger (unsigned width) const |
| bool | isSignlessInteger () const |
| Return true if this is a signless integer type (with the specified width). | |
| bool | isSignlessInteger (unsigned width) const |
| bool | isSignedInteger () const |
| Return true if this is a signed integer type (with the specified width). | |
| bool | isSignedInteger (unsigned width) const |
| bool | isUnsignedInteger () const |
| Return true if this is an unsigned integer type (with the specified width). | |
| bool | isUnsignedInteger (unsigned width) const |
| unsigned | getIntOrFloatBitWidth () const |
| Return the bit width of an integer or a float type, assert failure on other types. | |
| bool | isSignlessIntOrIndex () const |
| Return true if this is a signless integer or index type. | |
| bool | isSignlessIntOrIndexOrFloat () const |
| Return true if this is a signless integer, index, or float type. | |
| bool | isSignlessIntOrFloat () const |
| Return true of this is a signless integer or a float type. | |
| bool | isIntOrIndex () const |
| Return true if this is an integer (of any signedness) or an index type. | |
| bool | isIntOrFloat () const |
| Return true if this is an integer (of any signedness) or a float type. | |
| bool | isIntOrIndexOrFloat () const |
| Return true if this is an integer (of any signedness), index, or float type. | |
| void | print (raw_ostream &os) const |
| Print the current type. | |
| void | print (raw_ostream &os, AsmState &state) const |
| void | dump () const |
| friend::llvm::hash_code | hash_value (Type arg) |
| const void * | getAsOpaquePointer () const |
| Methods for supporting PointerLikeTypeTraits. | |
| template<typename InterfaceT> | |
| bool | hasPromiseOrImplementsInterface () |
| Returns true if InterfaceT has been promised by the dialect or implemented. | |
| template<template< typename T > class Trait> | |
| bool | hasTrait () |
| Returns true if the type was registered with a particular trait. | |
| const AbstractTy & | getAbstractType () const |
| Return the abstract type descriptor for this type. | |
| ImplType * | getImpl () const |
| Return the Type implementation. | |
| void | walkImmediateSubElements (function_ref< void(Attribute)> walkAttrsFn, function_ref< void(Type)> walkTypesFn) const |
| Walk all of the immediately nested sub-attributes and sub-types. | |
| auto | replaceImmediateSubElements (ArrayRef< Attribute > replAttrs, ArrayRef< Type > replTypes) const |
| Replace the immediately nested sub-attributes and sub-types with those provided. | |
| template<WalkOrder Order = WalkOrder::PostOrder, typename... WalkFns> | |
| auto | walk (WalkFns &&...walkFns) |
| Walk this type and all attibutes/types nested within using the provided walk functions. | |
| template<typename... ReplacementFns> | |
| auto | replace (ReplacementFns &&...replacementFns) |
| Recursively replace all of the nested sub-attributes and sub-types using the provided map functions. | |
Static Public Member Functions | |
| static bool | isValidElementType (Type type) |
| Return true if the specified element type is ok in a memref. | |
| static bool | classof (Type type) |
| Methods for support type inquiry through isa, cast, and dyn_cast. | |
| Static Public Member Functions inherited from mlir::Type | |
| static Type | getFromOpaquePointer (const void *pointer) |
Additional Inherited Members | |
| Public Types inherited from mlir::Type | |
| template<typename ConcreteType, typename BaseType, typename StorageType, template< typename T > class... Traits> | |
| using | TypeBase |
| Utility class for implementing types. | |
| using | ImplType = TypeStorage |
| using | AbstractTy = AbstractType |
| Protected Attributes inherited from mlir::Type | |
| ImplType * | impl {nullptr} |
This class provides a shared interface for ranked and unranked memref types.
Note: This class attaches the ShapedType trait to act as a mixin to provide many useful utility functions. This inheritance has no effect on derived memref types.
Definition at line 102 of file BuiltinTypes.h.
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition at line 409 of file BuiltinTypes.h.
References Type().
Return a clone of this type with the given new shape.
The returned type is ranked, even if this type is unranked.
References Type().
Return a clone of this type with the given new shape and element type.
The returned type is ranked, even if this type is unranked.
References Type().
| FailureOr< PtrLikeTypeInterface > BaseMemRefType::clonePtrWith | ( | Attribute | memorySpace, |
| std::optional< Type > | elementType ) const |
Clone this type with the given memory space and element type.
If the provided element type is std::nullopt, the current element type of the type is used.
Definition at line 417 of file BuiltinTypes.cpp.
References getElementType(), mlir::MemRefType::Builder::setElementType(), mlir::MemRefType::Builder::setMemorySpace(), and Type().
Referenced by getMemorySpaceCastInfo().
| BaseMemRefType BaseMemRefType::cloneWith | ( | std::optional< ArrayRef< int64_t > > | shape, |
| Type | elementType ) const |
Clone this type with the given shape and element type.
If the provided shape is std::nullopt, the current shape of the type is used.
Definition at line 399 of file BuiltinTypes.cpp.
References getMemorySpace(), mlir::MemRefType::Builder::setElementType(), mlir::MemRefType::Builder::setMemorySpace(), mlir::MemRefType::Builder::setShape(), and Type().
| Type BaseMemRefType::getElementType | ( | ) | const |
Returns the element type of this memref type.
Definition at line 385 of file BuiltinTypes.cpp.
References Type().
Referenced by clonePtrWith(), and mlir::spirv::MemorySpaceToStorageClassConverter::MemorySpaceToStorageClassConverter().
| Attribute BaseMemRefType::getMemorySpace | ( | ) | const |
Returns the memory space in which data referred to by this memref resides.
Definition at line 439 of file BuiltinTypes.cpp.
Referenced by cloneWith(), mlir::bufferization::OpWithUnstructuredControlFlowBufferizableOpInterfaceExternalModel< ConcreteModel, ConcreteOp >::getBufferType(), mlir::LLVMTypeConverter::getMemRefAddressSpace(), hasDefaultMemorySpace(), hasSharedMemorySpace(), and mlir::spirv::MemorySpaceToStorageClassConverter::MemorySpaceToStorageClassConverter().
| unsigned BaseMemRefType::getMemorySpaceAsInt | ( | ) | const |
[deprecated] Returns the memory space in old raw integer representation.
New Attribute getMemorySpace() method should be used instead.
Definition at line 445 of file BuiltinTypes.cpp.
Referenced by hasDefaultMemorySpace().
Returns the shape of this memref type.
Definition at line 395 of file BuiltinTypes.cpp.
Referenced by mlir::bufferization::OpWithUnstructuredControlFlowBufferizableOpInterfaceExternalModel< ConcreteModel, ConcreteOp >::getBufferType(), and mlir::spirv::MemorySpaceToStorageClassConverter::MemorySpaceToStorageClassConverter().
|
inline |
Returns that this ptr-like object has non-empty ptr metadata.
Definition at line 153 of file BuiltinTypes.h.
| bool BaseMemRefType::hasRank | ( | ) | const |
Returns if this type is ranked, i.e. it has a known number of dimensions.
Definition at line 391 of file BuiltinTypes.cpp.
Referenced by mlir::bufferization::OpWithUnstructuredControlFlowBufferizableOpInterfaceExternalModel< ConcreteModel, ConcreteOp >::getBufferType().
Return true if the specified element type is ok in a memref.
Definition at line 413 of file BuiltinTypes.h.
References mlir::Type::isIntOrIndexOrFloat(), and Type().
Referenced by mlir::detail::Parser::parseMemRefType().
|
inline |
Allow implicit conversion to PtrLikeTypeInterface.
Definition at line 159 of file BuiltinTypes.h.
|
inline |
Allow implicit conversion to ShapedType.
Definition at line 156 of file BuiltinTypes.h.
|
constexprdefault |
Referenced by classof(), clone(), clone(), clonePtrWith(), cloneWith(), getElementType(), and isValidElementType().
|
default |