MLIR  14.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
mlir::Type Class Reference

Instances of the Type class are uniqued, have an immutable identifier and an optional mutable component. More...

#include "mlir/IR/Types.h"

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

Public Types

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

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)
 
static Type getFromOpaquePointer (const void *pointer)
 

Protected Attributes

ImplTypeimpl
 

Friends

::llvm::hash_code hash_value (Type arg)
 

Detailed Description

Instances of the Type class are uniqued, have an immutable identifier and an optional mutable component.

They wrap a pointer to the storage object owned by MLIRContext. Therefore, instances of Type are passed around by value.

Some types are "primitives" meaning they do not have any parameters, for example the Index type. Parametric types have additional information that differentiates the types of the same class, for example the Integer type has bitwidth, making i8 and i16 belong to the same kind by be different instances of the IntegerType. Type parameters are part of the unique immutable key. The mutable component of the type can be modified after the type is created, but cannot affect the identity of the type.

Types are constructed and uniqued via the 'detail::TypeUniquer' class.

Derived type classes are expected to implement several required implementation hooks:

Type storage objects inherit from TypeStorage and contain the following:

Definition at line 72 of file Types.h.

Member Typedef Documentation

◆ AbstractTy

Definition at line 82 of file Types.h.

◆ ImplType

Definition at line 80 of file Types.h.

◆ TypeBase

template<typename ConcreteType , typename BaseType , typename StorageType , template< typename T > class... Traits>
using mlir::Type::TypeBase = detail::StorageUserBase<ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits...>

Utility class for implementing types.

Definition at line 78 of file Types.h.

Constructor & Destructor Documentation

◆ Type() [1/3]

constexpr mlir::Type::Type ( )
inline

Definition at line 84 of file Types.h.

Referenced by mlir::pdl::PDLType::classof(), getFromOpaquePointer(), and Type().

◆ Type() [2/3]

mlir::Type::Type ( const ImplType impl)
inline

Definition at line 85 of file Types.h.

References operator=(), and Type().

◆ Type() [3/3]

mlir::Type::Type ( const Type other)
default

Member Function Documentation

◆ cast()

template<typename U >
U mlir::Type::cast ( ) const

Definition at line 250 of file Types.h.

