MLIR
15.0.0git
|
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable component. More...
#include "mlir/IR/Types.h"
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 | |
Type & | operator= (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 > | |
U | dyn_cast () const |
template<typename U > | |
U | dyn_cast_or_null () const |
template<typename U > | |
U | cast () const |
TypeID | getTypeID () |
Return a unique identifier for the concrete type. More... | |
MLIRContext * | getContext () const |
Return the MLIRContext in which this type was uniqued. More... | |
Dialect & | getDialect () 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 void * | getAsOpaquePointer () 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 AbstractTy & | getAbstractType () |
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 | |
ImplType * | impl {nullptr} |
Friends | |
::llvm::hash_code | hash_value (Type arg) |
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:
using mlir::Type::AbstractTy = AbstractType |
using mlir::Type::ImplType = TypeStorage |
using mlir::Type::TypeBase = detail::StorageUserBase<ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits...> |
|
inline |
Definition at line 84 of file Types.h.
Referenced by mlir::pdl::PDLType::classof(), getFromOpaquePointer(), and Type().
|
inline |
Definition at line 85 of file Types.h.
References operator=(), and Type().
|
default |
U mlir::Type::cast | ( | ) | const |
Definition at line 250 of file Types.h.
Referenced by mlir::AllocLikeOpLLVMLowering::AllocLikeOpLLVMLowering(), applyPad(), mlir::LLVMTypeConverter::canConvertToBarePtr(), castBoolToIntN(), mlir::quant::QuantizedType::castFromExpressedType(), mlir::quant::QuantizedType::castFromStorageType(), mlir::bufferization::castOrReallocMemRefValue(), mlir::quant::QuantizedType::castToExpressedType(), mlir::quant::QuantizedType::castToStorageType(), checkIntFloatCast(), mlir::DenseFPElementsAttr::classof(), mlir::DenseIntElementsAttr::classof(), collapseGenericOpIterationDims(), mlir::spirv::Deserializer::collect(), mlir::DenseElementsAttr::complex_float_value_begin(), mlir::DenseElementsAttr::complex_float_value_end(), computeCollapsedType(), computeExpandedType(), computeMemRefRankReductionMask(), computeTensorReshapeCollapsedType(), convertArrayType(), convertOmpAtomicRead(), convertScalarType(), mlir::tensor::createCanonicalRankReducingExtractSliceOp(), mlir::tensor::createCanonicalRankReducingInsertSliceOp(), createConstantAllBitsSet(), createDepthwiseConvCollapseMap(), createFPConstant(), createGlobalVarForEntryPointArgument(), createI32Constant(), createInitialValueForReduceOp(), createLinalgBodyCalculationForElementwiseOp(), createReassociationMapsForCollapse(), createSubViewIntersection(), doubleBuffer(), ensureToMemrefOpIsValid(), extractOne(), mlir::StructBuilder::extractPtr(), findAncestorOpInRegion(), findDuplicateElement(), mlir::DenseElementsAttr::float_value_begin(), mlir::DenseElementsAttr::float_value_end(), foldExtractFromBroadcast(), foldExtractFromShapeCast(), foldExtractStridedOpFromInsertChain(), foldInsertAfterInsertSlice(), foldTransferInBoundsAttribute(), mlir::quant::ExpressedToQuantizedConverter::forInputType(), generateCopy(), mlir::linalg::generateLibraryCallName(), generatePointWiseCopy(), genLoad(), mlir::DenseElementsAttr::get(), getAllocationTypeAndShape(), mlir::spirv::ArrayType::getCapabilities(), mlir::spirv::RuntimeArrayType::getCapabilities(), mlir::spirv::CooperativeMatrixNVType::getCapabilities(), mlir::DenseElementsAttr::getComplexFloatValues(), 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(), mlir::bufferization::getMemRefType(), mlir::bufferization::getMemRefTypeWithFullyDynamicLayout(), mlir::bufferization::getMemRefTypeWithStaticIdentityLayout(), getMultiLevelStrides(), getNumElements(), mlir::sparse_tensor::getOneAttr(), getPushConstantVariable(), mlir::quant::QuantizedType::getQuantizedElementType(), getReshapeOutputShapeFromInputShape(), 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::nvgpu::getWarpMatrixInfo(), mlir::Builder::getZeroAttr(), mlir::LLVM::detail::handleMultidimensionalVectors(), hasAllocationScope(), hasSameBitwidthScalarType(), inferDynamicDimsForConv(), inferIntrinsicResultType(), inferStridedSliceOpResultType(), insertCopies(), insertCopyLoops(), insertOne(), invertPredicate(), isAsyncWithOneDependency(), isBoolScalarOrVector(), mlir::quant::QuantizedType::isCompatibleExpressedType(), isComplexOfIntType(), isInBounds(), isMatchingWidth(), isMemRefNormalizable(), mlir::LLVM::isScalableVectorType(), isZeroAttribute(), joinShapes(), mlir::linalg::makeMemRefCopyOp(), mlir::linalg::makeTransposeOp(), mlir::OperandElementTypeIterator::mapElement(), mlir::ResultElementTypeIterator::mapElement(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), ReshapeConstOptimization::matchAndRewrite(), MaxPool2dIsNoOp::matchAndRewrite(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), CollapseShapeOpMemRefCastFolder::matchAndRewrite(), mlir::MemRefDescriptor::MemRefDescriptor(), minMaxValueForFloat(), minMaxValueForSignedInt(), minMaxValueForUnsignedInt(), minusOneIntegerAttribute(), mlir::normalizeMemRef(), operator!(), SubViewCanonicalizer::operator()(), mlir::DenseElementsAttr::IntElementIterator::operator*(), outlineExecuteOp(), mlir::detail::Parser::parseElementsLiteralType(), parseGlobalMemrefOpTypeAndInitialValue(), parseInferType(), populateFromInt64AttrArray(), printCreateOperationOpResults(), printGEPIndices(), produceSliceErrorMsg(), produceSubViewErrorMsg(), mlir::replaceAllMemRefUsesWith(), mlir::replaceForOpWithNewYields(), replaceUsesAndPropagateType(), reshapeLoad(), reshapeLowerToHigher(), mlir::linalg::rewriteAsPaddedOp(), rewriteWarpOpToScfFor(), mlir::detail::sameOffsetsSizesAndStrides(), mlir::spirv::Serializer::processTypeDecoration< spirv::RuntimeArrayType >(), splatZero(), mlir::vector::splitFullAndPartialTransfer(), unpackOperandVector(), vectorType(), mlir::spirv::MatrixType::verify(), verifyAtomicCompareExchangeImpl(), verifyAtomicUpdateOp(), verifyBlockReadWritePtrAndValTypes(), verifyCastOp(), verifyConstantType(), verifyCoopMatrixMulAdd(), verifyExtOp(), verifyLoadStorePtrAndValTypes(), verifyMemoryOpIndexing(), verifyPointerAndCoopMatrixType(), verifyReductionVarList(), verifyTensorReshapeOp(), verifyTruncateOp(), verifyVectorMemoryOp(), and wrapExternalFunction().
void Type::dump | ( | ) | const |
U mlir::Type::dyn_cast | ( | ) | const |
Definition at line 244 of file Types.h.
Referenced by mlir::ValueDecomposer::addDecomposeValueConversion(), addResumeFunction(), appendMangledType(), mlir::bufferization::func_ext::FuncOpInterface::bufferize(), mlir::bufferization::BufferizeTypeConverter::BufferizeTypeConverter(), mlir::tosa::buildConvOpQuantizationAttr(), mlir::tosa::buildConvOpResultTypeInfo(), buildLogicalUnaryOp(), mlir::tosa::buildMatMulOpQuantizationAttr(), buildMatMulOpWithQuantInfo(), mlir::tosa::buildPadOpQuantizationAttr(), mlir::tosa::buildQTypeFromMinMax(), mlir::tosa::buildUnaryOpQuantizationAttr(), castBoolToIntN(), checkIntFloatCast(), mlir::spirv::SPIRVType::classof(), mlir::spirv::ScalarType::classof(), mlir::spirv::CompositeType::classof(), collapseGenericOpIterationDims(), mlir::spirv::Deserializer::collect(), computeMemRefRankReductionMask(), mlir::sparse_tensor::constantOne(), mlir::sparse_tensor::constantZero(), mlir::quant::ExpressedToQuantizedConverter::convert(), mlir::LLVMTypeConverter::convertCallingConventionType(), mlir::LLVMTypeConverter::convertFunctionTypeCWrapper(), convertIntrinsicResult(), convertMemrefType(), convertScalarType(), convertTensorType(), createFPConstant(), createI32Constant(), createNonLdMatrixLoads(), mlir::VulkanLayoutUtils::decorateType(), defaultIsSmallAlloc(), mlir::vector::distributPointwiseVectorOp(), elementwiseMatchAndRewriteHelper(), ensureToMemrefOpIsValid(), extractVectorElementType(), findAncestorOpInRegion(), findDuplicateElement(), foldExtractFromBroadcast(), foldExtractStridedOpFromInsertChain(), foldMemRefCast(), mlir::tensor::foldTensorCast(), mlir::bufferization::foldToMemrefToTensorPair(), foldTransferInBoundsAttribute(), forwardPassthroughAttributes(), genAddress(), mlir::sparse_tensor::genIsNonzero(), getBitWidth(), mlir::bufferization::func_ext::getBufferizedFunctionArgType(), mlir::bufferization::BufferizationState::getBufferType(), mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultPreferredAlignment(), mlir::detail::getDefaultTypeSizeInBits(), mlir::detail::getDenseElementBitWidth(), getElementPtrType(), getElementType(), mlir::getElementTypeOrSelf(), getEnclosingforOps(), mlir::FloatType::getFPMantissaWidth(), getI1SameShape(), getInsertExtractValueElementType(), mlir::tosa::ValueKnowledge::getKnowledgeFromType(), getLoadStoreElementType(), mlir::bufferization::getMemRefType(), mlir::bufferization::getMemRefTypeWithFullyDynamicLayout(), mlir::bufferization::getMemRefTypeWithStaticIdentityLayout(), getMmaSyncVectorOperandType(), getNumElements(), mlir::sparse_tensor::getOneAttr(), mlir::quant::QuantizedType::getQuantizedElementType(), getRuntimeArrayElementType(), getShape(), mlir::sparse_tensor::getSparseTensorEncoding(), getTensorOrVectorElementType(), mlir::memref::getTensorTypeFromMemRefType(), getTypeNumBytes(), getUnaryOpResultType(), mlir::getValueOrCreateCastToIndexLike(), mlir::Builder::getZeroAttr(), mlir::hasNonIdentityLayout(), hasOneBranchOpTo(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), insertCasts(), insertCopies(), isAllocationSupported(), isBoolScalarOrVector(), mlir::vector::isBroadcastableTo(), mlir::LLVM::isCompatibleOuterType(), 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(), isZeroAttribute(), joinShapes(), mlir::bufferization::lookupBuffer(), mlir::linalg::makeTiledShape(), matchAndReplaceDepthwiseConv(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), AllocaScopeHoister::matchAndRewrite(), mlir::linalg::ExtractSliceOfPadTensorSwapPattern::matchAndRewrite(), CollapseShapeOpMemRefCastFolder::matchAndRewrite(), mlir::TypeConverter::materializeTargetConversion(), minusOneIntegerAttribute(), operator!(), optionallyBroadcast(), mlir::sparse_tensor::overheadTypeEncoding(), parseAndVerifyMatrixType(), parseAndVerifyType(), parseAtomicCompareExchangeImpl(), parseAtomicUpdateOp(), parseAwaitResultType(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseCustomTypeWithFallback(), mlir::detail::Parser::parseDecOrHexAttr(), parseElementAttrHexValues(), parseGlobalMemrefOpTypeAndInitialValue(), parseOneResultSameOperandTypeOp(), mlir::AsmParser::parseType(), mlir::tensor::preservesStaticInformation(), mlir::sparse_tensor::primaryTypeEncoding(), printAwaitResultType(), printCalibratedQuantizedType(), mlir::ExtensibleDialect::printIfDynamicType(), printNVVMIntrinsicOp(), printOperation(), mlir::quant::quantizeAttr(), reduceIfNeeded(), replaceUnitExtents(), reshapeLowerToHigher(), mlir::spirv::Serializer::processTypeDecoration< spirv::RuntimeArrayType >(), mlir::DataDescriptor::setSize(), mlir::ShapeAdaptor::ShapeAdaptor(), mlir::SPIRVTypeConverter::SPIRVTypeConverter(), splatZero(), mlir::structFuncArgTypeConverter(), mlir::TypeRange::TypeRange(), vectorShape(), mlir::quant::QuantizedType::verify(), verifyAtomicCompareExchangeImpl(), verifyCastOp(), mlir::verifyCompatibleShape(), verifyConstantType(), verifyCoopMatrixMulAdd(), and writeAPIntsToBuffer().
U mlir::Type::dyn_cast_or_null | ( | ) | const |
Definition at line 247 of file Types.h.
Referenced by getBoolAttribute(), and operator!().
|
inline |
Return the abstract type descriptor for this type.
Definition at line 179 of file Types.h.
Referenced by hasTrait().
|
inline |
Methods for supporting PointerLikeTypeTraits.
Definition at line 165 of file Types.h.
References impl.
Referenced by llvm::PointerLikeTypeTraits< mlir::Type >::getAsVoidPointer().
MLIRContext * Type::getContext | ( | ) | const |
Return the MLIRContext in which this type was uniqued.
Definition at line 19 of file Types.cpp.
Referenced by addResumeFunction(), combineOneSpec(), mlir::quant::fakeQuantAttrsToType(), findDuplicateElement(), mlir::DataLayoutEntryAttr::get(), mlir::LLVM::LLVMArrayType::get(), mlir::gpu::MMAMatrixType::get(), mlir::spirv::ArrayType::get(), mlir::LLVM::LLVMFunctionType::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::spirv::CooperativeMatrixNVType::get(), mlir::LLVM::LLVMScalableVectorType::get(), mlir::spirv::MatrixType::get(), mlir::LLVM::LLVMArrayType::getChecked(), mlir::gpu::MMAMatrixType::getChecked(), mlir::LLVM::LLVMFunctionType::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::quant::CalibratedQuantizedType::getChecked(), mlir::LLVM::LLVMScalableVectorType::getChecked(), mlir::spirv::MatrixType::getChecked(), mlir::Value::getContext(), mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultPreferredAlignment(), mlir::detail::getDefaultTypeSizeInBits(), getGetValueTypeOpValueType(), getI1SameShape(), mlir::nvgpu::getRegisterIndexToTileOffsetMap(), mlir::memref::getTensorTypeFromMemRefType(), getTypeID(), getUnaryOpResultType(), inferIntrinsicResultType(), parseSymbol(), printNVVMIntrinsicOp(), mlir::spirv::Serializer::processTypeDecoration< spirv::RuntimeArrayType >(), mlir::MemRefType::Builder::setMemorySpace(), and mlir::UnrankedMemRefDescriptor::sizeBasePtr().
|
inline |
Get the dialect this type is registered to.
Definition at line 114 of file Types.h.
References dump(), getIntOrFloatBitWidth(), hash_value, isBF16(), isF128(), isF16(), isF32(), isF64(), isF80(), isIndex(), isInteger(), isIntOrFloat(), isIntOrIndex(), isIntOrIndexOrFloat(), isSignedInteger(), isSignlessInteger(), isSignlessIntOrFloat(), isSignlessIntOrIndex(), isSignlessIntOrIndexOrFloat(), isUnsignedInteger(), and print().
Referenced by mlir::pdl::PDLType::classof(), mlir::spirv::SPIRVType::classof(), mlir::quant::QuantizedType::classof(), combineOneSpec(), mlir::TensorType::isValidElementType(), parseAndVerifyType(), mlir::AsmPrinter::Impl::printDialectType(), and verifyConstantType().
Definition at line 168 of file Types.h.
References Type().
Referenced by mlir::DiagnosticArgument::getAsType(), and llvm::PointerLikeTypeTraits< mlir::Type >::getFromVoidPointer().
unsigned Type::getIntOrFloatBitWidth | ( | ) | const |
Return the bit width of an integer or a float type, assert failure on other types.
Definition at line 91 of file Types.cpp.
Referenced by buildAttributeAPInt(), castBoolToIntN(), createDepthwiseConvCollapseMap(), createInitialValueForReduceOp(), createLinalgBodyCalculationForElementwiseOp(), createReassociationMapsForCollapse(), declareReduction(), mlir::VulkanLayoutUtils::decorateType(), genLoad(), getBitWidth(), mlir::detail::getDefaultTypeSizeInBits(), mlir::detail::getDenseElementBitWidth(), getDialect(), mlir::Builder::getIntegerAttr(), mlir::nvgpu::getLaneIdAndValueIdToOperandCoord(), mlir::nvgpu::getLdMatrixParams(), mlir::nvgpu::getRegisterIndexToTileOffsetMap(), getSrcVectorElementType(), getTypeNumBytes(), mlir::nvgpu::inferTileWidthInBits(), isDefinedByCallTo(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), parseSwitchOpCases(), and verifyCastOp().
|
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(), mlir::DynamicType::isa(), and mlir::OpTrait::impl::verifyElementwise().
|
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().
Referenced by mlir::DynamicType::classof().
bool mlir::Type::isa | ( | ) | const |
Definition at line 234 of file Types.h.
Referenced by addResumeFunction(), analyzeProfitability(), assertDestinationPassingStyle(), broadcast(), mlir::bufferization::func_ext::CallOpInterface::bufferize(), buildLLVMFunctionType(), mlir::scf::buildLoopNest(), buildVectorWrite(), mlir::LLVMTypeConverter::canConvertToBarePtr(), mlir::quant::QuantizedType::castFromExpressedType(), mlir::quant::QuantizedType::castFromStorageType(), mlir::quant::QuantizedType::castToExpressedType(), mlir::quant::QuantizedType::castToStorageType(), checkAndNestUnderRewriteOp(), mlir::pdl::PDLType::classof(), mlir::spirv::SPIRVType::classof(), mlir::FloatType::classof(), mlir::TensorType::classof(), mlir::spirv::CompositeType::classof(), mlir::BaseMemRefType::classof(), mlir::DenseFPElementsAttr::classof(), mlir::spirv::Deserializer::collect(), mlir::DenseElementsAttr::complex_float_value_begin(), mlir::DenseElementsAttr::complex_float_value_end(), convertStructType(), mlir::ConvertToLLVMPattern::copyUnrankedDescriptors(), mlir::bufferization::BufferizationState::createAlloc(), createConstantAllBitsSet(), createDepthwiseConvCollapseMap(), createInitialValueForReduceOp(), createLinalgBodyCalculationForElementwiseOp(), createLinalgBodyCalculationForReduceOp(), mlir::createLoopFusionPass(), createNonLdMatrixLoads(), mlir::vector::createOrFoldDimOp(), mlir::linalg::createOrFoldDimOp(), createOrFoldDimOp(), mlir::VulkanLayoutUtils::decorateType(), dispatchPrint(), eachHasOnlyOneOfTypes(), fillStructuredOpRegion(), findDuplicateElement(), foldExtractFromBroadcast(), foldExtractStridedOpFromInsertChain(), mlir::memref::foldMemRefCast(), foldMemRefCast(), mlir::quant::ExpressedToQuantizedConverter::forInputType(), fuseOperations(), mlir::bufferization::OneShotAnalysisState::gatherYieldedTensors(), genIndexValue(), mlir::sparse_tensor::genIsNonzero(), genLoad(), genTensorLoad(), mlir::SPIRVConversionTarget::get(), getAllocationTypeAndShape(), getAssumedUniqueReturnOp(), getBitWidth(), mlir::OpTrait::util::getBroadcastedType(), mlir::DenseElementsAttr::getComplexFloatValues(), mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultPreferredAlignment(), mlir::detail::getDefaultTypeSizeInBits(), getFirstIntValue(), getGetValueTypeOpValueType(), getI1SameShape(), getInsertExtractValueElementType(), getLoadStoreElementType(), mlir::sparse_tensor::getOneAttr(), getOperandTreePredicates(), mlir::LLVM::getPrimitiveTypeSizeInBits(), getProducerOfTensor(), mlir::quant::QuantizedType::getQuantizedElementType(), getTreePredicates(), getTypeNumBytes(), getUnderlyingType(), getVectorType(), mlir::Builder::getZeroAttr(), hasTensorOrVectorType(), insertCasts(), invertPredicate(), isAccessIndexInvariant(), isaTensor(), isBoolScalarOrVector(), mlir::quant::QuantizedType::isCompatibleExpressedType(), mlir::LLVM::isCompatibleFloatingPointType(), mlir::LLVM::isCompatibleOuterType(), mlir::LLVM::isCompatibleVectorType(), isComplexOfIntType(), isDefinedByCallTo(), isErrorPropagationPossible(), isGpuAsyncTokenType(), isMemRefNormalizable(), isQuantizablePrimitiveType(), mlir::async::isRefCounted(), mlir::LLVM::isScalableVectorType(), isSupportedCombiningKind(), mlir::LLVM::LLVMFunctionType::isValidArgumentType(), mlir::LLVM::LLVMArrayType::isValidElementType(), mlir::TensorType::isValidElementType(), mlir::BaseMemRefType::isValidElementType(), mlir::LLVM::LLVMPointerType::isValidElementType(), mlir::LLVM::LLVMStructType::isValidElementType(), mlir::LLVM::LLVMFixedVectorType::isValidElementType(), mlir::LLVM::LLVMScalableVectorType::isValidElementType(), isValidIntOrFloat(), isValidQuantizationSpec(), mlir::LLVM::LLVMFunctionType::isValidResultType(), mlir::bufferization::AnalysisState::isValueRead(), joinShapes(), mlir::OpToFuncCallLowering< SourceOp >::matchAndRewrite(), ConvertAccessChain::matchAndRewrite(), AllocaScopeHoister::matchAndRewrite(), SelectToExtUI::matchAndRewrite(), operator!(), mlir::AffineDmaWaitOp::parse(), parseAndVerifySampledImageType(), mlir::detail::Parser::parseComplexType(), mlir::detail::Parser::parseDecOrHexAttr(), parseElementAttrHexValues(), mlir::detail::Parser::parseElementsLiteralType(), mlir::detail::Parser::parseFloatAttr(), parseInferType(), printAttributions(), printAwaitResultType(), mlir::AsmPrinter::Impl::printDenseIntOrFPElementsAttr(), mlir::OpAsmPrinter::printFunctionalType(), printNVVMIntrinsicOp(), mlir::bufferization::replaceOpWithBufferizedValues(), replaceUnitExtents(), rewriteWarpOpToScfFor(), mlir::spirv::Serializer::processOp< spirv::FunctionCallOp >(), mlir::spirv::Serializer::processTypeDecoration< spirv::RuntimeArrayType >(), setInPlaceOpOperand(), mlir::DataDescriptor::setSize(), mlir::structFuncArgTypeConverter(), vectorizeOperand(), mlir::quant::AnyQuantizedType::verify(), mlir::spirv::SampledImageType::verify(), mlir::quant::UniformQuantizedType::verify(), mlir::quant::UniformQuantizedPerAxisType::verify(), mlir::quant::CalibratedQuantizedType::verify(), verifyAtomicCompareExchangeImpl(), verifyConstantType(), verifyCoopMatrixMulAdd(), verifyPointerAndCoopMatrixType(), mlir::OpTrait::impl::verifyResultsAreFloatLike(), visitUpward(), walkReferenceCountedValues(), and wrapExternalFunction().
bool mlir::Type::isa | ( | ) | const |
bool Type::isBF16 | ( | ) | const |
Definition at line 21 of file Types.cpp.
Referenced by fltSemanticsForType(), getDialect(), mlir::quant::QuantizedType::isSigned(), mlir::spirv::ScalarType::isValid(), parseAndVerifyType(), and verifyMultShape().
bool Type::isF128 | ( | ) | const |
Definition at line 26 of file Types.cpp.
Referenced by fltSemanticsForType(), and getDialect().
bool Type::isF16 | ( | ) | const |
Definition at line 22 of file Types.cpp.
Referenced by fltSemanticsForType(), foldTransferInBoundsAttribute(), getDialect(), mlir::nvgpu::getMmaSyncRegisterType(), mlir::quant::QuantizedType::isSigned(), mlir::gpu::MMAMatrixType::isValidElementType(), and printNVVMIntrinsicOp().
bool Type::isF32 | ( | ) | const |
Definition at line 23 of file Types.cpp.
Referenced by convertFloatAttr(), fltSemanticsForType(), foldTransferInBoundsAttribute(), getDialect(), mlir::nvgpu::getMmaSyncRegisterType(), mlir::quant::QuantizedType::isSigned(), mlir::gpu::MMAMatrixType::isValidElementType(), mlir::sparse_tensor::primaryTypeEncoding(), printNVVMIntrinsicOp(), and verifyMultShape().
bool Type::isF64 | ( | ) | const |
Definition at line 24 of file Types.cpp.
Referenced by fltSemanticsForType(), getDialect(), mlir::nvgpu::getMmaSyncRegisterType(), mlir::quant::QuantizedType::isSigned(), parseElementAttrHexValues(), mlir::sparse_tensor::primaryTypeEncoding(), and printNVVMIntrinsicOp().
bool Type::isF80 | ( | ) | const |
Definition at line 25 of file Types.cpp.
Referenced by fltSemanticsForType(), and getDialect().
bool Type::isIndex | ( | ) | const |
Definition at line 28 of file Types.cpp.
Referenced by buildAttributeAPInt(), ceilDivPositive(), computeMemRefRankReductionMask(), foldMemRefCast(), mlir::detail::getDenseElementBitWidth(), getDialect(), mlir::Builder::getIntegerAttr(), mlir::linalg::getUpperBoundForIndex(), mlir::getValueOrCreateCastToIndexLike(), isMatchingWidth(), mlir::quant::QuantizedType::isSigned(), mlir::isValidDim(), isValidIntOrFloat(), mlir::isValidSymbol(), joinShapes(), and mlir::sparse_tensor::overheadTypeEncoding().
bool Type::isInteger | ( | unsigned | width | ) | const |
Return true if this is an integer type with the specified width.
Definition at line 31 of file Types.cpp.
Referenced by castBoolToIntN(), castIntNToBool(), createInitialValueForReduceOp(), createLinalgBodyCalculationForElementwiseOp(), createLinalgBodyCalculationForReduceOp(), getDialect(), mlir::nvgpu::getMmaSyncRegisterType(), isBoolScalarOrVector(), isMatchingWidth(), mlir::quant::QuantizedType::isSigned(), parseElementAttrHexValues(), mlir::sparse_tensor::primaryTypeEncoding(), and verifyMultShape().
bool Type::isIntOrFloat | ( | ) | const |
Return true if this is an integer (of any signedness) or a float type.
Definition at line 87 of file Types.cpp.
Referenced by mlir::spirv::Deserializer::collect(), getBitWidth(), getDialect(), isAllocationSupported(), isDefinedByCallTo(), ConvertAccessChain::matchAndRewrite(), and mlir::vector::ContractionOpToMatmulOpLowering::matchAndRewrite().
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::sparse_tensor::genIsNonzero(), getDialect(), isSupportedCombiningKind(), and parseElementAttrHexValues().
bool Type::isIntOrIndexOrFloat | ( | ) | const |
Return true if this is an integer (of any signedness), index, or float type.
Definition at line 89 of file Types.cpp.
Referenced by getDialect(), isBoolScalarOrVector(), mlir::vector::isBroadcastableTo(), isSupportedCombiningKind(), mlir::BaseMemRefType::isValidElementType(), TwoDimMultiReductionToElementWise::matchAndRewrite(), parseElementAttrHexValues(), and verifyRegionAttribute().
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().
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 SelectToExtUI::matchAndRewrite().
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(), and mlir::linalg::RegionMatcher::matchAsScalarBinaryOp().
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().
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().
bool Type::isUnsignedInteger | ( | ) | const |
Return true if this is an unsigned integer type (with the specified width).
Definition at line 61 of file Types.cpp.
Referenced by createLinalgBodyCalculationForElementwiseOp(), createReassociationMapsForCollapse(), getDialect(), isUnsignedIntegerOrVector(), mlir::detail::Parser::parseDecOrHexAttr(), parseElementAttrHexValues(), and mlir::AsmPrinter::Impl::printDenseIntOrFPElementsAttr().
|
inlineexplicit |
|
inline |
Definition at line 95 of file Types.h.
References cast(), dyn_cast(), dyn_cast_or_null(), and isa().
|
inline |
|
inline |
void Type::print | ( | raw_ostream & | os | ) | const |
Print the current type.
Definition at line 3027 of file AsmPrinter.cpp.
References mlir::AsmPrinter::Impl::printType().
Referenced by getDialect(), and mlir::operator<<().
|
friend |
Definition at line 230 of file Types.h.
Referenced by getDialect().
|
protected |
Definition at line 182 of file Types.h.
Referenced by getAsOpaquePointer(), mlir::hash_value(), operator bool(), and operator==().