LLVM  13.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
llvm::Type Class Reference

The instances of the Type class are immutable: once they are created, they are never changed. More...

#include "llvm/IR/Type.h"

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

Public Types

enum  TypeID {
  HalfTyID = 0, BFloatTyID, FloatTyID, DoubleTyID,
  X86_FP80TyID, FP128TyID, PPC_FP128TyID, VoidTyID,
  LabelTyID, MetadataTyID, X86_MMXTyID, X86_AMXTyID,
  TokenTyID, IntegerTyID, FunctionTyID, PointerTyID,
  StructTyID, ArrayTyID, FixedVectorTyID, ScalableVectorTyID
}
 Definitions of all of the base types for the Type system. More...
 
using subtype_iterator = Type *const *
 
using subtype_reverse_iterator = std::reverse_iterator< subtype_iterator >
 

Public Member Functions

void print (raw_ostream &O, bool IsForDebug=false, bool NoDetails=false) const
 Print the current type. More...
 
void dump () const
 
LLVMContextgetContext () const
 Return the LLVMContext in which this type was uniqued. More...
 
TypeID getTypeID () const
 Return the type id for the type. More...
 
bool isVoidTy () const
 Return true if this is 'void'. More...
 
bool isHalfTy () const
 Return true if this is 'half', a 16-bit IEEE fp type. More...
 
bool isBFloatTy () const
 Return true if this is 'bfloat', a 16-bit bfloat type. More...
 
bool isFloatTy () const
 Return true if this is 'float', a 32-bit IEEE fp type. More...
 
bool isDoubleTy () const
 Return true if this is 'double', a 64-bit IEEE fp type. More...
 
bool isX86_FP80Ty () const
 Return true if this is x86 long double. More...
 
bool isFP128Ty () const
 Return true if this is 'fp128'. More...
 
bool isPPC_FP128Ty () const
 Return true if this is powerpc long double. More...
 
bool isFloatingPointTy () const
 Return true if this is one of the six floating-point types. More...
 
const fltSemanticsgetFltSemantics () const
 
bool isX86_MMXTy () const
 Return true if this is X86 MMX. More...
 
bool isX86_AMXTy () const
 Return true if this is X86 AMX. More...
 
bool isFPOrFPVectorTy () const
 Return true if this is a FP type or a vector of FP. More...
 
bool isLabelTy () const
 Return true if this is 'label'. More...
 
bool isMetadataTy () const
 Return true if this is 'metadata'. More...
 
bool isTokenTy () const
 Return true if this is 'token'. More...
 
bool isIntegerTy () const
 True if this is an instance of IntegerType. More...
 
bool isIntegerTy (unsigned Bitwidth) const
 Return true if this is an IntegerType of the given width. More...
 
bool isIntOrIntVectorTy () const
 Return true if this is an integer type or a vector of integer types. More...
 
bool isIntOrIntVectorTy (unsigned BitWidth) const
 Return true if this is an integer type or a vector of integer types of the given width. More...
 
bool isIntOrPtrTy () const
 Return true if this is an integer type or a pointer type. More...
 
bool isFunctionTy () const
 True if this is an instance of FunctionType. More...
 
bool isStructTy () const
 True if this is an instance of StructType. More...
 
bool isArrayTy () const
 True if this is an instance of ArrayType. More...
 
bool isPointerTy () const
 True if this is an instance of PointerType. More...
 
bool isPtrOrPtrVectorTy () const
 Return true if this is a pointer type or a vector of pointer types. More...
 
bool isVectorTy () const
 True if this is an instance of VectorType. More...
 
bool canLosslesslyBitCastTo (Type *Ty) const
 Return true if this type could be converted with a lossless BitCast to type 'Ty'. More...
 
bool isEmptyTy () const
 Return true if this type is empty, that is, it has no elements or all of its elements are empty. More...
 
bool isFirstClassType () const
 Return true if the type is "first class", meaning it is a valid type for a Value. More...
 
bool isSingleValueType () const
 Return true if the type is a valid type for a register in codegen. More...
 
bool isAggregateType () const
 Return true if the type is an aggregate type. More...
 
bool isSized (SmallPtrSetImpl< Type * > *Visited=nullptr) const
 Return true if it makes sense to take the size of this type. More...
 
TypeSize getPrimitiveSizeInBits () const LLVM_READONLY
 Return the basic size of this type if it is a primitive type. More...
 
unsigned getScalarSizeInBits () const LLVM_READONLY
 If this is a vector type, return the getPrimitiveSizeInBits value for the element type. More...
 
int getFPMantissaWidth () const
 Return the width of the mantissa of this type. More...
 
bool isIEEE () const
 Return whether the type is IEEE compatible, as defined by the eponymous method in APFloat. More...
 
TypegetScalarType () const
 If this is a vector type, return the element type, otherwise return 'this'. More...
 
subtype_iterator subtype_begin () const
 
subtype_iterator subtype_end () const
 
ArrayRef< Type * > subtypes () const
 
subtype_reverse_iterator subtype_rbegin () const
 
subtype_reverse_iterator subtype_rend () const
 
TypegetContainedType (unsigned i) const
 This method is used to implement the type iterator (defined at the end of the file). More...
 
unsigned getNumContainedTypes () const
 Return the number of types in the derived type. More...
 
unsigned getIntegerBitWidth () const
 
TypegetFunctionParamType (unsigned i) const
 
unsigned getFunctionNumParams () const
 
bool isFunctionVarArg () const
 
StringRef getStructName () const
 
unsigned getStructNumElements () const
 
TypegetStructElementType (unsigned N) const
 
uint64_t getArrayNumElements () const
 
TypegetArrayElementType () const
 
TypegetPointerElementType () const
 
TypegetWithNewType (Type *EltTy) const
 Given vector type, change the element type, whilst keeping the old number of elements. More...
 
TypegetWithNewBitWidth (unsigned NewBitWidth) const
 Given an integer or vector type, change the lane bitwidth to NewBitwidth, whilst keeping the old number of lanes. More...
 
TypegetExtendedType () const
 Given scalar/vector integer type, returns a type with elements twice as wide as in the original type. More...
 
unsigned getPointerAddressSpace () const
 Get the address space of this pointer or pointer vector type. More...
 
PointerTypegetPointerTo (unsigned AddrSpace=0) const
 Return a pointer to the current type. More...
 

Static Public Member Functions

static TypegetPrimitiveType (LLVMContext &C, TypeID IDNumber)
 Return a type based on an identifier. More...
 
static TypegetVoidTy (LLVMContext &C)
 
static TypegetLabelTy (LLVMContext &C)
 
static TypegetHalfTy (LLVMContext &C)
 
static TypegetBFloatTy (LLVMContext &C)
 
static TypegetFloatTy (LLVMContext &C)
 
static TypegetDoubleTy (LLVMContext &C)
 
static TypegetMetadataTy (LLVMContext &C)
 
static TypegetX86_FP80Ty (LLVMContext &C)
 
static TypegetFP128Ty (LLVMContext &C)
 
static TypegetPPC_FP128Ty (LLVMContext &C)
 
static TypegetX86_MMXTy (LLVMContext &C)
 
static TypegetX86_AMXTy (LLVMContext &C)
 
static TypegetTokenTy (LLVMContext &C)
 
static IntegerTypegetIntNTy (LLVMContext &C, unsigned N)
 
static IntegerTypegetInt1Ty (LLVMContext &C)
 
static IntegerTypegetInt8Ty (LLVMContext &C)
 
static IntegerTypegetInt16Ty (LLVMContext &C)
 
static IntegerTypegetInt32Ty (LLVMContext &C)
 
static IntegerTypegetInt64Ty (LLVMContext &C)
 
static IntegerTypegetInt128Ty (LLVMContext &C)
 
template<typename ScalarTy >
static TypegetScalarTy (LLVMContext &C)
 
static TypegetFloatingPointTy (LLVMContext &C, const fltSemantics &S)
 
static PointerTypegetHalfPtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetBFloatPtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetFloatPtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetDoublePtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetX86_FP80PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetFP128PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetPPC_FP128PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetX86_MMXPtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetX86_AMXPtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetIntNPtrTy (LLVMContext &C, unsigned N, unsigned AS=0)
 
static PointerTypegetInt1PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetInt8PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetInt16PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetInt32PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetInt64PtrTy (LLVMContext &C, unsigned AS=0)
 

Protected Member Functions

 Type (LLVMContext &C, TypeID tid)
 
 ~Type ()=default
 
unsigned getSubclassData () const
 
void setSubclassData (unsigned val)
 

Protected Attributes

unsigned NumContainedTys = 0
 Keeps track of how many Type*'s there are in the ContainedTys list. More...
 
Type *constContainedTys = nullptr
 A pointer to the array of Types contained by this Type. More...
 

Friends

class LLVMContextImpl
 

Detailed Description

The instances of the Type class are immutable: once they are created, they are never changed.

Also note that only one instance of a particular type is ever created. Thus seeing if two types are equal is a matter of doing a trivial pointer comparison. To enforce that no two equal instances are created, Type instances can only be created via static factory methods in class Type and in derived classes. Once allocated, Types are never free'd.

Definition at line 46 of file Type.h.

Member Typedef Documentation

◆ subtype_iterator

Definition at line 326 of file Type.h.

◆ subtype_reverse_iterator

Definition at line 334 of file Type.h.

Member Enumeration Documentation

◆ TypeID

Definitions of all of the base types for the Type system.

Based on this value, you can cast to a class defined in DerivedTypes.h. Note: If you add an element to this, you need to add an element to the Type::getPrimitiveType function, or else things will break! Also update LLVMTypeKind and LLVMGetTypeKind () in the C binding.

Enumerator
HalfTyID 

16-bit floating point type

BFloatTyID 

16-bit floating point type (7-bit significand)

FloatTyID 

32-bit floating point type

DoubleTyID 

64-bit floating point type

X86_FP80TyID 

80-bit floating point type (X87)

FP128TyID 

128-bit floating point type (112-bit significand)

PPC_FP128TyID 

128-bit floating point type (two 64-bits, PowerPC)

VoidTyID 

type with no size

LabelTyID 

Labels.

MetadataTyID 

Metadata.

X86_MMXTyID 

MMX vectors (64 bits, X86 specific)

X86_AMXTyID 

AMX vectors (8192 bits, X86 specific)

TokenTyID 

Tokens.

IntegerTyID 

Arbitrary bit width integers.

FunctionTyID 

Functions.

PointerTyID 

Pointers.

StructTyID 

Structures.

ArrayTyID 

Arrays.

FixedVectorTyID 

Fixed width SIMD vector type.

ScalableVectorTyID 

Scalable SIMD vector type.

Definition at line 55 of file Type.h.

Constructor & Destructor Documentation

◆ Type()

llvm::Type::Type ( LLVMContext C,
TypeID  tid 
)
inlineexplicitprotected

Definition at line 93 of file Type.h.

Referenced by llvm::object::MinidumpFile::create().

◆ ~Type()

llvm::Type::~Type ( )
protecteddefault

Member Function Documentation

◆ canLosslesslyBitCastTo()

bool Type::canLosslesslyBitCastTo ( Type Ty) const

Return true if this type could be converted with a lossless BitCast to type 'Ty'.

For example, i8* to i32*. BitCasts are valid for types of the same size only where no re-interpretation of the bits is done. Determine if this type could be losslessly bitcast to Ty

Definition at line 63 of file Type.cpp.

References llvm::TypeSize::getFixedSize(), getPrimitiveSizeInBits(), isFirstClassType(), isX86_AMXTy(), and isX86_MMXTy().