Referenced by mlir::AllocLikeOpLLVMLowering::AllocLikeOpLLVMLowering(), applyPad(), mlir::linalg::comprehensive_bufferize::tensor_ext::CastOpInterface::bufferize(), mlir::linalg::comprehensive_bufferize::tensor_ext::ExtractSliceOpInterface::bufferize(), mlir::linalg::comprehensive_bufferize::tensor_ext::InsertSliceOpInterface::bufferize(), buildVectorRead(), castBoolToIntN(), mlir::quant::QuantizedType::castFromExpressedType(), mlir::quant::QuantizedType::castFromStorageType(), mlir::quant::QuantizedType::castToExpressedType(), mlir::quant::QuantizedType::castToStorageType(), mlir::DenseFPElementsAttr::classof(), mlir::DenseIntElementsAttr::classof(), mlir::spirv::Deserializer::collect(), mlir::DenseElementsAttr::complex_float_value_begin(), mlir::DenseElementsAttr::complex_float_value_end(), computeReshapeCollapsedType(), computeTensorReshapeCollapsedType(), convertArrayType(), convertScalarType(), mlir::tensor::createCanonicalRankReducingExtractSliceOp(), mlir::tensor::createCanonicalRankReducingInsertSliceOp(), createConstantAllBitsSet(), createFPConstant(), createGlobalVarForEntryPointArgument(), createInitialValueForReduceOp(), createLinalgBodyCalculationForElementwiseOp(), createReassociationMapsForCollapse(), createSubViewIntersection(), doubleBuffer(), elementwiseMatchAndRewriteHelper(), extractOne(), mlir::StructBuilder::extractPtr(), extractVectorTypeFromShapedValue(), findDuplicateElement(), mlir::DenseElementsAttr::float_value_begin(), mlir::DenseElementsAttr::float_value_end(), foldExtractFromBroadcast(), foldExtractFromShapeCast(), foldTransferInBoundsAttribute(), mlir::quant::ExpressedToQuantizedConverter::forInputType(), generateCopy(), generatePointWiseCopy(), genLoad(), mlir::DenseElementsAttr::get(), getAllocationTypeAndShape(), mlir::spirv::ArrayType::getCapabilities(), mlir::spirv::RuntimeArrayType::getCapabilities(), mlir::spirv::CooperativeMatrixNVType::getCapabilities(), mlir::DenseElementsAttr::getComplexFloatValues(), mlir::linalg::comprehensive_bufferize::getContiguousOrUnrankedMemRefType(), mlir::AffineDmaStartOp::getDstMemorySpace(), mlir::AffineDmaStartOp::getDstMemRefRank(), mlir::AffineDmaStartOp::getDstMemRefType(), mlir::linalg::getDynOperands(), mlir::MemRefDescriptor::getElementPtrType(), mlir::ShapeAdaptor::getElementType(), mlir::spirv::MatrixType::getElementType(), mlir::spirv::ArrayType::getExtensions(), mlir::spirv::RuntimeArrayType::getExtensions(), mlir::spirv::CooperativeMatrixNVType::getExtensions(), getFirstIntValue(), mlir::DenseElementsAttr::getFloatValues(), getFullMemRefAsRegion(), getLocalInvocationDimSize(), getMultiLevelStrides(), getPushConstantVariable(), mlir::quant::QuantizedType::getQuantizedElementType(), getReshapeOutputShapeFromInputShape(), mlir::ShapedType::getSizeInBits(), mlir::spirv::ArrayType::getSizeInBytes(), mlir::AffineDmaStartOp::getSrcMemorySpace(), mlir::AffineDmaStartOp::getSrcMemRefType(), mlir::AffineDmaStartOp::getTagMemRefRank(), mlir::AffineDmaWaitOp::getTagMemRefRank(), mlir::AffineDmaStartOp::getTagMemRefType(), mlir::AffineDmaWaitOp::getTagMemRefType(), mlir::DenseElementsAttr::getType(), mlir::LLVMTypeConverter::getUnrankedMemRefDescriptorSize(), mlir::vector::getVectorReductionOp(), mlir::Builder::getZeroAttr(), mlir::LLVM::detail::handleMultidimensionalVectors(), hasAllocationScope(), inferExtractOpResultType(), inferStridedSliceOpResultType(), insertCopies(), insertCopyLoops(), insertOne(), isAsyncWithOneDependency(), isBoolScalarOrVector(), mlir::quant::QuantizedType::isCompatibleExpressedType(), isComplexOfIntType(), isInBounds(), isMatchingWidth(), isMemRefNormalizable(), isRankReducedType(), joinShapes(), mlir::OperandElementTypeIterator::mapElement(), mlir::ResultElementTypeIterator::mapElement(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), ReshapeConstOptimization::matchAndRewrite(), MaterializePadValue::matchAndRewrite(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), mlir::linalg::PadTensorOpTransformationPattern::matchAndRewrite(), ContractExtractPattern::matchAndRewrite(), mlir::MemRefDescriptor::MemRefDescriptor(), minMaxValueForFloat(), minMaxValueForSignedInt(), minMaxValueForUnsignedInt(), minusOneIntegerAttribute(), mlir::normalizeMemRef(), operator!(), SubViewCanonicalizer::operator()(), mlir::DenseElementsAttr::IntElementIterator::operator*(), outlineExecuteOp(), mlir::detail::Parser::parseElementsLiteralType(), parseGenericAtomicRMWOp(), parseShuffleVectorOp(), populateFromInt64AttrArray(), print(), printCreateOperationOpAttributes(), produceSliceErrorMsg(), produceSubViewErrorMsg(), mlir::replaceAllMemRefUsesWith(), reshapeLoad(), reshapeLowerToHigher(), mlir::linalg::rewriteAsPaddedOp(), mlir::spirv::Serializer::processTypeDecoration< spirv::RuntimeArrayType >(), mlir::vector::splitFullAndPartialTransfer(), vectorType(), mlir::spirv::MatrixType::verify(), verify(), verifyAtomicUpdateOp(), verifyBlockReadWritePtrAndValTypes(), verifyCastOp(), verifyCopyMemory(), verifyExtOp(), verifyLoadStorePtrAndValTypes(), verifyPointerAndCoopMatrixType(), verifyReductionVarList(), verifyTransferOp(), verifyTruncateOp(), wrapExternalFunction(), and writeAPIntsToBuffer().

