MLIR  14.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::BaseMemRefType Class Reference

This class provides a shared interface for ranked and unranked memref types. More...

#include "mlir/IR/BuiltinTypes.h"

Inheritance diagram for mlir::BaseMemRefType:
Inheritance graph
[legend]
Collaboration diagram for mlir::BaseMemRefType:
Collaboration graph
[legend]

Public Member Functions

Type getElementType () const
 Returns the element type of this memref type. More...
 
bool hasRank () const
 Returns if this type is ranked, i.e. it has a known number of dimensions. More...
 
ArrayRef< int64_t > getShape () const
 Returns the shape of this memref type. More...
 
BaseMemRefType cloneWith (Optional< ArrayRef< int64_t >> shape, Type elementType) const
 Clone this type with the given shape and element type. More...
 
Attribute getMemorySpace () const
 Returns the memory space in which data referred to by this memref resides. More...
 
unsigned getMemorySpaceAsInt () const
 [deprecated] Returns the memory space in old raw integer representation. More...
 
 operator ShapedType () const
 Allow implicit conversion to ShapedType. 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 isValidElementType (Type type)
 Return true if the specified element type is ok in a memref. More...
 
static bool classof (Type type)
 Methods for support type inquiry through isa, cast, and dyn_cast. More...
 
- Static Public Member Functions inherited from mlir::Type
static bool classof (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 = detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits... >
 Utility class for implementing types. More...
 
using ImplType = TypeStorage
 
using AbstractTy = AbstractType
 
- Protected Attributes inherited from mlir::Type
ImplTypeimpl {nullptr}
 

Detailed Description

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 109 of file BuiltinTypes.h.

Member Function Documentation

◆ classof()

bool mlir::BaseMemRefType::classof ( Type  type)
inlinestatic

Methods for support type inquiry through isa, cast, and dyn_cast.

Definition at line 355 of file BuiltinTypes.h.

References mlir::Type::isa().

◆ cloneWith()

BaseMemRefType BaseMemRefType::cloneWith ( Optional< ArrayRef< int64_t >>  shape,
Type  elementType 
) const

Clone this type with the given shape and element type.

If the provided shape is None, the current shape of the type is used.

Definition at line 369 of file BuiltinTypes.cpp.

References mlir::MemRefType::Builder::setElementType(), mlir::MemRefType::Builder::setMemorySpace(), and mlir::MemRefType::Builder::setShape().

◆ getElementType()

Type BaseMemRefType::getElementType ( ) const

Returns the element type of this memref type.

Definition at line 357 of file BuiltinTypes.cpp.

Referenced by mlir::LLVMTypeConverter::getUnrankedMemRefDescriptorSize().

◆ getMemorySpace()

Attribute BaseMemRefType::getMemorySpace ( ) const

Returns the memory space in which data referred to by this memref resides.

Definition at line 386 of file BuiltinTypes.cpp.

Referenced by verify().

◆ getMemorySpaceAsInt()

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 392 of file BuiltinTypes.cpp.

References mlir::detail::getMemorySpaceAsInt().

Referenced by mlir::LLVMTypeConverter::getUnrankedMemRefDescriptorSize().

◆ getShape()

ArrayRef< int64_t > BaseMemRefType::getShape ( ) const

Returns the shape of this memref type.

Definition at line 365 of file BuiltinTypes.cpp.

References getShape().

◆ hasRank()

bool BaseMemRefType::hasRank ( ) const

Returns if this type is ranked, i.e. it has a known number of dimensions.

Definition at line 363 of file BuiltinTypes.cpp.

◆ isValidElementType()

bool mlir::BaseMemRefType::isValidElementType ( Type  type)
inlinestatic

Return true if the specified element type is ok in a memref.

Definition at line 359 of file BuiltinTypes.h.

References mlir::Type::isa(), and mlir::Type::isIntOrIndexOrFloat().

Referenced by mlir::detail::Parser::parseMemRefType(), and mlir::MemRefType::Builder::setMemorySpace().

◆ operator ShapedType()

mlir::BaseMemRefType::operator ShapedType ( ) const
inline

Allow implicit conversion to ShapedType.

Definition at line 141 of file BuiltinTypes.h.


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