◆ dump()

LLVM_DUMP_METHOD void Type::dump ( ) const

◆ getArrayElementType()

Type* llvm::Type::getArrayElementType ( ) const
inline

◆ getArrayNumElements()

uint64_t llvm::Type::getArrayNumElements ( ) const
inline

◆ getBFloatPtrTy()

PointerType * Type::getBFloatPtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 209 of file Type.cpp.

References getBFloatTy(), and getPointerTo().

◆ getBFloatTy()

Type * Type::getBFloatTy ( LLVMContext C)
static

◆ getContainedType()

Type* llvm::Type::getContainedType ( unsigned  i) const
inline

This method is used to implement the type iterator (defined at the end of the file).

For derived types, this returns the types 'contained' in the derived type.

Definition at line 346 of file Type.h.

References assert(), ContainedTys, i, and NumContainedTys.

Referenced by getScalarType(), llvm::X86TTIImpl::getTypeBasedIntrinsicInstrCost(), and llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getTypeBasedIntrinsicInstrCost().

◆ getContext()

LLVMContext& llvm::Type::getContext ( ) const
inline

Return the LLVMContext in which this type was uniqued.

Definition at line 128 of file Type.h.

References Context.

Referenced by llvm::InnerLoopVectorizer::buildScalarSteps(), llvm::VNCoercion::coerceAvailableValueToLoadTypeHelper(), llvm::ConstantFoldGetElementPtr(), llvm::convertPointerToIntegerType(), llvm::ShuffleVectorInst::convertShuffleMaskForBitcode(), llvm::StructType::create(), llvm::MatrixBuilder< IRBuilderTy >::CreateExtractElement(), llvm::orc::createIRTypedAddress(), llvm::FunctionLoweringInfo::CreateRegs(), evaluateBitcastFromPtr(), FoldBitCast(), foldConstantCastPair(), llvm::InlineAsm::get(), llvm::ConstantInt::get(), llvm::StructType::get(), llvm::ConstantFP::get(), llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::ConstantVector::get(), llvm::FixedVectorType::get(), llvm::ScalableVectorType::get(), llvm::PointerType::get(), llvm::ConstantExpr::getAlignOf(), getAllocationDataForFunction(), llvm::Constant::getAllOnesValue(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getArithmeticReductionCost(), llvm::AArch64TTIImpl::getArithmeticReductionCostSVE(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getCastInstrCost(), llvm::BasicBlock::getContext(), llvm::Function::getContext(), llvm::Value::getContext(), llvm::EVT::getEVT(), llvm::IntegerType::getExtendedType(), llvm::ConstantInt::getFalse(), llvm::ConstantExpr::getFCmp(), getFoldedCast(), llvm::ConstantExpr::getICmp(), llvm::ConstantDataSequential::getImpl(), llvm::DataLayout::getIndexType(), llvm::ConstantFP::getInfinity(), llvm::VectorType::getInteger(), llvm::Constant::getIntegerValue(), llvm::DataLayout::getIntPtrType(), llvm::VNCoercion::getLoadValueForLoad(), llvm::VNCoercion::getMemInstValueForLoadHelper(), llvm::TargetLoweringBase::getMemValueType(), llvm::AArch64TTIImpl::getMinMaxReductionCost(), llvm::ConstantFP::getNaN(), llvm::ConstantFP::getNegativeZero(), llvm::Constant::getNullValue(), llvm::ConstantExpr::getOffsetOf(), getPromotedType(), llvm::ConstantFP::getQNaN(), getReturnAttrs(), llvm::CallLowering::getReturnInfo(), llvm::ConstantExpr::getShuffleVector(), llvm::ConstantExpr::getSizeOf(), llvm::ConstantFP::getSNaN(), llvm::ConstantVector::getSplat(), llvm::InnerLoopVectorizer::getStepVector(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::ConstantInt::getTrue(), llvm::VectorType::getTruncatedElementVectorType(), llvm::TargetLoweringBase::getTypeLegalizationCost(), getTypePartition(), llvm::TargetLoweringBase::getValueType(), getWithNewBitWidth(), llvm::ValueAsMetadata::handleDeletion(), hasLifetimeMarkers(), llvm::CallLowering::insertSRetIncomingArgument(), IsIncrementNSW(), IsIncrementNUW(), isIntegerWideningViable(), isVectorPromotionViableForSlice(), LLVMConstIntOfArbitraryPrecision(), llvm::FastISel::lowerCallTo(), llvm::TargetLowering::LowerCallTo(), llvm::AArch64CallLowering::lowerReturn(), llvm::CmpInst::makeCmpResultType(), memVTFromImageData(), llvm::TargetLowering::ParseConstraints(), llvm::GCNTTIImpl::rewriteIntrinsicWithAddressSpace(), llvm::StructType::setBody(), setInfoSVEStN(), llvm::StructType::setName(), llvm::ARMTargetLowering::shouldConvertSplatType(), SimplifyGEPInst(), llvm::CallLowering::splitToValueTypes(), llvm::InnerLoopVectorizer::truncateToMinimalBitwidths(), and llvm::MetadataAsValue::~MetadataAsValue().

◆ getDoublePtrTy()

PointerType * Type::getDoublePtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 217 of file Type.cpp.

References getDoubleTy(), and getPointerTo().

◆ getDoubleTy()

Type * Type::getDoubleTy ( LLVMContext C)
static

◆ getExtendedType()

Type * llvm::Type::getExtendedType ( ) const
inline

Given scalar/vector integer type, returns a type with elements twice as wide as in the original type.

For vectors, preserves element count.

Definition at line 670 of file DerivedTypes.h.

References assert(), llvm::VectorType::getExtendedElementVectorType(), and isIntOrIntVectorTy().

Referenced by dropRedundantMaskingOfLeftShiftInput().

◆ getFloatingPointTy()

static Type* llvm::Type::getFloatingPointTy ( LLVMContext C,
const fltSemantics S 
)
inlinestatic

◆ getFloatPtrTy()

PointerType * Type::getFloatPtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 213 of file Type.cpp.

References getFloatTy(), and getPointerTo().

◆ getFloatTy()

Type * Type::getFloatTy ( LLVMContext C)
static

◆ getFltSemantics()

const fltSemantics& llvm::Type::getFltSemantics ( ) const
inline

◆ getFP128PtrTy()

PointerType * Type::getFP128PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 225 of file Type.cpp.

References getFP128Ty(), and getPointerTo().

◆ getFP128Ty()

Type * Type::getFP128Ty ( LLVMContext C)
static

◆ getFPMantissaWidth()

int Type::getFPMantissaWidth ( ) const

Return the width of the mantissa of this type.

This is only valid on floating-point types. If the FP type does not have a stable mantissa (e.g. ppc long double), this method returns -1.

Definition at line 152 of file Type.cpp.

References assert(), BFloatTyID, DoubleTyID, FloatTyID, FP128TyID, getTypeID(), HalfTyID, isFloatingPointTy(), PPC_FP128TyID, and X86_FP80TyID.

Referenced by llvm::InstCombinerImpl::foldFCmpIntToFPConst(), isKnownExactCastIntToFP(), shrinkFPConstantVector(), and llvm::InstCombinerImpl::visitFPTrunc().

◆ getFunctionNumParams()

unsigned llvm::Type::getFunctionNumParams ( ) const
inline

Definition at line 156 of file DerivedTypes.h.

◆ getFunctionParamType()

Type * llvm::Type::getFunctionParamType ( unsigned  i) const
inline

Definition at line 152 of file DerivedTypes.h.

References i.

Referenced by llvm::isLegalToPromote().

◆ getHalfPtrTy()

PointerType * Type::getHalfPtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 205 of file Type.cpp.

References getHalfTy(), and getPointerTo().

◆ getHalfTy()

Type * Type::getHalfTy ( LLVMContext C)
static

◆ getInt128Ty()

IntegerType * Type::getInt128Ty ( LLVMContext C)
static

◆ getInt16PtrTy()

PointerType * Type::getInt16PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 253 of file Type.cpp.

References getInt16Ty(), and getPointerTo().

◆ getInt16Ty()

IntegerType * Type::getInt16Ty ( LLVMContext C)
static

◆ getInt1PtrTy()

PointerType * Type::getInt1PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

◆ getInt1Ty()

IntegerType * Type::getInt1Ty ( LLVMContext C)
static

◆ getInt32PtrTy()

PointerType * Type::getInt32PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 257 of file Type.cpp.

References getInt32Ty(), and getPointerTo().

◆ getInt32Ty()

IntegerType * Type::getInt32Ty ( LLVMContext C)
static

Definition at line 197 of file Type.cpp.

Referenced by llvm::Module::addModuleFlag(), llvm::annotateValueSite(), BuildConstantFromSCEV(), OutlinableGroup::collectGVNStoreSets(), llvm::ConstantFoldInsertElementInstruction(), llvm::convertPointerToIntegerType(), llvm::ShuffleVectorInst::convertShuffleMaskForBitcode(), llvm::ARMConstantPoolConstant::Create(), llvm::MDBuilder::createBranchWeights(), llvm::IRBuilderBase::CreateConstGEP1_32(), llvm::IRBuilderBase::CreateConstGEP2_32(), llvm::IRBuilderBase::CreateConstInBoundsGEP1_32(), llvm::IRBuilderBase::CreateConstInBoundsGEP2_32(), llvm::OpenMPIRBuilder::createDynamicWorkshareLoop(), llvm::IRBuilderBase::CreateGlobalStringPtr(), llvm::IRBuilderBase::CreatePreserveArrayAccessIndex(), llvm::IRBuilderBase::CreatePreserveStructAccessIndex(), createPrivateGlobalForSourceLoc(), createRelLookupTable(), llvm::OpenMPIRBuilder::createSections(), llvm::OpenMPIRBuilder::createStaticWorkshareLoop(), createStringMetadata(), createSwitchStatement(), doPromotion(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), emitThumb1LoadConstPool(), emitThumb2LoadConstPool(), evaluateInDifferentElementOrder(), findCostForOutputBlocks(), llvm::SanitizerStatReport::finish(), FoldBitCast(), foldInsSequenceIntoSplat(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::IntegerType::get(), llvm::ConstantDataVector::get(), getAISize(), llvm::ConstantExpr::getAlignOf(), getDefaultPersonalityFn(), getInt32PtrTy(), llvm::IRBuilderBase::getInt32Ty(), getIntrinsicParamType(), llvm::OpenMPIRBuilder::getLanemaskType(), llvm::GCNTTIImpl::getMemcpyLoopLoweringType(), llvm::GCNTTIImpl::getMemcpyLoopResidualLoweringType(), getOffsetFromIndices(), llvm::ConstantExpr::getOffsetOf(), getPromotedType(), llvm::ConstantExpr::getSizeOf(), llvm::ConstantVector::getSplat(), llvm::EVT::getTypeForEVT(), insertCall(), llvm::BPFCoreSharedInfo::insertPassThrough(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::isBytewiseValue(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), llvm::ARMTTIImpl::isHardwareLoopProfitable(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::LegalizerHelper::libcall(), LLVMBuildArrayMalloc(), LLVMBuildMalloc(), LLVMInt32TypeInContext(), llvm::XCoreInstrInfo::loadImmediate(), llvm::X86TargetLowering::LowerAsmOperandForConstraint(), llvm::SparcTargetLowering::LowerF128Compare(), llvm::IntrinsicLowering::LowerIntrinsicCall(), lowerLoadRelative(), llvm::MergeBasicBlockIntoOnlyPred(), llvm::EscapeEnumerator::Next(), replaceCalledFunction(), runPass(), SegmentOffset(), llvm::ARMTargetLowering::shouldConvertSplatType(), llvm::InstCombinerImpl::SimplifyDemandedVectorElts(), SimplifyRelativeLoad(), splitGlobal(), SRAGlobal(), unpackLoadToAggregate(), unpackStoreToAggregate(), llvm::CallInst::updateProfWeight(), llvm::UpgradeIntrinsicCall(), llvm::UpgradeModuleFlags(), validExtractValueIndex(), validInsertValueIndex(), validShuffleVectorIndex(), llvm::InstCombinerImpl::visitBitCast(), llvm::InstCombinerImpl::visitExtractElementInst(), llvm::InstCombinerImpl::visitShuffleVectorInst(), and llvm::BasicBlock::~BasicBlock().

◆ getInt64PtrTy()

PointerType * Type::getInt64PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 261 of file Type.cpp.

References getInt64Ty(), and getPointerTo().

◆ getInt64Ty()

IntegerType * Type::getInt64Ty ( LLVMContext C)
static

Definition at line 198 of file Type.cpp.

Referenced by addModuleFlags(), llvm::GlobalObject::addTypeMetadata(), llvm::VNCoercion::analyzeLoadFromClobberingMemInst(), llvm::annotateValueSite(), llvm::MDBuilder::createCallbackEncoding(), llvm::IRBuilderBase::CreateConstGEP1_64(), llvm::IRBuilderBase::CreateConstGEP2_64(), llvm::IRBuilderBase::CreateConstInBoundsGEP1_64(), llvm::IRBuilderBase::CreateConstInBoundsGEP2_64(), llvm::MDBuilder::createFunctionEntryCount(), llvm::createIRLevelProfileFlagVar(), llvm::MDBuilder::createIrrLoopHeaderWeight(), llvm::orc::createIRTypedAddress(), llvm::MDBuilder::createPseudoProbeDesc(), llvm::IRBuilderBase::CreatePtrDiff(), llvm::MDBuilder::createTBAAAccessTag(), llvm::MDBuilder::createTBAANode(), llvm::MDBuilder::createTBAAScalarTypeNode(), llvm::MDBuilder::createTBAAStructNode(), llvm::MDBuilder::createTBAAStructTagNode(), llvm::MDBuilder::createTBAAStructTypeNode(), llvm::MDBuilder::createTBAATypeNode(), doPromotion(), llvm::orc::IRSpeculationLayer::emit(), llvm::AMDGPU::HSAMD::MetadataStreamerV3::emitHiddenKernelArgs(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::AlignmentFromAssumptionsPass::extractAlignmentInfo(), foldConstantCastPair(), genLoopLimit(), llvm::IntegerType::get(), llvm::ConstantDataVector::get(), llvm::ConstantExpr::getAlignOf(), getInt64PtrTy(), llvm::IRBuilderBase::getInt64Ty(), getIntrinsicParamType(), getKeyValMD(), llvm::OpenMPIRBuilder::getLanemaskType(), llvm::GCNTTIImpl::getMemcpyLoopResidualLoweringType(), llvm::VNCoercion::getMemInstValueForLoadHelper(), llvm::ConstantExpr::getOffsetOf(), llvm::DIBuilder::getOrCreateSubrange(), llvm::ConstantExpr::getSizeOf(), llvm::InstrProfIncrementInst::getStep(), llvm::EVT::getTypeForEVT(), llvm::InlineFunction(), insertLifetimeMarkersSurroundingCall(), instCombineSVEDup(), instCombineSVELast(), llvm::isBytewiseValue(), llvm::PPCTTIImpl::isHardwareLoopProfitable(), llvm::LegalizerHelper::libcall(), LLVMInt64TypeInContext(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::GlobalObject::setVCallVisibilityMetadata(), llvm::AArch64TTIImpl::shouldConsiderAddressTypePromotion(), SimplifyRelativeLoad(), simplifyX86extrq(), unpackLoadToAggregate(), unpackStoreToAggregate(), llvm::CallInst::updateProfWeight(), llvm::UpgradeBitCastExpr(), llvm::UpgradeBitCastInst(), llvm::UpgradeTBAANode(), and llvm::InstCombinerImpl::visitCallInst().

◆ getInt8PtrTy()

PointerType * Type::getInt8PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 249 of file Type.cpp.

References getInt8Ty(), and getPointerTo().

Referenced by llvm::addRuntimeChecks(), llvm::VNCoercion::analyzeLoadFromClobberingMemInst(), appendToUsedList(), BuildConstantFromSCEV(), llvm::coro::Shape::buildFrom(), llvm::CoroIdInst::clearPromise(), createDevirtTriggerFunc(), createFree(), CreateGCRelocates(), createMalloc(), llvm::createMemLibcall(), CreatePrologue(), llvm::AMDGPU::HSAMD::MetadataStreamerV3::emitHiddenKernelArgs(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::AArch64SelectionDAGInfo::EmitTargetCodeForMemset(), expandBounds(), llvm::CodeExtractor::findAllocas(), llvm::SanitizerStatReport::finish(), getAllocationDataForFunction(), llvm::TargetLoweringBase::getDefaultSafeStackPointerLocation(), llvm::IRBuilderBase::getInt8PtrTy(), llvm::TargetLoweringBase::getIRStackGuard(), llvm::SCEVExpander::getIVIncOperand(), llvm::VNCoercion::getMemInstValueForLoadHelper(), getNaturalGEPWithOffset(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), hasLifetimeMarkers(), insertCall(), insertLifetimeMarkersSurroundingCall(), llvm::ARMTargetLowering::insertSSPDeclarations(), llvm::AArch64TargetLowering::insertSSPDeclarations(), llvm::X86TargetLowering::insertSSPDeclarations(), llvm::TargetLoweringBase::insertSSPDeclarations(), instrumentOneFunc(), llvm::isLibFreeFunction(), llvm::TargetLowering::LowerToTLSEmulatedModel(), LowerToTLSExecModel(), llvm::EscapeEnumerator::Next(), prepareForSplit(), RemovePreallocated(), replaceAsyncResumeFunction(), llvm::coro::replaceCoroFree(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::SanitizerStatReport::SanitizerStatReport(), SegmentOffset(), setCoroInfo(), llvm::CoroIdInst::setCoroutineSelf(), setUsedInitializer(), SimplifyRelativeLoad(), splitAsyncCoroutine(), and llvm::SelectionDAGBuilder::visitSPDescriptorParent().

◆ getInt8Ty()

IntegerType * Type::getInt8Ty ( LLVMContext C)
static

◆ getIntegerBitWidth()

unsigned llvm::Type::getIntegerBitWidth ( ) const
inline

◆ getIntNPtrTy()

PointerType * Type::getIntNPtrTy ( LLVMContext C,
unsigned  N,
unsigned  AS = 0 
)
static

Definition at line 241 of file Type.cpp.

References getIntNTy(), getPointerTo(), and N.

◆ getIntNTy()

IntegerType * Type::getIntNTy ( LLVMContext C,
unsigned  N 
)
static

◆ getLabelTy()

Type * Type::getLabelTy ( LLVMContext C)
static

Definition at line 181 of file Type.cpp.

Referenced by getPrimitiveType(), and LLVMLabelTypeInContext().

◆ getMetadataTy()

Type * Type::getMetadataTy ( LLVMContext C)
static

◆ getNumContainedTypes()

unsigned llvm::Type::getNumContainedTypes ( ) const
inline

Return the number of types in the derived type.

Definition at line 352 of file Type.h.

References NumContainedTys.

◆ getPointerAddressSpace()

unsigned llvm::Type::getPointerAddressSpace ( ) const
inline

Get the address space of this pointer or pointer vector type.

Definition at line 693 of file DerivedTypes.h.

References getScalarType().

Referenced by AddNonNullPointer(), llvm::AMDGPUAAResult::alias(), llvm::VNCoercion::analyzeLoadFromClobberingMemInst(), annotateDereferenceableBytes(), annotateNonNullNoUndefBasedOnAccess(), BuildConstantFromSCEV(), llvm::VNCoercion::canCoerceMustAliasedValueToLoad(), canConvertValue(), llvm::castToCStr(), cloneConstantExprWithNewAddressSpace(), llvm::orc::cloneGlobalAliasDecl(), llvm::InstCombinerImpl::combineLoadToNewType(), llvm::ConstantFoldCastOperand(), convertValue(), llvm::CastInst::CreatePointerBitCastOrAddrSpaceCast(), expandBounds(), llvm::InstCombinerImpl::foldGEPICmp(), llvm::InstCombinerImpl::foldICmpWithCastOp(), getAccessType(), llvm::IntToPtrInst::getAddressSpace(), llvm::AMDGPUTargetMachine::getAssumedAddrSpace(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getCastInstrCost(), llvm::CastInst::getCastOpcode(), llvm::AddrSpaceCastOperator::getDestAddressSpace(), llvm::AddrSpaceCastInst::getDestAddressSpace(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getGEPCost(), llvm::GetElementPtrInst::getGEPReturnType(), llvm::VNCoercion::getLoadValueForLoad(), llvm::VNCoercion::getMemInstValueForLoadHelper(), llvm::Module::getOrInsertGlobal(), llvm::LoadInst::getPointerAddressSpace(), llvm::StoreInst::getPointerAddressSpace(), llvm::GEPOperator::getPointerAddressSpace(), llvm::AtomicCmpXchgInst::getPointerAddressSpace(), llvm::AtomicRMWInst::getPointerAddressSpace(), llvm::GetElementPtrInst::getPointerAddressSpace(), llvm::PtrToIntInst::getPointerAddressSpace(), llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(), llvm::ConstantExpr::getPointerCast(), llvm::getPointersDiff(), llvm::AddrSpaceCastOperator::getSrcAddressSpace(), llvm::AddrSpaceCastInst::getSrcAddressSpace(), llvm::DataLayout::getTypeSizeInBits(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getUserCost(), llvm::SelectionDAGBuilder::getValueImpl(), llvm::AMDGPU::HSAMD::MetadataStreamerV3::getValueKind(), hasLifetimeMarkers(), isCompatibleIVType(), llvm::CastInst::isEliminableCastPair(), isKnownNonNullFromDominatingCondition(), isKnownNonZeroFromAssume(), isUnsupportedAMDGPUAddrspace(), llvm::TargetLoweringObjectFileELF::lowerRelativeReference(), llvm::TargetLoweringObjectFileCOFF::lowerRelativeReference(), llvm::TargetLoweringObjectFileWasm::lowerRelativeReference(), llvm::MachinePointerInfo::MachinePointerInfo(), maybePrintCallAddrSpace(), optimizeMemCmpConstantSize(), optimizeOnceStoredGlobal(), PerformHeapAllocSRoA(), llvm::AMDGPUAAResult::pointsToConstantMemory(), llvm::GCNTTIImpl::rewriteIntrinsicWithAddressSpace(), scalarizeMaskedLoad(), scalarizeMaskedStore(), shouldBeMustTail(), shouldInstrumentReadWriteFromAddress(), simplifyInvariantGroupIntrinsic(), llvm::UpgradeBitCastExpr(), llvm::UpgradeBitCastInst(), llvm::InnerLoopVectorizer::vectorizeInterleaveGroup(), llvm::InstCombinerImpl::visitAllocaInst(), and llvm::InstCombinerImpl::visitGetElementPtrInst().

◆ getPointerElementType()

Type* llvm::Type::getPointerElementType ( ) const
inline

◆ getPointerTo()

PointerType * Type::getPointerTo ( unsigned  AddrSpace = 0) const

Return a pointer to the current type.

This is equivalent to PointerType::get(Foo, AddrSpace).

Definition at line 709 of file Type.cpp.

References llvm::PointerType::get().

Referenced by buildFrameType(), llvm::InstCombinerImpl::combineLoadToNewType(), combineStoreToNewValue(), createCmpXchgInstFun(), llvm::OpenMPIRBuilder::createOffloadMapnames(), llvm::EmbedBitcodeInModule(), llvm::orc::IRSpeculationLayer::emit(), emitSetSwiftErrorValue(), llvm::HexagonTargetLowering::emitStoreConditional(), getAdjustedPtr(), llvm::ConstantExpr::getAlignOf(), getBFloatPtrTy(), getDoublePtrTy(), getFloatPtrTy(), getFP128PtrTy(), llvm::ConstantExpr::getGetElementPtr(), getHalfPtrTy(), getInt16PtrTy(), getInt1PtrTy(), getInt32PtrTy(), getInt64PtrTy(), getInt8PtrTy(), getIntNPtrTy(), getIntrinsicParamType(), llvm::OpenMPIRBuilder::getOrCreateRuntimeFunction(), getPPC_FP128PtrTy(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), llvm::ScalarEvolution::getSizeOfScalableVectorExpr(), getX86_AMXPtrTy(), getX86_FP80PtrTy(), getX86_MMXPtrTy(), insertSpills(), llvm::CallLowering::insertSRetLoads(), llvm::CallLowering::insertSRetStores(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedStore(), lowerLoadRelative(), lowerSubFn(), operandWithNewAddressSpaceOrCreateUndef(), optimizeMemCmpConstantSize(), llvm::ExecutionEngine::runFunctionAsMain(), scalarizeMaskedLoad(), scalarizeMaskedStore(), SegmentOffset(), SimplifyRelativeLoad(), splitMergedValStore(), splitRetconCoroutine(), tryPromoteAllocaToVector(), UseTlsOffset(), and llvm::InnerLoopVectorizer::vectorizeInterleaveGroup().

◆ getPPC_FP128PtrTy()

PointerType * Type::getPPC_FP128PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 229 of file Type.cpp.

References getPointerTo(), and getPPC_FP128Ty().

◆ getPPC_FP128Ty()

Type * Type::getPPC_FP128Ty ( LLVMContext C)
static

◆ getPrimitiveSizeInBits()

TypeSize Type::getPrimitiveSizeInBits ( ) const

Return the basic size of this type if it is a primitive type.

These are fixed by LLVM and are not target-dependent. This will return zero if the type does not have a size or is not a primitive type.

If this is a scalable vector type, the scalable property will be set and the runtime size will be a positive integer multiple of the base size.

Note that this may not reflect the size of memory allocated for an instance of the type or the number of bytes that are written when an instance of the type is stored to memory. The DataLayout class provides additional query functions to provide this information.

Definition at line 122 of file Type.cpp.

References assert(), BFloatTyID, DoubleTyID, llvm::TypeSize::Fixed(), FixedVectorTyID, FloatTyID, FP128TyID, getBitWidth(), llvm::VectorType::getElementCount(), llvm::VectorType::getElementType(), llvm::TypeSize::getFixedSize(), getPrimitiveSizeInBits(), getTypeID(), HalfTyID, IntegerTyID, llvm::LinearPolySize< LeafTy >::isScalable(), PPC_FP128TyID, ScalableVectorTyID, X86_AMXTyID, X86_FP80TyID, and X86_MMXTyID.

Referenced by llvm::HexagonTargetLowering::allowTruncateForTailCall(), llvm::ARMTargetLowering::allowTruncateForTailCall(), llvm::X86TargetLowering::allowTruncateForTailCall(), areExtractShuffleVectors(), llvm::ARMTargetLowering::canCombineStoreAndExtract(), canLosslesslyBitCastTo(), llvm::CastInst::castIsValid(), CheckAndCreateOffsetAdd(), collectInsertionElements(), llvm::SelectionDAG::computeKnownBits(), llvm::SelectionDAG::ComputeNumSignBits(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldLoadFromConstPtr(), createCmpXchgInstFun(), llvm::DecodeVPERMIL2PMask(), llvm::DecodeVPPERMMask(), despeculateCountZeros(), llvm::HexagonTargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), evaluateGEPOffsetExpression(), llvm::extractConstantMask(), FoldBitCast(), foldBitcastExtElt(), llvm::InstCombinerImpl::foldCmpLoadFromIndexedGlobal(), llvm::InstCombinerImpl::foldGEPICmp(), llvm::InstCombinerImpl::foldICmpEquality(), foldVecTruncToExtElt(), llvm::AArch64TargetLowering::functionArgumentNeedsConsecutiveRegisters(), llvm::Constant::getAllOnesValue(), llvm::CastInst::getCastOpcode(), llvm::ExecutionEngine::getConstantValue(), llvm::ConstantDataSequential::getElementByteSize(), llvm::VectorType::getInteger(), llvm::SystemZTTIImpl::getIntImmCost(), llvm::PPCTTIImpl::getIntImmCost(), llvm::AArch64TTIImpl::getIntImmCost(), llvm::ARMTTIImpl::getIntImmCost(), llvm::X86TTIImpl::getIntImmCost(), llvm::SystemZTTIImpl::getIntImmCostInst(), llvm::PPCTTIImpl::getIntImmCostInst(), llvm::AArch64TTIImpl::getIntImmCostInst(), llvm::X86TTIImpl::getIntImmCostInst(), llvm::SystemZTTIImpl::getIntImmCostIntrin(), llvm::PPCTTIImpl::getIntImmCostIntrin(), llvm::AArch64TTIImpl::getIntImmCostIntrin(), llvm::X86TTIImpl::getIntImmCostIntrin(), llvm::VNCoercion::getLoadLoadClobberFullWidthSize(), llvm::HexagonTTIImpl::getMemoryOpCost(), llvm::PPCTTIImpl::getMemoryOpCost(), llvm::X86TTIImpl::getMemoryOpCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getMemoryOpCost(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), getPrimitiveSizeInBits(), llvm::NVPTXTargetLowering::getPrototype(), getScalarSizeInBits(), llvm::X86TTIImpl::getShuffleCost(), getTargetConstantBitsFromNode(), llvm::VectorType::getTruncatedElementVectorType(), getTypeSizeIndex(), llvm::SystemZTTIImpl::getVectorTruncCost(), hasTocDataAttr(), llvm::X86TTIImpl::instCombineIntrinsic(), llvm::CastInst::isBitCastable(), llvm::ARMTTIImpl::isLegalMaskedLoad(), isMultipleOfTypeSize(), llvm::MSP430TargetLowering::isTruncateFree(), llvm::RISCVTargetLowering::isTruncateFree(), llvm::ARMTargetLowering::isTruncateFree(), llvm::SystemZTargetLowering::isTruncateFree(), llvm::NVPTXTargetLowering::isTruncateFree(), llvm::AArch64TargetLowering::isTruncateFree(), llvm::PPCTargetLowering::isTruncateFree(), llvm::X86TargetLowering::isTruncateFree(), llvm::AArch64TargetLowering::isZExtFree(), LowerCTLZ(), LowerCTPOP(), optimizeVectorResizeWithIntegerBitCasts(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), llvm::replaceAllDbgUsesWith(), llvm::SCEVExpander::replaceCongruentIVs(), scalarConstantToHexString(), scalarizeMaskedLoad(), scalarizeMaskedStore(), llvm::ARMTargetLowering::shouldConvertConstantLoadToIntImm(), llvm::AArch64TargetLowering::shouldConvertConstantLoadToIntImm(), llvm::PPCTargetLowering::shouldConvertConstantLoadToIntImm(), llvm::X86TargetLowering::shouldConvertConstantLoadToIntImm(), llvm::RISCVTargetLowering::shouldExpandAtomicCmpXchgInIR(), llvm::ARMTargetLowering::shouldExpandAtomicCmpXchgInIR(), llvm::HexagonTargetLowering::shouldExpandAtomicLoadInIR(), llvm::ARMTargetLowering::shouldExpandAtomicLoadInIR(), llvm::AArch64TargetLowering::shouldExpandAtomicLoadInIR(), llvm::SparcTargetLowering::shouldExpandAtomicRMWInIR(), llvm::RISCVTargetLowering::shouldExpandAtomicRMWInIR(), llvm::ARMTargetLowering::shouldExpandAtomicRMWInIR(), llvm::AArch64TargetLowering::shouldExpandAtomicRMWInIR(), llvm::X86TargetLowering::SimplifyDemandedVectorEltsForTargetShuffle(), SimplifyICmpInst(), simplifyX86pack(), SwitchToLookupTable(), upgradeAVX512MaskToSelect(), UpgradeMaskedLoad(), UpgradeX86VPERMT2Intrinsics(), llvm::InstCombinerImpl::visitGetElementPtrInst(), and llvm::InstCombinerImpl::visitPHINode().

◆ getPrimitiveType()

Type * Type::getPrimitiveType ( LLVMContext C,
TypeID  IDNumber 
)
static

◆ getScalarSizeInBits()

unsigned Type::getScalarSizeInBits ( ) const

If this is a vector type, return the getPrimitiveSizeInBits value for the element type.

Otherwise return the getPrimitiveSizeInBits value for this type.

Definition at line 147 of file Type.cpp.

References llvm::TypeSize::getFixedSize(), getPrimitiveSizeInBits(), and getScalarType().

Referenced by llvm::InnerLoopVectorizer::buildScalarSteps(), canEvaluateSExtd(), canEvaluateShiftedShift(), canEvaluateTruncated(), canEvaluateZExtd(), canonicalizeAbs(), canTryToConstantAddTwoShiftAmounts(), llvm::CastInst::castIsValid(), CheckAndCreateOffsetAdd(), collectBitParts(), llvm::computeConstantRange(), llvm::SelectionDAG::computeKnownBits(), llvm::computeOverflowForSignedMul(), llvm::ConstantFoldCastOperand(), llvm::ConstantFoldGetElementPtr(), llvm::convertPointerToIntegerType(), llvm::MatrixBuilder< IRBuilderTy >::CreateExtractElement(), llvm::CastInst::CreateFPCast(), llvm::CastInst::CreateIntegerCast(), llvm::FixedPointBuilder< IRBuilderTy >::CreateIntegerToFixed(), llvm::CastInst::CreateSExtOrBitCast(), llvm::IRBuilderBase::CreateSExtOrTrunc(), llvm::CastInst::CreateTruncOrBitCast(), llvm::CastInst::CreateZExtOrBitCast(), llvm::IRBuilderBase::CreateZExtOrTrunc(), dropRedundantMaskingOfLeftShiftInput(), llvm::InstCombinerImpl::foldAddWithConstant(), foldCtpop(), llvm::InstCombinerImpl::foldFCmpIntToFPConst(), foldGuardedFunnelShift(), llvm::InstCombinerImpl::foldICmpAndConstConst(), foldICmpBitCast(), llvm::InstCombinerImpl::foldICmpSRemConstant(), llvm::InstCombinerImpl::foldICmpTruncConstant(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), foldICmpWithZextOrSext(), llvm::InstCombinerImpl::foldItoFPtoI(), foldSelectICmpAndOr(), foldSelectICmpLshrAshr(), llvm::InstCombinerImpl::FoldShiftByConstant(), foldShiftedShift(), foldShiftIntoShiftInAnotherHandOfAndInICmp(), foldShiftOfShiftedLogic(), llvm::InstCombinerImpl::foldSignBitTest(), foldSignedTruncationCheck(), foldTruncShuffle(), generateCreationChecksForBinOp(), llvm::SystemZTTIImpl::getArithmeticInstrCost(), getBitWidth(), llvm::SystemZTTIImpl::getCastInstrCost(), llvm::TargetTransformInfoImplBase::getCastInstrCost(), llvm::SystemZTTIImpl::getCmpSelInstrCost(), llvm::ExecutionEngine::getConstantValue(), getElSizeLog2Diff(), llvm::IntegerType::getExtendedType(), llvm::ConstantExpr::getFPCast(), llvm::ConstantExpr::getFPExtend(), llvm::ConstantExpr::getFPTrunc(), llvm::ConstantExpr::getIntegerCast(), llvm::ARMTTIImpl::getIntrinsicInstrCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getIntrinsicInstrCost(), llvm::GCNTTIImpl::getLoadVectorFactor(), llvm::SystemZTTIImpl::getMemoryOpCost(), getScalarSizeInBits(), llvm::ConstantExpr::getSExt(), llvm::ConstantExpr::getSExtOrBitCast(), llvm::InnerLoopVectorizer::getStepVector(), getTargetConstantBitsFromNode(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::ConstantExpr::getTrunc(), llvm::ConstantExpr::getTruncOrBitCast(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getTypeBasedIntrinsicInstrCost(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getUserCost(), getValueFromICmpCondition(), llvm::SystemZTTIImpl::getVectorBitmaskConversionCost(), llvm::PPCTTIImpl::getVectorInstrCost(), llvm::ARMTTIImpl::getVectorInstrCost(), llvm::SystemZTTIImpl::getVectorTruncCost(), llvm::getWiderType(), llvm::ConstantExpr::getZExt(), llvm::ConstantExpr::getZExtOrBitCast(), llvm::ARMTTIImpl::instCombineIntrinsic(), llvm::X86TTIImpl::instCombineIntrinsic(), llvm::CastInst::isEliminableCastPair(), llvm::SystemZTTIImpl::isFoldableLoad(), isKnownExactCastIntToFP(), isKnownToBeAPowerOfTwo(), llvm::ARMTTIImpl::isLegalMaskedGather(), llvm::ARMTTIImpl::isLegalMaskedLoad(), llvm::CastInst::isNoopCast(), llvm::AMDGPUTargetLowering::isTruncateFree(), llvm::X86TargetLowering::isVectorShiftByScalarCheap(), llvm::AMDGPUTargetLowering::isZExtFree(), LowerBSWAP(), matchOrConcat(), llvm::TargetTransformInfoImplBase::minRequiredElementSize(), llvm::ARMTTIImpl::preferInLoopReduction(), processAbsIntrinsic(), llvm::recognizeBSwapOrBitReverseIdiom(), llvm::salvageDebugInfoImpl(), SimplifyAndInst(), SimplifyAShrInst(), llvm::InstCombinerImpl::SimplifyDemandedInstructionBits(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), SimplifyGEPInst(), SimplifyLShrInst(), llvm::InstCombinerImpl::simplifyShrShlDemandedBits(), simplifyUnaryIntrinsic(), simplifyX86pack(), llvm::InstCombinerImpl::SliceUpIllegalIntegerPHI(), tryToRecognizePopCount(), upgradeAVX512MaskToSelect(), UpgradeX86VPERMT2Intrinsics(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitAShr(), llvm::InstCombinerImpl::visitBitCast(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitIntToPtr(), llvm::InstCombinerImpl::visitLShr(), llvm::InstCombinerImpl::visitOr(), llvm::InstCombinerImpl::visitPtrToInt(), llvm::InstCombinerImpl::visitSDiv(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitShl(), llvm::InstCombinerImpl::visitShuffleVectorInst(), llvm::InstCombinerImpl::visitSub(), llvm::InstCombinerImpl::visitTrunc(), llvm::InstCombinerImpl::visitXor(), llvm::InstCombinerImpl::visitZExt(), and llvm::reassociate::XorOpnd::XorOpnd().

◆ getScalarTy()

template<typename ScalarTy >
static Type* llvm::Type::getScalarTy ( LLVMContext C)
inlinestatic

Definition at line 430 of file Type.h.

References getDoubleTy(), getFloatTy(), getIntNTy(), and llvm_unreachable.

◆ getScalarType()

Type* llvm::Type::getScalarType ( ) const
inline

If this is a vector type, return the element type, otherwise return 'this'.

Definition at line 317 of file Type.h.

References getContainedType(), and isVectorTy().

Referenced by llvm::VNCoercion::analyzeLoadFromClobberingMemInst(), llvm::InnerLoopVectorizer::buildScalarSteps(), llvm::VNCoercion::canCoerceMustAliasedValueToLoad(), canConvertValue(), llvm::CastInst::castIsValid(), computeKnownBits(), computeKnownBitsFromOperator(), ComputeNumSignBitsImpl(), concatenateTwoVectors(), llvm::ConstantFoldGetElementPtr(), llvm::ConstantFoldLoadThroughBitcast(), llvm::GetElementPtrInst::Create(), llvm::MatrixBuilder< IRBuilderTy >::CreateScalarMultiply(), llvm::IRBuilderBase::CreateStepVector(), llvm::EmitGEPOffset(), evaluateInDifferentElementOrder(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), llvm::InstCombinerImpl::foldVectorBinop(), fpModeMatchesGlobalFPAtomicMode(), llvm::ConstantInt::get(), llvm::ConstantFP::get(), llvm::ConstantExpr::getAddrSpaceCast(), llvm::SystemZTTIImpl::getArithmeticInstrCost(), llvm::AArch64TTIImpl::getArithmeticInstrCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getArithmeticInstrCost(), llvm::SystemZTTIImpl::getCastInstrCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getCastInstrCost(), getCmpOpsType(), llvm::SystemZTTIImpl::getCmpSelInstrCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getCmpSelInstrCost(), llvm::ConstantExpr::getExactLogBase2(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getGEPCost(), llvm::DataLayout::getIndexTypeSizeInBits(), llvm::ConstantFP::getInfinity(), llvm::Constant::getIntegerValue(), llvm::ARMTTIImpl::getInterleavedMemoryOpCost(), llvm::AArch64TTIImpl::getInterleavedMemoryOpCost(), llvm::X86TTIImpl::getInterleavedMemoryOpCostAVX512(), llvm::ARMTTIImpl::getMemoryOpCost(), llvm::ConstantFP::getNaN(), llvm::ConstantFP::getNegativeZero(), getPointerAddressSpace(), llvm::DataLayout::getPointerTypeSizeInBits(), llvm::ConstantFP::getQNaN(), llvm::PPCTTIImpl::getRegisterClassForType(), getScalarIntrinsicDeclaration(), getScalarSizeInBits(), llvm::SystemZTTIImpl::getShuffleCost(), llvm::ConstantFP::getSNaN(), llvm::InnerLoopVectorizer::getStepVector(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getTypeBasedIntrinsicInstrCost(), llvm::PPCTTIImpl::getVectorInstrCost(), llvm::X86TTIImpl::getVectorInstrCost(), llvm::ARMTTIImpl::getVectorInstrCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getVectorInstrCost(), hasSameExtUse(), llvm::haveNoCommonBitsSet(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::CastInst::isEliminableCastPair(), llvm::AArch64TargetLowering::isFMAFasterThanFMulAndFAdd(), llvm::PPCTargetLowering::isFMAFasterThanFMulAndFAdd(), isFPOrFPVectorTy(), isIntOrIntVectorTy(), llvm::isKnownNeverInfinity(), isKnownNonZero(), llvm::X86TTIImpl::isLegalMaskedGather(), llvm::RISCVTTIImpl::isLegalMaskedGatherScatter(), llvm::AArch64TTIImpl::isLegalMaskedGatherScatter(), llvm::X86TTIImpl::isLegalMaskedLoad(), llvm::RISCVTTIImpl::isLegalMaskedLoadStore(), llvm::AArch64TTIImpl::isLegalMaskedLoadStore(), isPtrOrPtrVectorTy(), LLVMBuildGEP(), LLVMBuildInBoundsGEP(), LLVMBuildStructGEP(), LLVMConstGEP(), LLVMConstInBoundsGEP(), lowerStatepointMetaArgs(), llvm::ARMTargetLowering::shouldConvertSplatType(), shrinkInsertElt(), simplifyAMDGCNMemoryIntrinsicDemanded(), upgradeX86ConcatShift(), upgradeX86Rotate(), llvm::InstCombinerImpl::visitAddrSpaceCast(), llvm::InstCombinerImpl::visitAnd(), llvm::InstCombinerImpl::visitBitCast(), llvm::InstCombinerImpl::visitFAdd(), visitMaskedMerge(), llvm::InstCombinerImpl::visitPtrToInt(), llvm::InstCombinerImpl::visitXor(), and llvm::InnerLoopVectorizer::widenPHIInstruction().

◆ getStructElementType()

Type * llvm::Type::getStructElementType ( unsigned  N) const
inline

Definition at line 354 of file DerivedTypes.h.

References N.

Referenced by createCast(), isConstantUsingVectorTy(), originalTypeIsF128(), and simplifyX86addcarry().

◆ getStructName()

StringRef llvm::Type::getStructName ( ) const
inline

Definition at line 346 of file DerivedTypes.h.

Referenced by false::operator<<().

◆ getStructNumElements()

unsigned llvm::Type::getStructNumElements ( ) const
inline

◆ getSubclassData()

unsigned llvm::Type::getSubclassData ( ) const
inlineprotected

◆ getTokenTy()

Type * Type::getTokenTy ( LLVMContext C)
static

◆ getTypeID()

TypeID llvm::Type::getTypeID ( ) const
inline

Return the type id for the type.

This will return one of the TypeID enum elements defined above.

Definition at line 136 of file Type.h.

Referenced by llvm::FunctionComparator::cmpTypes(), llvm::isa_impl< PointerType, Type >::doit(), executeFAddInst(), executeFCMP_OEQ(), executeFCMP_OGE(), executeFCMP_OGT(), executeFCMP_OLE(), executeFCMP_OLT(), executeFCMP_ONE(), executeFDivInst(), executeFMulInst(), executeFNegInst(), executeFRemInst(), executeFSubInst(), executeICMP_EQ(), executeICMP_NE(), executeICMP_SGE(), executeICMP_SGT(), executeICMP_SLE(), executeICMP_SLT(), executeICMP_UGE(), executeICMP_UGT(), executeICMP_ULE(), executeICMP_ULT(), llvm::InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(), getArrayElementType(), llvm::ExecutionEngine::getConstantValue(), llvm::EVT::getEVT(), llvm::getFloatFnName(), getFltSemantics(), getFPMantissaWidth(), getMangledTypeStr(), llvm::Constant::getNullValue(), getPointerElementType(), getPrimitiveSizeInBits(), llvm::NVPTXTargetLowering::getPrototype(), llvm::VectorType::getTruncatedElementVectorType(), getTypeID(), llvm::AMDGPU::HSAMD::MetadataStreamerV3::getTypeName(), llvm::DataLayout::getTypeSizeInBits(), llvm::MVT::getVT(), llvm::hasFloatFn(), isAggregateType(), isArrayTy(), isBFloatTy(), isDoubleTy(), isFirstClassType(), isFloatingPointTy(), isFloatTy(), llvm::AArch64TargetLowering::isFMAFasterThanFMulAndFAdd(), llvm::PPCTargetLowering::isFMAFasterThanFMulAndFAdd(), isFP128Ty(), isFunctionTy(), isHalfTy(), isIntegerTy(), isLabelTy(), isLeakCheckerRoot(), llvm::XCoreTargetLowering::isLegalAddressingMode(), isMetadataTy(), isPointerTy(), isPPC_FP128Ty(), isSized(), isStructTy(), isTokenTy(), llvm::ConstantFP::isValueValidForType(), isVectorTy(), isVoidTy(), isX86_AMXTy(), isX86_FP80Ty(), isX86_MMXTy(), llvm::ExecutionEngine::LoadValueFromMemory(), needsFPFromSig(), needsFPStubFromParams(), ReplaceFPIntrinsicWithCall(), llvm::MCJIT::runFunction(), llvm::ExecutionEngine::StoreValueToMemory(), llvm::Interpreter::visitExtractElementInst(), llvm::Interpreter::visitExtractValueInst(), llvm::Interpreter::visitInsertElementInst(), llvm::Interpreter::visitInsertValueInst(), llvm::Interpreter::visitShuffleVectorInst(), and llvm::Interpreter::visitVAArgInst().

◆ getVoidTy()

Type * Type::getVoidTy ( LLVMContext C)
static

◆ getWithNewBitWidth()

Type * llvm::Type::getWithNewBitWidth ( unsigned  NewBitWidth) const
inline

Given an integer or vector type, change the lane bitwidth to NewBitwidth, whilst keeping the old number of lanes.

Definition at line 686 of file DerivedTypes.h.

References assert(), getContext(), getIntNTy(), getWithNewType(), and isIntOrIntVectorTy().

Referenced by llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getIntrinsicInstrCost(), and llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getTypeBasedIntrinsicInstrCost().

◆ getWithNewType()

Type * llvm::Type::getWithNewType ( Type EltTy) const
inline

Given vector type, change the element type, whilst keeping the old number of elements.

For non-vectors simply returns EltTy.

Definition at line 680 of file DerivedTypes.h.

References llvm::VectorType::get().

Referenced by getWithNewBitWidth(), llvm::InstCombinerImpl::visitIntToPtr(), and llvm::InstCombinerImpl::visitPtrToInt().

◆ getX86_AMXPtrTy()

PointerType * Type::getX86_AMXPtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 237 of file Type.cpp.

References getPointerTo(), and getX86_AMXTy().

◆ getX86_AMXTy()

Type * Type::getX86_AMXTy ( LLVMContext C)
static

◆ getX86_FP80PtrTy()

PointerType * Type::getX86_FP80PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 221 of file Type.cpp.

References getPointerTo(), and getX86_FP80Ty().

◆ getX86_FP80Ty()

Type * Type::getX86_FP80Ty ( LLVMContext C)
static

◆ getX86_MMXPtrTy()

PointerType * Type::getX86_MMXPtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 233 of file Type.cpp.

References getPointerTo(), and getX86_MMXTy().

◆ getX86_MMXTy()

Type * Type::getX86_MMXTy ( LLVMContext C)
static

◆ isAggregateType()

bool llvm::Type::isAggregateType ( ) const
inline

Return true if the type is an aggregate type.

This means it is valid as the first operand of an insertvalue or extractvalue instruction. This includes struct and array types, but does not include vector types.

Definition at line 265 of file Type.h.

References ArrayTyID, getTypeID(), and StructTyID.

Referenced by advanceToNextLeafType(), llvm::CastInst::castIsValid(), llvm::ConstantFoldLoadThroughBitcast(), firstRealType(), llvm::ExecutionEngine::getConstantValue(), llvm::NVPTXTargetLowering::getPrototype(), llvm::SelectionDAGBuilder::getValueImpl(), llvm::NVPTXTargetLowering::LowerCall(), llvm::NVPTXTargetLowering::LowerFormalArguments(), nextRealType(), llvm::InnerLoopVectorizer::scalarizeInstruction(), and tryPromoteAllocaToVector().

◆ isArrayTy()

bool llvm::Type::isArrayTy ( ) const
inline

◆ isBFloatTy()

bool llvm::Type::isBFloatTy ( ) const
inline

◆ isDoubleTy()

bool llvm::Type::isDoubleTy ( ) const
inline

◆ isEmptyTy()

bool Type::isEmptyTy ( ) const

Return true if this type is empty, that is, it has no elements or all of its elements are empty.

Definition at line 105 of file Type.cpp.

References i.

Referenced by areGlobalsPotentiallyEqual(), llvm::CallLowering::ArgInfo::ArgInfo(), llvm::SelectionDAGBuilder::CopyToExportRegsIfNeeded(), llvm::FastISel::lowerCallTo(), and llvm::SelectionDAGBuilder::populateCallLoweringInfo().

◆ isFirstClassType()

bool llvm::Type::isFirstClassType ( ) const
inline

◆ isFloatingPointTy()

bool llvm::Type::isFloatingPointTy ( ) const
inline

Return true if this is one of the six floating-point types.

Definition at line 163 of file Type.h.

References BFloatTyID, DoubleTyID, FloatTyID, FP128TyID, getTypeID(), HalfTyID, PPC_FP128TyID, and X86_FP80TyID.

Referenced by llvm::InnerLoopVectorizer::buildScalarSteps(), llvm::ConstantFoldLoadFromConstPtr(), llvm::ConstantFoldLoadThroughBitcast(), convertTo16Bit(), llvm::InnerLoopVectorizer::createBitOrPointerCast(), createCmpXchgInstFun(), llvm::MatrixBuilder< IRBuilderTy >::CreateScalarMultiply(), FoldBitCast(), foldBitcastExtElt(), llvm::Constant::getAllOnesValue(), llvm::SystemZTTIImpl::getCastInstrCost(), llvm::CastInst::getCastOpcode(), llvm::SystemZTTIImpl::getCmpSelInstrCost(), llvm::ExecutionEngine::getConstantValue(), getFPMantissaWidth(), getInductionVariable(), llvm::TargetTransformInfoImplCRTPBase< AMDGPUTTIImpl >::getInstructionLatency(), llvm::HexagonTTIImpl::getMemoryOpCost(), llvm::NVPTXTargetLowering::getPrototype(), llvm::InnerLoopVectorizer::getStepVector(), llvm::VectorType::getTruncatedElementVectorType(), llvm::X86TTIImpl::getVectorInstrCost(), llvm::CastInst::isEliminableCastPair(), llvm::InductionDescriptor::isFPInductionPHI(), isFPOrFPVectorTy(), llvm::InductionDescriptor::isInductionPHI(), isSingleValueType(), isSized(), isSupportedAtomicType(), llvm::VectorType::isValidElementType(), llvm::NVPTXTargetLowering::LowerCall(), MaybeVectorizeType(), llvm::TargetLoweringBase::shouldConvertPhiType(), simplifyAMDGCNImageIntrinsic(), supportedAddressingMode(), TryToShrinkGlobalToBoolean(), UpgradeIntrinsicFunction1(), llvm::InstCombinerImpl::visitAtomicRMWInst(), and llvm::InstCombinerImpl::visitInsertElementInst().

◆ isFloatTy()

bool llvm::Type::isFloatTy ( ) const
inline

◆ isFP128Ty()

bool llvm::Type::isFP128Ty ( ) const
inline

◆ isFPOrFPVectorTy()

bool llvm::Type::isFPOrFPVectorTy ( ) const
inline

◆ isFunctionTy()

bool llvm::Type::isFunctionTy ( ) const
inline

◆ isFunctionVarArg()

bool llvm::Type::isFunctionVarArg ( ) const
inline

Definition at line 148 of file DerivedTypes.h.

◆ isHalfTy()

bool llvm::Type::isHalfTy ( ) const
inline

◆ isIEEE()

bool llvm::Type::isIEEE ( ) const
inline

Return whether the type is IEEE compatible, as defined by the eponymous method in APFloat.

Definition at line 313 of file Type.h.

References getFltSemantics(), llvm::APFloat::getZero(), and llvm::APFloat::isIEEE().

◆ isIntegerTy() [1/2]

bool llvm::Type::isIntegerTy ( ) const
inline

True if this is an instance of IntegerType.

Definition at line 202 of file Type.h.

References getTypeID(), and IntegerTyID.

Referenced by llvm::HexagonTargetLowering::allowTruncateForTailCall(), llvm::ARMTargetLowering::allowTruncateForTailCall(), llvm::X86TargetLowering::allowTruncateForTailCall(), llvm::VNCoercion::analyzeLoadFromClobberingLoad(), llvm::InnerLoopVectorizer::buildScalarSteps(), canConvertValue(), canSafelyConvertTo16Bit(), llvm::VNCoercion::coerceAvailableValueToLoadTypeHelper(), llvm::InstCombinerImpl::commonCastTransforms(), llvm::ComputeMultiple(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), ComputePTXValueVTs(), llvm::ConstantFoldLoadThroughBitcast(), convertTo16Bit(), llvm::CastInst::CreateBitOrPointerCast(), createCast(), llvm::X86TargetLowering::ExpandInlineAsm(), llvm::extractConstantMask(), FindLoopCounter(), llvm::InnerLoopVectorizer::fixupIVUsers(), FoldBitCast(), FoldCondBranchOnPHI(), llvm::InstCombinerImpl::foldIntegerTypedPHI(), llvm::InstCombinerImpl::foldPHIArgOpIntoPHI(), FoldTwoEntryPHINode(), llvm::ARMTargetLowering::functionArgumentNeedsConsecutiveRegisters(), getAdjustedPtr(), getAISize(), getAllocationDataForFunction(), llvm::ARMTTIImpl::getArithmeticInstrCost(), llvm::SystemZTTIImpl::getCastInstrCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getCastInstrCost(), llvm::CastInst::getCastOpcode(), llvm::SystemZTTIImpl::getCmpSelInstrCost(), llvm::ARMTTIImpl::getCmpSelInstrCost(), llvm::getConstantDataArrayInfo(), llvm::LazyValueInfo::getConstantRange(), llvm::ExecutionEngine::getConstantValue(), llvm::ScalarEvolution::getEffectiveSCEVType(), llvm::ConstantExpr::getExtractElement(), llvm::DataLayout::getIndexedOffsetInType(), getInductionVariable(), llvm::ConstantExpr::getInsertElement(), llvm::X86TTIImpl::getInterleavedMemoryOpCost(), llvm::SystemZTTIImpl::getIntImmCost(), llvm::RISCVTTIImpl::getIntImmCost(), llvm::PPCTTIImpl::getIntImmCost(), llvm::LanaiTTIImpl::getIntImmCost(), llvm::AArch64TTIImpl::getIntImmCost(), llvm::ARMTTIImpl::getIntImmCost(), llvm::X86TTIImpl::getIntImmCost(), llvm::SystemZTTIImpl::getIntImmCostInst(), llvm::RISCVTTIImpl::getIntImmCostInst(), llvm::PPCTTIImpl::getIntImmCostInst(), llvm::AArch64TTIImpl::getIntImmCostInst(), llvm::X86TTIImpl::getIntImmCostInst(), llvm::SystemZTTIImpl::getIntImmCostIntrin(), llvm::PPCTTIImpl::getIntImmCostIntrin(), llvm::AArch64TTIImpl::getIntImmCostIntrin(), llvm::X86TTIImpl::getIntImmCostIntrin(), getLoadStoreAddrMode(), llvm::VNCoercion::getLoadValueForLoad(), llvm::ScalarEvolution::getLosslessPtrToIntExpr(), getMaskedTypeForICmpPair(), getNaturalGEPWithOffset(), llvm::NVPTXTargetLowering::getPrototype(), llvm::ScalarEvolution::getPtrToIntExpr(), getSignedIntOrFpConstant(), llvm::SystemZTargetLowering::getSingleConstraintMatchWeight(), llvm::X86TargetLowering::getSingleConstraintMatchWeight(), llvm::TargetLowering::getSingleConstraintMatchWeight(), llvm::InnerLoopVectorizer::getStepVector(), getUnderlyingObjectFromInt(), getValueFromICmpCondition(), llvm::PPCTTIImpl::getVectorInstrCost(), llvm::X86TTIImpl::getVectorInstrCost(), llvm::HexagonTTIImpl::getVectorInstrCost(), llvm::ARMTTIImpl::getVectorInstrCost(), llvm::hasIterationCountInvariantInParent(), llvm::HexagonEvaluator::HexagonEvaluator(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::isBytewiseValue(), isCallingConvCCompatible(), isConstantFalse(), llvm::CastInst::isEliminableCastPair(), llvm::isGEPBasedOnPointerToString(), llvm::isImpliedCondition(), llvm::InductionDescriptor::isInductionPHI(), llvm::CastInst::isIntegerCast(), isIntegerLoopHeaderPHI(), isIntegerTy(), isIntOrIntVectorTy(), isIntOrPtrTy(), llvm::RISCVTTIImpl::isLegalElementTypeForRVV(), llvm::AArch64TTIImpl::isLegalElementTypeForSVE(), llvm::X86TTIImpl::isLegalMaskedExpandLoad(), llvm::X86TTIImpl::isLegalMaskedGather(), llvm::X86TTIImpl::isLegalMaskedLoad(), isSingleValueType(), llvm::ConstantDataSequential::isString(), llvm::MSP430TargetLowering::isTruncateFree(), llvm::RISCVTargetLowering::isTruncateFree(), llvm::ARMTargetLowering::isTruncateFree(), llvm::SystemZTargetLowering::isTruncateFree(), llvm::NVPTXTargetLowering::isTruncateFree(), llvm::AArch64TargetLowering::isTruncateFree(), llvm::PPCTargetLowering::isTruncateFree(), llvm::X86TargetLowering::isTruncateFree(), llvm::VectorType::isValidElementType(), llvm::ConstantInt::isValueValidForType(), isVectorPromotionViable(), isVectorPromotionViableForSlice(), llvm::MSP430TargetLowering::isZExtFree(), llvm::AArch64TargetLowering::isZExtFree(), llvm::X86TargetLowering::isZExtFree(), llvm::ExecutionEngine::LoadValueFromMemory(), llvm::NVPTXTargetLowering::LowerCall(), LowerCTPOP(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::NVPTXTargetLowering::LowerReturn(), llvm::IntrinsicLowering::LowerToByteSwap(), matchIntrinsicType(), originalTypeIsF128(), llvm::replaceAllDbgUsesWith(), llvm::SCEVExpander::replaceCongruentIVs(), llvm::MCJIT::runFunction(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::ARMTargetLowering::shouldConvertConstantLoadToIntImm(), llvm::AArch64TargetLowering::shouldConvertConstantLoadToIntImm(), llvm::PPCTargetLowering::shouldConvertConstantLoadToIntImm(), llvm::X86TargetLowering::shouldConvertConstantLoadToIntImm(), llvm::TargetLoweringBase::shouldConvertPhiType(), simplifyAllocaArraySize(), llvm::InstCombinerImpl::SimplifyAnyMemSet(), SimplifyUsingControlFlow(), simplifyX86addcarry(), splitMergedValStore(), llvm::AttributeFuncs::typeIncompatible(), llvm::UnrollRuntimeLoopRemainder(), updatePredecessorProfileMetadata(), UpgradeX86IntrinsicsWith8BitMask(), llvm::InstCombinerImpl::visitAtomicRMWInst(), llvm::InstCombinerImpl::visitBitCast(), llvm::InstCombinerImpl::visitInsertElementInst(), llvm::InstCombinerImpl::visitLShr(), llvm::InstCombinerImpl::visitPHINode(), llvm::InstCombinerImpl::visitReturnInst(), and llvm::InstCombinerImpl::visitTrunc().

◆ isIntegerTy() [2/2]

bool Type::isIntegerTy ( unsigned  Bitwidth) const

Return true if this is an IntegerType of the given width.

Definition at line 59 of file Type.cpp.

References isIntegerTy().

◆ isIntOrIntVectorTy() [1/2]

bool llvm::Type::isIntOrIntVectorTy ( ) const
inline

Return true if this is an integer type or a vector of integer types.

Definition at line 208 of file Type.h.

References getScalarType(), and isIntegerTy().

Referenced by buildMultiplyTree(), llvm::CastInst::castIsValid(), llvm::InstCombinerImpl::commonIDivTransforms(), llvm::computeConstantRange(), computeKnownBits(), llvm::ConstantFoldGetElementPtr(), convertValue(), CreateAdd(), llvm::IRBuilderBase::CreateBitOrPointerCast(), llvm::CastInst::CreateIntegerCast(), llvm::IRBuilderBase::CreateLogicalAnd(), llvm::IRBuilderBase::CreateLogicalOr(), CreateMul(), CreateNeg(), llvm::CastInst::CreatePointerCast(), llvm::IRBuilderBase::CreateSExtOrTrunc(), llvm::IRBuilderBase::CreateZExtOrTrunc(), foldBitCastBitwiseLogic(), llvm::InstCombinerImpl::foldICmpUsingKnownBits(), foldSelectICmpLshrAshr(), foldTruncShuffle(), getBoolVecFromMask(), llvm::ARMTTIImpl::getCmpSelInstrCost(), getDecodedBinaryOpcode(), getDecodedUnaryOpcode(), llvm::VectorType::getExtendedElementVectorType(), getExtendedType(), llvm::ConstantInt::getFalse(), llvm::ConstantExpr::getFPToSI(), llvm::ConstantExpr::getFPToUI(), llvm::ConstantExpr::getIntegerCast(), llvm::ARMTTIImpl::getInterleavedMemoryOpCost(), llvm::X86TTIImpl::getMinMaxCost(), llvm::X86TTIImpl::getMinMaxReductionCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getMinMaxReductionCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getOperandsScalarizationOverhead(), llvm::ConstantExpr::getPointerCast(), llvm::ConstantExpr::getPtrToInt(), getSafeDivisor(), llvm::X86TTIImpl::getScalarizationOverhead(), llvm::ConstantExpr::getSExt(), llvm::ConstantInt::getTrue(), llvm::ConstantExpr::getTrunc(), llvm::GetElementPtrInst::getTypeAtIndex(), llvm::SystemZTTIImpl::getVectorInstrCost(), getWithNewBitWidth(), llvm::ConstantExpr::getZExt(), llvm::haveNoCommonBitsSet(), llvm::StructType::indexValid(), llvm::CastInst::isEliminableCastPair(), llvm::isImpliedCondition(), isKnownNonEqual(), llvm::DemandedBits::isUseDead(), LowerBSWAP(), LowerNegateToMultiply(), matchIntrinsicType(), llvm::recognizeBSwapOrBitReverseIdiom(), SimplifyAddInst(), SimplifyAndInst(), llvm::InstCombinerImpl::SimplifyDemandedUseBits(), simplifyDivRem(), simplifyICmpOfBools(), SimplifyMulInst(), SimplifyOrInst(), SimplifySubInst(), tryToRecognizePopCount(), llvm::InstCombinerImpl::visitAdd(), and llvm::InstCombinerImpl::visitICmpInst().

◆ isIntOrIntVectorTy() [2/2]

bool llvm::Type::isIntOrIntVectorTy ( unsigned  BitWidth) const
inline

Return true if this is an integer type or a vector of integer types of the given width.

Definition at line 212 of file Type.h.

References llvm::BitWidth, getScalarType(), and isIntegerTy().

◆ isIntOrPtrTy()

bool llvm::Type::isIntOrPtrTy ( ) const
inline

◆ isLabelTy()

bool llvm::Type::isLabelTy ( ) const
inline

◆ isMetadataTy()

bool llvm::Type::isMetadataTy ( ) const
inline

◆ isPointerTy()

bool llvm::Type::isPointerTy ( ) const
inline

True if this is an instance of PointerType.

Definition at line 229 of file Type.h.

References getTypeID(), and PointerTyID.

Referenced by addConditions(), BuildConstantFromSCEV(), canConvertValue(), llvm::canReplacePointersIfEqual(), CompareValueComplexity(), computeKnownBits(), computeKnownBitsFromAssume(), computeKnownBitsFromOperator(), ComputeNumSignBitsImpl(), llvm::ConstantFoldLoadThroughBitcast(), llvm::convertPointerToIntegerType(), llvm::copyMetadataForLoad(), llvm::CastInst::CreateBitOrPointerCast(), llvm::InnerLoopVectorizer::createBitOrPointerCast(), createCast(), FindLoopCounter(), llvm::CFLSteensAAResult::FunctionInfo::FunctionInfo(), genLoopLimit(), getAdjustedPtr(), llvm::AMDGPUTargetMachine::getAssumedAddrSpace(), llvm::TargetTransformInfoImplBase::getCastInstrCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getCastInstrCost(), llvm::CastInst::getCastOpcode(), GetConstantInt(), llvm::ExecutionEngine::getConstantValue(), llvm::ScalarEvolution::getEffectiveSCEVType(), getInductionVariable(), llvm::X86TTIImpl::getInterleavedMemoryOpCost(), llvm::ScalarEvolution::getLosslessPtrToIntExpr(), getNaturalGEPRecursively(), getNaturalGEPWithType(), llvm::MemoryDependenceResults::getNonLocalPointerDependency(), llvm::InnerLoopVectorizer::getOrCreateTripCount(), llvm::getOrEnforceKnownAlignment(), llvm::AMDGPULibFunc::getOrInsertFunction(), llvm::ScalarEvolution::getPointerBase(), llvm::LazyValueInfo::getPredicateAt(), llvm::getPtrStride(), llvm::VNCoercion::getStoreValueForLoadHelper(), llvm::GetStringLength(), llvm::ScalarEvolution::getTypeSizeInBits(), llvm::getUnderlyingObject(), hasTocDataAttr(), llvm::HexagonEvaluator::HexagonEvaluator(), llvm::MemoryDependenceResults::invalidateCachedPointerInfo(), isCallingConvCCompatible(), isCompatibleIVType(), isDereferenceableAndAlignedPointer(), llvm::InductionDescriptor::isInductionPHI(), isInterestingPointer(), isIntOrPtrTy(), isKnownNonZero(), isKnownNonZeroFromAssume(), llvm::RISCVTTIImpl::isLegalElementTypeForRVV(), llvm::AArch64TTIImpl::isLegalElementTypeForSVE(), llvm::X86TTIImpl::isLegalMaskedGather(), llvm::X86TTIImpl::isLegalMaskedLoad(), llvm::CastInst::isLosslessCast(), isMinMaxWithLoads(), isNoopBitcast(), isPointerOperand(), isPtrOrPtrVectorTy(), isSingleValueType(), llvm::VectorType::isValidElementType(), isValidRewrite(), llvm::SelectionDAGBuilder::LowerAsSTATEPOINT(), llvm::NVPTXTargetLowering::LowerCall(), llvm::AArch64TargetLowering::lowerInterleavedLoad(), llvm::ARMTargetLowering::lowerInterleavedLoad(), llvm::AArch64TargetLowering::lowerInterleavedStore(), llvm::ARMTargetLowering::lowerInterleavedStore(), optimizeOnceStoredGlobal(), llvm::PointerMayBeCaptured(), llvm::SCEVExpander::replaceCongruentIVs(), replaceWithConstant(), llvm::MCJIT::runFunction(), shouldBeMustTail(), SimplifyICmpInst(), swapMayExposeCSEOpportunities(), TryToShrinkGlobalToBoolean(), llvm::AttributeFuncs::typeIncompatible(), llvm::InstCombinerImpl::visitBitCast(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitICmpInst(), and llvm::InstCombinerImpl::visitPHINode().

◆ isPPC_FP128Ty()

bool llvm::Type::isPPC_FP128Ty ( ) const
inline

Return true if this is powerpc long double.

Definition at line 160 of file Type.h.

References getTypeID(), and PPC_FP128TyID.

Referenced by llvm::ConstantFoldCastInstruction(), emitGlobalConstantFP(), FoldBitCast(), foldICmpBitCast(), llvm::PPCTTIImpl::getRegisterClassForType(), and isValidElementType().

◆ isPtrOrPtrVectorTy()

bool llvm::Type::isPtrOrPtrVectorTy ( ) const
inline

◆ isSingleValueType()

bool llvm::Type::isSingleValueType ( ) const
inline

Return true if the type is a valid type for a register in codegen.

This includes all first-class types except struct and array types.

Definition at line 257 of file Type.h.

References isFloatingPointTy(), isIntegerTy(), isPointerTy(), isVectorTy(), isX86_AMXTy(), and isX86_MMXTy().

Referenced by canConvertValue(), getAggregateSize(), getOpenCLAlignment(), llvm::InlineAsmLowering::lowerInlineAsm(), llvm::TargetLowering::ParseConstraints(), processInternalGlobal(), stripAggregateTypeWrapping(), and llvm::SCCPInstVisitor::trackValueOfGlobalVariable().

◆ isSized()

bool llvm::Type::isSized ( SmallPtrSetImpl< Type * > *  Visited = nullptr) const
inline

◆ isStructTy()

bool llvm::Type::isStructTy ( ) const
inline

◆ isTokenTy()

bool llvm::Type::isTokenTy ( ) const
inline

◆ isVectorTy()

bool llvm::Type::isVectorTy ( ) const
inline

True if this is an instance of VectorType.

Definition at line 235 of file Type.h.

References FixedVectorTyID, getTypeID(), and ScalableVectorTyID.

Referenced by llvm::ARMTargetLowering::canCombineStoreAndExtract(), canEvaluateShuffled(), collectShuffleElements(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), llvm::SelectionDAG::ComputeNumSignBits(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), llvm::JumpThreadingPass::computeValueKnownInPredecessorsImpl(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantFoldGetElementPtr(), llvm::ConstantFoldLoadThroughBitcast(), llvm::MatrixBuilder< IRBuilderTy >::CreateAdd(), llvm::IRBuilderBase::CreateMaskedLoad(), llvm::IRBuilderBase::CreateMaskedStore(), llvm::CastInst::CreatePointerCast(), llvm::MatrixBuilder< IRBuilderTy >::CreateScalarDiv(), llvm::MatrixBuilder< IRBuilderTy >::CreateSub(), despeculateCountZeros(), llvm::EmitGEPOffset(), evaluateInDifferentElementOrder(), llvm::VPBranchOnMaskRecipe::execute(), executeFCMP_BOOL(), executeFCMP_ONE(), executeFCMP_ORD(), executeFCMP_UNO(), executeSelectInst(), llvm::expandDivision(), llvm::expandDivisionUpTo32Bits(), llvm::expandDivisionUpTo64Bits(), llvm::expandRemainder(), llvm::expandRemainderUpTo32Bits(), llvm::expandRemainderUpTo64Bits(), llvm::findScalarElement(), foldBitCastBitwiseLogic(), foldBitCastSelect(), llvm::InstCombinerImpl::foldGEPICmp(), foldSelectICmpAnd(), foldSelectICmpAndOr(), llvm::InstCombinerImpl::foldSelectOpOp(), foldShiftIntoShiftInAnotherHandOfAndInICmp(), foldTruncShuffle(), llvm::ConstantAggregateZero::get(), llvm::MipsTargetLowering::getABIAlignmentForCallingConv(), llvm::ARMTargetLowering::getABIAlignmentForCallingConv(), llvm::X86TTIImpl::getAddressComputationCost(), llvm::AArch64TTIImpl::getAddressComputationCost(), llvm::ARMTTIImpl::getAddressComputationCost(), llvm::SystemZTTIImpl::getArithmeticInstrCost(), llvm::HexagonTTIImpl::getArithmeticInstrCost(), llvm::AArch64TTIImpl::getArithmeticInstrCost(), llvm::SystemZTTIImpl::getCastInstrCost(), llvm::CastInst::getCastOpcode(), getCmpOpsType(), llvm::SystemZTTIImpl::getCmpSelInstrCost(), llvm::HexagonTTIImpl::getCmpSelInstrCost(), llvm::ARMTTIImpl::getCmpSelInstrCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getCmpSelInstrCost(), llvm::ConstantExpr::getExtractElement(), llvm::X86TTIImpl::getGatherScatterOpCost(), llvm::ARMTTIImpl::getGatherScatterOpCost(), llvm::ConstantExpr::getInsertElement(), llvm::GCNTTIImpl::getIntrinsicInstrCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getIntrinsicInstrCost(), llvm::SystemZTTIImpl::getMemoryOpCost(), llvm::HexagonTTIImpl::getMemoryOpCost(), llvm::PPCTTIImpl::getMemoryOpCost(), llvm::ARMTTIImpl::getMemoryOpCost(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getMemoryOpCost(), llvm::NVPTXTargetLowering::getPrototype(), getReducedType(), getScalarType(), getTargetConstantBitsFromNode(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getTypeBasedIntrinsicInstrCost(), getUniformBase(), llvm::PPCTTIImpl::getUserCost(), llvm::SystemZTTIImpl::getVectorBitmaskConversionCost(), llvm::PPCTTIImpl::getVectorInstrCost(), llvm::X86TTIImpl::getVectorInstrCost(), llvm::HexagonTTIImpl::getVectorInstrCost(), llvm::AArch64TTIImpl::getVectorInstrCost(), llvm::ARMTTIImpl::getVectorInstrCost(), getVectorIntrinsicInstrCost(), llvm::SystemZTTIImpl::getVectorTruncCost(), hasTocDataAttr(), llvm::StructType::indexValid(), llvm::X86TTIImpl::instCombineIntrinsic(), isConstantUsingVectorTy(), llvm::CastInst::isEliminableCastPair(), llvm::isImpliedCondition(), llvm::PPCTargetLowering::isLegalAddressingMode(), isSingleValueType(), isSized(), isTruePredicate(), llvm::HexagonSubtarget::isTypeForHVX(), llvm::ExtractElementInst::isValidOperands(), llvm::InsertElementInst::isValidOperands(), llvm::ShuffleVectorInst::isValidOperands(), llvm::NVPTXTargetLowering::LowerCall(), llvm::NVPTXTargetLowering::LowerFormalArguments(), narrowSDivOrSRem(), originalTypeIsVectorFloat(), processAnd(), processAShr(), processBinOp(), processCallSite(), processPHI(), processSDiv(), processSDivOrSRem(), processSExt(), processSRem(), processUDivOrURem(), llvm::InnerLoopVectorizer::reverseVector(), llvm::salvageDebugInfoImpl(), shouldConvertImpl(), llvm::InstCombinerImpl::SimplifyDemandedVectorElts(), llvm::X86TargetLowering::SimplifyDemandedVectorEltsForTargetShuffle(), simplifySelectWithICmpCond(), supportedAddressingMode(), ThreadCmpOverSelect(), transformToIndexedCompare(), tryPromoteAllocaToVector(), TryToShrinkGlobalToBoolean(), llvm::PPCTTIImpl::vectorCostAdjustment(), llvm::InstCombinerImpl::visitAShr(), llvm::Interpreter::visitAShr(), llvm::Interpreter::visitBinaryOperator(), llvm::InstCombinerImpl::visitBitCast(), llvm::InstCombinerImpl::visitGetElementPtrInst(), llvm::InstCombinerImpl::visitInsertElementInst(), llvm::Interpreter::visitLShr(), llvm::Interpreter::visitShl(), llvm::InstCombinerImpl::visitTrunc(), and llvm::Interpreter::visitUnaryOperator().

◆ isVoidTy()

bool llvm::Type::isVoidTy ( ) const
inline

◆ isX86_AMXTy()

bool llvm::Type::isX86_AMXTy ( ) const
inline

◆ isX86_FP80Ty()

bool llvm::Type::isX86_FP80Ty ( ) const
inline

Return true if this is x86 long double.

Definition at line 154 of file Type.h.

References getTypeID(), and X86_FP80TyID.

Referenced by llvm::ConstantFoldCastInstruction(), llvm::ExecutionEngine::getConstantValue(), and isValidElementType().

◆ isX86_MMXTy()

bool llvm::Type::isX86_MMXTy ( ) const
inline

◆ print()

void Type::print ( raw_ostream O,
bool  IsForDebug = false,
bool  NoDetails = false 
) const

Print the current type.

Omit the type details if NoDetails == true. E.g., let st = type { i32, i16 } When NoDetails is true, we only print st. Put differently, NoDetails prints the type as if inlined with the operands when printing an instruction.

Definition at line 4588 of file AsmWriter.cpp.

References llvm::StructType::isLiteral().

Referenced by dump(), emitGlobalConstantFP(), llvm::Attribute::getAsString(), and getBranchCondString().

◆ setSubclassData()

void llvm::Type::setSubclassData ( unsigned  val)
inlineprotected

◆ subtype_begin()

subtype_iterator llvm::Type::subtype_begin ( ) const
inline

Definition at line 328 of file Type.h.

References ContainedTys.

Referenced by subtype_rend(), and subtypes().

◆ subtype_end()

subtype_iterator llvm::Type::subtype_end ( ) const
inline

Definition at line 329 of file Type.h.

References ContainedTys, and NumContainedTys.

Referenced by subtype_rbegin(), and subtypes().

◆ subtype_rbegin()

subtype_reverse_iterator llvm::Type::subtype_rbegin ( ) const
inline

Definition at line 336 of file Type.h.

References subtype_end().

◆ subtype_rend()

subtype_reverse_iterator llvm::Type::subtype_rend ( ) const
inline

Definition at line 339 of file Type.h.

References subtype_begin().

◆ subtypes()

ArrayRef<Type*> llvm::Type::subtypes ( ) const
inline

Definition at line 330 of file Type.h.

References llvm::makeArrayRef(), subtype_begin(), and subtype_end().

Friends And Related Function Documentation

◆ LLVMContextImpl

friend class LLVMContextImpl
friend

Definition at line 91 of file Type.h.

Member Data Documentation

◆ ContainedTys

Type* const * llvm::Type::ContainedTys = nullptr
protected

A pointer to the array of Types contained by this Type.

For example, this includes the arguments of a function type, the elements of a structure, the pointee of a pointer, the element type of an array, etc. This pointer may be 0 for types that don't contain other types (Integer, Double, Float).

Definition at line 113 of file Type.h.

Referenced by llvm::StructType::element_begin(), llvm::StructType::element_end(), getArrayElementType(), getContainedType(), llvm::StructType::getElementType(), llvm::FunctionType::getParamType(), getPointerElementType(), llvm::FunctionType::getReturnType(), llvm::FunctionType::param_begin(), llvm::FunctionType::param_end(), llvm::StructType::setBody(), subtype_begin(), subtype_end(), and llvm::VectorType::VectorType().

◆ NumContainedTys

unsigned llvm::Type::NumContainedTys = 0
protected

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