◆ classof()

static bool mlir::Type::classof ( Type  )
inlinestatic

Definition at line 104 of file Types.h.

◆ dump()

void Type::dump ( ) const

Definition at line 2746 of file AsmPrinter.cpp.

References print().

Referenced by getDialect().

◆ dyn_cast()

template<typename U >
U mlir::Type::dyn_cast ( ) const

Definition at line 244 of file Types.h.

Referenced by mlir::ValueDecomposer::addDecomposeValueConversion(), addResumeFunction(), appendMangledType(), mlir::linalg::comprehensive_bufferize::tensor_ext::CastOpInterface::bufferize(), bufferizeFuncOp(), bufferizeFuncOpBoundary(), mlir::tosa::buildConvOpQuantizationAttr(), mlir::tosa::buildConvOpResultTypeInfo(), buildLogicalUnaryOp(), mlir::tosa::buildMatMulOpQuantizationAttr(), buildMatMulOpWithQuantInfo(), mlir::tosa::buildPadOpQuantizationAttr(), mlir::tosa::buildQTypeFromMinMax(), mlir::tosa::buildUnaryOpQuantizationAttr(), buildVectorRead(), castBoolToIntN(), mlir::spirv::SPIRVType::classof(), mlir::spirv::ScalarType::classof(), mlir::spirv::CompositeType::classof(), mlir::spirv::Deserializer::collect(), computeMemRefRankReductionMask(), mlir::quant::ExpressedToQuantizedConverter::convert(), mlir::LLVMTypeConverter::convertCallingConventionType(), convertDenseElementsAttr(), mlir::LLVMTypeConverter::convertFunctionTypeCWrapper(), convertMemrefType(), convertScalarType(), convertTensorType(), mlir::linalg::comprehensive_bufferize::BufferizationState::createAllocDeallocFn(), createCastToIndexLike(), createFPConstant(), mlir::VulkanLayoutUtils::decorateType(), defaultIsSmallAlloc(), diag(), mlir::vector::distributPointwiseVectorOp(), elementwiseMatchAndRewriteHelper(), findDuplicateElement(), foldExtractStridedOpFromInsertChain(), foldMemRefCastInTiledLoopOp(), mlir::tensor::foldTensorCast(), foldTransferInBoundsAttribute(), genAddress(), getBitWidth(), mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultPreferredAlignment(), mlir::detail::getDefaultTypeSizeInBits(), mlir::detail::getDenseElementBitWidth(), getElementPtrType(), getElementType(), mlir::getElementTypeOrSelf(), getEnclosingforOps(), getI1SameShape(), getInsertExtractValueElementType(), mlir::tosa::ValueKnowledge::getKnowledgeFromType(), getLoadStoreElementType(), getMemrefConstantHorizontalStride(), mlir::quant::QuantizedType::getQuantizedElementType(), getShape(), mlir::ShapedType::getSizeInBits(), mlir::sparse_tensor::getSparseTensorEncoding(), getTensorOrVectorElementType(), mlir::memref::getTensorTypeFromMemRefType(), getTypeNumBytes(), getUnaryOpResultType(), mlir::Builder::getZeroAttr(), PadTensorOpVectorizationWithTransferWritePattern::hasSameTensorSize(), mlir::ShapedType::hasStaticShape(), insertCopies(), isAllocationSupported(), isBoolScalarOrVector(), mlir::vector::isBroadcastableTo(), mlir::LLVM::isCompatibleType(), mlir::LLVM::isCompatibleVectorType(), mlir::shape::isExtentTensorType(), mlir::VulkanLayoutUtils::isLegalType(), isMemRefNormalizable(), mlir::isOpaqueTypeWithName(), isSignedIntegerOrVector(), isUnsignedIntegerOrVector(), mlir::DataDescriptor::isValid(), mlir::spirv::MatrixType::isValidColumnType(), mlir::LLVM::LLVMScalableVectorType::isValidElementType(), isValidIntOrFloat(), isValidQuantizationSpec(), mlir::linalg::makeTiledShape(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::linalg::LinalgCopyVTWForwardingPattern::matchAndRewrite(), mlir::linalg::ExtractSliceOfPadTensorSwapPattern::matchAndRewrite(), mlir::TypeConverter::materializeTargetConversion(), minusOneIntegerAttribute(), operator!(), optionallyBroadcast(), parseAllocaOp(), parseAndVerifyMatrixType(), parseAndVerifyType(), parseAtomicCompareExchangeImpl(), parseAtomicExchangeOp(), parseAtomicUpdateOp(), parseAwaitResultType(), parseCallOp(), mlir::AsmParser::parseColonType(), parseCompositeConstructOp(), mlir::detail::Parser::parseDecOrHexAttr(), parseElementAttrHexValues(), parseExtractOp(), parseGlobalMemrefOpTypeAndInitialValue(), mlir::impl::parseOneResultSameOperandTypeOp(), parseOuterProductOp(), parseSubgroupBlockReadINTELOp(), parseSubgroupBlockWriteINTELOp(), parseTransferReadOp(), mlir::AsmParser::parseType(), parseVariableOp(), mlir::tensor::preservesStaticInformation(), print(), printCalibratedQuantizedType(), printOperation(), mlir::quant::quantizeAttr(), reduceIfNeeded(), replaceUnitExtents(), reshapeLowerToHigher(), mlir::spirv::Serializer::processTypeDecoration< spirv::RuntimeArrayType >(), mlir::DataDescriptor::setSize(), mlir::ShapeAdaptor::ShapeAdaptor(), mlir::linalg::skipUnitDimReshape(), mlir::SPIRVTypeConverter::SPIRVTypeConverter(), mlir::structFuncArgTypeConverter(), mlir::TypeRange::TypeRange(), vectorShape(), mlir::quant::QuantizedType::verify(), verify(), verifyCastOp(), mlir::verifyCompatibleShape(), verifyGLSLFrexpStructOp(), verifyNamedStructuredOp(), wrapExternalFunction(), and writeAPIntsToBuffer().

◆ dyn_cast_or_null()

template<typename U >
U mlir::Type::dyn_cast_or_null ( ) const

Definition at line 247 of file Types.h.

Referenced by diag(), and operator!().

◆ getAbstractType()

const AbstractTy& mlir::Type::getAbstractType ( )
inline

Return the abstract type descriptor for this type.

Definition at line 179 of file Types.h.

Referenced by hasTrait().

◆ getAsOpaquePointer()

const void* mlir::Type::getAsOpaquePointer ( ) const
inline

Methods for supporting PointerLikeTypeTraits.

Definition at line 165 of file Types.h.

References impl.

Referenced by llvm::PointerLikeTypeTraits< mlir::Type >::getAsVoidPointer().

◆ getContext()

MLIRContext * Type::getContext ( ) const

Return the MLIRContext in which this type was uniqued.

Definition at line 19 of file Types.cpp.

Referenced by mlir::Block::addArgument(), addResumeFunction(), combineOneSpec(), mlir::quant::fakeQuantAttrsToType(), findDuplicateElement(), mlir::DataLayoutEntryAttr::get(), mlir::LLVM::LLVMArrayType::get(), mlir::LLVM::LLVMFunctionType::get(), mlir::gpu::MMAMatrixType::get(), mlir::spirv::ArrayType::get(), mlir::LLVM::LLVMPointerType::get(), mlir::spirv::PointerType::get(), mlir::quant::AnyQuantizedType::get(), mlir::spirv::RuntimeArrayType::get(), mlir::spirv::SampledImageType::get(), mlir::quant::UniformQuantizedType::get(), mlir::quant::UniformQuantizedPerAxisType::get(), mlir::LLVM::LLVMFixedVectorType::get(), mlir::quant::CalibratedQuantizedType::get(), mlir::LLVM::LLVMScalableVectorType::get(), mlir::spirv::CooperativeMatrixNVType::get(), mlir::spirv::MatrixType::get(), mlir::LLVM::LLVMArrayType::getChecked(), mlir::LLVM::LLVMFunctionType::getChecked(), mlir::gpu::MMAMatrixType::getChecked(), mlir::LLVM::LLVMPointerType::getChecked(), mlir::quant::AnyQuantizedType::getChecked(), mlir::spirv::SampledImageType::getChecked(), mlir::quant::UniformQuantizedType::getChecked(), mlir::quant::UniformQuantizedPerAxisType::getChecked(), mlir::LLVM::LLVMFixedVectorType::getChecked(), mlir::LLVM::LLVMScalableVectorType::getChecked(), mlir::quant::CalibratedQuantizedType::getChecked(), mlir::spirv::MatrixType::getChecked(), mlir::Value::getContext(), mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultTypeSizeInBits(), getEnclosingforOps(), getGetValueTypeOpValueType(), getI1SameShape(), mlir::memref::getTensorTypeFromMemRefType(), getTypeID(), mlir::Block::insertArgument(), parseSymbol(), mlir::spirv::Serializer::processTypeDecoration< spirv::RuntimeArrayType >(), mlir::MemRefType::Builder::setMemorySpace(), mlir::UnrankedMemRefDescriptor::sizeBasePtr(), unwrap(), and writeAPIntsToBuffer().

◆ getDialect()

Dialect Type::getDialect ( ) const
inline

◆ getFromOpaquePointer()

static Type mlir::Type::getFromOpaquePointer ( const void pointer)
inlinestatic

◆ getIntOrFloatBitWidth()

unsigned Type::getIntOrFloatBitWidth ( ) const

◆ getTypeID()

TypeID mlir::Type::getTypeID ( )
inline

Return a unique identifier for the concrete type.

This is used to support dynamic type casting.

Definition at line 108 of file Types.h.

References getContext().

Referenced by mlir::detail::filterEntriesForType(), mlir::DataLayout::getTypeABIAlignment(), mlir::DataLayout::getTypePreferredAlignment(), mlir::DataLayout::getTypeSize(), mlir::DataLayout::getTypeSizeInBits(), and mlir::OpTrait::impl::verifyElementwise().

◆ hasTrait()

template<template< typename T > class Trait>
bool mlir::Type::hasTrait ( )
inline

Returns true if the type was registered with a particular trait.

Definition at line 174 of file Types.h.

References getAbstractType(), and mlir::AbstractType::hasTrait().

◆ isa() [1/2]

template<typename U >
bool mlir::Type::isa ( ) const

Definition at line 234 of file Types.h.

Referenced by addResumeFunction(), analyzeProfitability(), broadcast(), mlir::linalg::comprehensive_bufferize::tensor_ext::CastOpInterface::bufferize(), mlir::linalg::comprehensive_bufferize::std_ext::CallOpInterface::bufferize(), bufferizeFuncOpBoundary(), mlir::linalg::comprehensive_bufferize::vector_ext::TransferReadOpInterface::bufferizesToMemoryRead(), mlir::linalg::comprehensive_bufferize::vector_ext::TransferWriteOpInterface::bufferizesToMemoryRead(), mlir::linalg::comprehensive_bufferize::vector_ext::TransferReadOpInterface::bufferizesToMemoryWrite(), mlir::linalg::comprehensive_bufferize::vector_ext::TransferWriteOpInterface::bufferizesToMemoryWrite(), mlir::scf::buildLoopNest(), mlir::quant::QuantizedType::castFromExpressedType(), mlir::quant::QuantizedType::castFromStorageType(), mlir::quant::QuantizedType::castToExpressedType(), mlir::quant::QuantizedType::castToStorageType(), mlir::pdl::PDLType::classof(), mlir::FloatType::classof(), mlir::spirv::SPIRVType::classof(), mlir::spirv::CompositeType::classof(), mlir::ShapedType::classof(), mlir::TensorType::classof(), mlir::BaseMemRefType::classof(), mlir::DenseFPElementsAttr::classof(), mlir::spirv::Deserializer::collect(), mlir::DenseElementsAttr::complex_float_value_begin(), mlir::DenseElementsAttr::complex_float_value_end(), convertDenseElementsAttr(), convertStructType(), mlir::ConvertToLLVMPattern::copyUnrankedDescriptors(), mlir::linalg::comprehensive_bufferize::BufferizationState::createAllocDeallocFn(), createConstantAllBitsSet(), createInitialValueForReduceOp(), createLinalgBodyCalculationForElementwiseOp(), createLinalgBodyCalculationForReduceOp(), mlir::linalg::createLinalgOpOnBuffers(), mlir::createLoopFusionPass(), mlir::vector::createOrFoldDimOp(), mlir::linalg::createOrFoldDimOp(), createOrFoldDimOp(), createReassociationMapsForCollapse(), mlir::VulkanLayoutUtils::decorateType(), diag(), dispatchPrint(), eachHasOnlyOneOfTypes(), fillStructuredOpRegion(), findDuplicateElement(), foldExtractFromBroadcast(), foldExtractFromShapeCast(), mlir::memref::foldMemRefCast(), foldMemRefCastInTiledLoopOp(), foldTransferInBoundsAttribute(), mlir::quant::ExpressedToQuantizedConverter::forInputType(), fuseOperations(), genLoad(), genTensorLoad(), genVectorReducInit(), mlir::SPIRVConversionTarget::get(), mlir::DenseElementsAttr::get(), mlir::linalg::comprehensive_bufferize::vector_ext::TransferWriteOpInterface::getAliasingOpResult(), mlir::linalg::comprehensive_bufferize::scf_ext::ForOpInterface::getAliasingOpResult(), getAllocationTypeAndShape(), getBitWidth(), mlir::OpTrait::util::getBroadcastedType(), mlir::DenseElementsAttr::getComplexFloatValues(), mlir::linalg::comprehensive_bufferize::getContiguousOrUnrankedMemRefType(), mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultPreferredAlignment(), mlir::detail::getDefaultTypeSizeInBits(), getFirstIntValue(), getGetValueTypeOpValueType(), getI1SameShape(), getOperandTreePredicates(), mlir::LLVM::getPrimitiveTypeSizeInBits(), getProducerOfTensor(), mlir::quant::QuantizedType::getQuantizedElementType(), mlir::ShapedType::getSizeInBits(), getTreePredicates(), getTypeNumBytes(), getUnderlyingType(), mlir::LLVMTypeConverter::getUnrankedMemRefDescriptorSize(), getVectorType(), mlir::Builder::getZeroAttr(), hasTensorOrVectorType(), isAccessIndexInvariant(), isaTensor(), isBoolScalarOrVector(), mlir::quant::QuantizedType::isCompatibleExpressedType(), mlir::LLVM::isCompatibleFloatingPointType(), mlir::LLVM::isCompatibleType(), mlir::LLVM::isCompatibleVectorType(), isComplexOfIntType(), isDefinedByCallTo(), isErrorPropagationPossible(), isGpuAsyncTokenType(), isMemRefNormalizable(), isQuantizablePrimitiveType(), isRankReducedType(), mlir::async::isRefCounted(), isShapePreserving(), isSupportedCombiningKind(), mlir::LLVM::LLVMFunctionType::isValidArgumentType(), mlir::LLVM::LLVMArrayType::isValidElementType(), mlir::TensorType::isValidElementType(), mlir::LLVM::LLVMPointerType::isValidElementType(), mlir::BaseMemRefType::isValidElementType(), mlir::LLVM::LLVMStructType::isValidElementType(), mlir::LLVM::LLVMFixedVectorType::isValidElementType(), mlir::LLVM::LLVMScalableVectorType::isValidElementType(), isValidIntOrFloat(), isValidQuantizationSpec(), mlir::LLVM::LLVMFunctionType::isValidResultType(), mlir::linalg::comprehensive_bufferize::BufferizationState::lookupBuffer(), mlir::linalg::comprehensive_bufferize::BufferizationState::mapBuffer(), mappingHelper(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), AddZeroOptimization::matchAndRewrite(), MulOneOptimization::matchAndRewrite(), operator!(), mlir::AffineDmaWaitOp::parse(), parseAndVerifySampledImageType(), parseCallOp(), mlir::detail::Parser::parseComplexType(), parseConstantOp(), mlir::detail::Parser::parseDecOrHexAttr(), parseElementAttrHexValues(), mlir::detail::Parser::parseElementsLiteralType(), mlir::detail::Parser::parseFloatAttr(), parseGlobalVariableOp(), print(), mlir::AsmPrinter::Impl::printDenseIntOrFPElementsAttr(), mlir::OpAsmPrinter::printFunctionalType(), printGPUFuncOp(), printLandingpadOp(), printLLVMFuncOp(), printTensorOrBufferInfo(), replaceUnitExtents(), mlir::spirv::Serializer::processOp< spirv::FunctionCallOp >(), mlir::spirv::Serializer::processTypeDecoration< spirv::RuntimeArrayType >(), mlir::DataDescriptor::setSize(), mlir::structFuncArgTypeConverter(), vectorizeOperand(), mlir::quant::AnyQuantizedType::verify(), mlir::spirv::SampledImageType::verify(), mlir::quant::UniformQuantizedType::verify(), verify(), mlir::quant::UniformQuantizedPerAxisType::verify(), mlir::quant::CalibratedQuantizedType::verify(), verifyPointerAndCoopMatrixType(), mlir::OpTrait::impl::verifyResultsAreFloatLike(), verifyTransferOp(), visitUpward(), walkReferenceCountedValues(), wrapExternalFunction(), and writeAPIntsToBuffer().

◆ isa() [2/2]

template<typename First , typename Second , typename... Rest>
bool mlir::Type::isa ( ) const

Definition at line 240 of file Types.h.

◆ isBF16()

bool Type::isBF16 ( ) const

◆ isF128()

bool Type::isF128 ( ) const

Definition at line 26 of file Types.cpp.

Referenced by fltSemanticsForType(), and getDialect().

◆ isF16()

bool Type::isF16 ( ) const

◆ isF32()

bool Type::isF32 ( ) const

◆ isF64()

bool Type::isF64 ( ) const

◆ isF80()

bool Type::isF80 ( ) const

Definition at line 25 of file Types.cpp.

Referenced by fltSemanticsForType(), and getDialect().

◆ isIndex()

bool Type::isIndex ( ) const

◆ isInteger()

bool Type::isInteger ( unsigned  width) const

◆ isIntOrFloat()

bool Type::isIntOrFloat ( ) const

◆ isIntOrIndex()

bool Type::isIntOrIndex ( ) const

Return true if this is an integer (of any signedness) or an index type.

Definition at line 85 of file Types.cpp.

Referenced by mlir::DenseIntElementsAttr::classof(), mlir::DenseElementsAttr::get(), getDialect(), isSupportedCombiningKind(), TwoDimMultiReductionToElementWise::matchAndRewrite(), and parseElementAttrHexValues().

◆ isIntOrIndexOrFloat()

bool Type::isIntOrIndexOrFloat ( ) const

◆ isSignedInteger() [1/2]

bool Type::isSignedInteger ( ) const

Return true if this is a signed integer type (with the specified width).

Definition at line 49 of file Types.cpp.

Referenced by buildAttributeAPInt(), getDialect(), mlir::Builder::getIntegerAttr(), and isSignedIntegerOrVector().

◆ isSignedInteger() [2/2]

bool Type::isSignedInteger ( unsigned  width) const

Definition at line 55 of file Types.cpp.

◆ isSignlessInteger() [1/2]

bool Type::isSignlessInteger ( ) const

Return true if this is a signless integer type (with the specified width).

Definition at line 37 of file Types.cpp.

Referenced by mlir::arith::ConstantIntOp::build(), getDialect(), and verify().

◆ isSignlessInteger() [2/2]

bool Type::isSignlessInteger ( unsigned  width) const

Definition at line 43 of file Types.cpp.

◆ isSignlessIntOrFloat()

bool Type::isSignlessIntOrFloat ( ) const

Return true of this is a signless integer or a float type.

Definition at line 81 of file Types.cpp.

Referenced by getDialect(), mlir::linalg::RegionMatcher::matchAsScalarBinaryOp(), and verifyShuffleOp().

◆ isSignlessIntOrIndex()

bool Type::isSignlessIntOrIndex ( ) const

Return true if this is a signless integer or index type.

Definition at line 73 of file Types.cpp.

Referenced by getDialect(), and mlir::OpTrait::impl::verifyResultsAreSignlessIntegerLike().

◆ isSignlessIntOrIndexOrFloat()

bool Type::isSignlessIntOrIndexOrFloat ( ) const

Return true if this is a signless integer, index, or float type.

Definition at line 77 of file Types.cpp.

Referenced by appendMangledType(), and getDialect().

◆ isUnsignedInteger() [1/2]

bool Type::isUnsignedInteger ( ) const

◆ isUnsignedInteger() [2/2]

bool Type::isUnsignedInteger ( unsigned  width) const

Definition at line 67 of file Types.cpp.

◆ operator bool()

mlir::Type::operator bool ( ) const
inlineexplicit

Definition at line 93 of file Types.h.

References impl.

◆ operator!()

bool mlir::Type::operator! ( ) const
inline

Definition at line 95 of file Types.h.

References cast(), dyn_cast(), dyn_cast_or_null(), and isa().

◆ operator!=()

bool mlir::Type::operator!= ( Type  other) const
inline

Definition at line 92 of file Types.h.

◆ operator=()

Type& mlir::Type::operator= ( const Type other)
default

Referenced by Type().

◆ operator==()

bool mlir::Type::operator== ( Type  other) const
inline

Definition at line 91 of file Types.h.

References impl.

◆ print()

void Type::print ( raw_ostream &  os) const

Print the current type.

Definition at line 2742 of file AsmPrinter.cpp.

References mlir::AsmPrinter::Impl::printType().

Referenced by getDialect(), and mlir::operator<<().

Friends And Related Function Documentation

◆ hash_value

::llvm::hash_code hash_value ( Type  arg)
friend

Definition at line 230 of file Types.h.

Referenced by getDialect().

Member Data Documentation

◆ impl

ImplType* mlir::Type::impl
protected

Definition at line 182 of file Types.h.

Referenced by getAsOpaquePointer(), mlir::hash_value(), operator bool(), and operator==().


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