59 return isIntegerTy() && cast<IntegerType>(
this)->getBitWidth() == Bitwidth;
63 if (
const auto *ATy = dyn_cast<ArrayType>(
this))
64 return ATy->getElementType()->isScalableTy(Visited);
65 if (
const auto *STy = dyn_cast<StructType>(
this))
66 return STy->isScalableTy(Visited);
71 SmallPtrSet<const Type *, 4> Visited;
77 if (
const auto *ATy = dyn_cast<ArrayType>(
this))
78 return ATy->getElementType()->containsNonGlobalTargetExtType(Visited);
79 if (
const auto *STy = dyn_cast<StructType>(
this))
80 return STy->containsNonGlobalTargetExtType(Visited);
81 if (
auto *TT = dyn_cast<TargetExtType>(
this))
82 return !
TT->hasProperty(TargetExtType::CanBeGlobal);
87 SmallPtrSet<const Type *, 4> Visited;
93 if (
const auto *ATy = dyn_cast<ArrayType>(
this))
94 return ATy->getElementType()->containsNonLocalTargetExtType(Visited);
95 if (
const auto *STy = dyn_cast<StructType>(
this))
96 return STy->containsNonLocalTargetExtType(Visited);
97 if (
auto *TT = dyn_cast<TargetExtType>(
this))
98 return !
TT->hasProperty(TargetExtType::CanBeLocal);
103 SmallPtrSet<const Type *, 4> Visited;
109 case HalfTyID:
return APFloat::IEEEhalf();
111 case FloatTyID:
return APFloat::IEEEsingle();
112 case DoubleTyID:
return APFloat::IEEEdouble();
114 case FP128TyID:
return APFloat::IEEEquad();
121 if (
auto *TT = dyn_cast<TargetExtType>(
this))
122 return isa<ScalableVectorType>(
TT->getLayoutType());
128 if (&S == &APFloat::IEEEhalf())
129 Ty = Type::getHalfTy(
C);
130 else if (&S == &APFloat::BFloat())
131 Ty = Type::getBFloatTy(
C);
132 else if (&S == &APFloat::IEEEsingle())
133 Ty = Type::getFloatTy(
C);
134 else if (&S == &APFloat::IEEEdouble())
135 Ty = Type::getDoubleTy(
C);
136 else if (&S == &APFloat::x87DoubleExtended())
137 Ty = Type::getX86_FP80Ty(
C);
138 else if (&S == &APFloat::IEEEquad())
139 Ty = Type::getFP128Ty(
C);
141 assert(&S == &APFloat::PPCDoubleDouble() &&
"Unknown FP format");
142 Ty = Type::getPPC_FP128Ty(
C);
151 return cast<TargetExtType>(
this)->getName() ==
"riscv.vector.tuple";
165 if (isa<VectorType>(
this) && isa<VectorType>(Ty))
169 if (((isa<FixedVectorType>(
this)) && Ty->isX86_AMXTy()) &&
173 Ty->getPrimitiveSizeInBits().getFixedValue() == 8192)
182 if (
auto *ATy = dyn_cast<ArrayType>(
this)) {
183 unsigned NumElements = ATy->getNumElements();
184 return NumElements == 0 || ATy->getElementType()->isEmptyTy();
187 if (
auto *STy = dyn_cast<StructType>(
this)) {
188 unsigned NumElements = STy->getNumElements();
189 for (
unsigned i = 0; i < NumElements; ++i)
190 if (!STy->getElementType(i)->isEmptyTy())
201 return TypeSize::getFixed(16);
202 case Type::BFloatTyID:
203 return TypeSize::getFixed(16);
204 case Type::FloatTyID:
205 return TypeSize::getFixed(32);
206 case Type::DoubleTyID:
207 return TypeSize::getFixed(64);
208 case Type::X86_FP80TyID:
209 return TypeSize::getFixed(80);
210 case Type::FP128TyID:
211 return TypeSize::getFixed(128);
212 case Type::PPC_FP128TyID:
213 return TypeSize::getFixed(128);
214 case Type::X86_AMXTyID:
215 return TypeSize::getFixed(8192);
216 case Type::IntegerTyID:
217 return TypeSize::getFixed(cast<IntegerType>(
this)->
getBitWidth());
218 case Type::FixedVectorTyID:
219 case Type::ScalableVectorTyID: {
220 const VectorType *VTy = cast<VectorType>(
this);
221 ElementCount
EC = VTy->getElementCount();
222 TypeSize ETS = VTy->getElementType()->getPrimitiveSizeInBits();
223 assert(!ETS.
isScalable() &&
"Vector type should have fixed-width elements");
227 return TypeSize::getFixed(0);
233 return getScalarType()->getPrimitiveSizeInBits().getFixedValue();
237 if (
auto *VTy = dyn_cast<VectorType>(
this))
238 return VTy->getElementType()->getFPMantissaWidth();
258 auto *
ST = cast<StructType>(
this);
259 return !
ST->isOpaque();
265 if (
auto *ATy = dyn_cast<ArrayType>(
this))
266 return ATy->getElementType()->isSized(Visited);
268 if (
auto *VTy = dyn_cast<VectorType>(
this))
269 return VTy->getElementType()->isSized(Visited);
271 if (
auto *TTy = dyn_cast<TargetExtType>(
this))
272 return TTy->getLayoutType()->isSized(Visited);
274 return cast<StructType>(
this)->isSized(Visited);
302 return IntegerType::get(
C,
N);
307 return PointerType::get(
C, 10);
312 return PointerType::get(
C, 20);
320 assert(NumBits >= MIN_INT_BITS &&
"bitwidth too small");
321 assert(NumBits <= MAX_INT_BITS &&
"bitwidth too large");
352 Type **SubTys =
reinterpret_cast<Type**
>(
this+1);
353 assert(isValidReturnType(Result) &&
"invalid return type for function");
354 setSubclassData(IsVarArgs);
358 for (
unsigned i = 0, e = Params.
size(); i != e; ++i) {
359 assert(isValidArgumentType(Params[i]) &&
360 "Not a valid type for function argument!");
361 SubTys[i+1] = Params[i];
364 ContainedTys = SubTys;
365 NumContainedTys = Params.
size() + 1;
372 const FunctionTypeKeyInfo::KeyTy
Key(ReturnType, Params,
isVarArg);
380 if (Insertion.second) {
387 *Insertion.first = FT;
390 FT = *Insertion.first;
400 return !RetTy->isFunctionTy() && !RetTy->isLabelTy() &&
401 !RetTy->isMetadataTy();
405 return ArgTy->isFirstClassType() && !ArgTy->isLabelTy();
426 if (Insertion.second) {
430 ST->setSubclassData(SCDB_IsLiteral);
431 ST->setBody(ETypes, isPacked);
432 *Insertion.first =
ST;
435 ST = *Insertion.first;
442 if ((getSubclassData() & SCDB_ContainsScalableVector) != 0)
445 if ((getSubclassData() & SCDB_NotContainsScalableVector) != 0)
448 if (!Visited.
insert(
this).second)
451 for (Type *Ty : elements()) {
452 if (Ty->isScalableTy(Visited)) {
453 const_cast<StructType *
>(
this)->setSubclassData(
454 getSubclassData() | SCDB_ContainsScalableVector);
463 const_cast<StructType *
>(
this)->setSubclassData(
464 getSubclassData() | SCDB_NotContainsScalableVector);
470 if ((getSubclassData() & SCDB_ContainsNonGlobalTargetExtType) != 0)
473 if ((getSubclassData() & SCDB_NotContainsNonGlobalTargetExtType) != 0)
476 if (!Visited.
insert(
this).second)
479 for (Type *Ty : elements()) {
480 if (Ty->containsNonGlobalTargetExtType(Visited)) {
481 const_cast<StructType *
>(
this)->setSubclassData(
482 getSubclassData() | SCDB_ContainsNonGlobalTargetExtType);
491 const_cast<StructType *
>(
this)->setSubclassData(
492 getSubclassData() | SCDB_NotContainsNonGlobalTargetExtType);
498 if ((getSubclassData() & SCDB_ContainsNonLocalTargetExtType) != 0)
501 if ((getSubclassData() & SCDB_NotContainsNonLocalTargetExtType) != 0)
504 if (!Visited.
insert(
this).second)
507 for (Type *Ty : elements()) {
508 if (Ty->containsNonLocalTargetExtType(Visited)) {
509 const_cast<StructType *
>(
this)->setSubclassData(
510 getSubclassData() | SCDB_ContainsNonLocalTargetExtType);
519 const_cast<StructType *
>(
this)->setSubclassData(
520 getSubclassData() | SCDB_NotContainsNonLocalTargetExtType);
527 return containsHomogeneousTypes();
536 cantFail(setBodyOrError(Elements, isPacked));
540 assert(isOpaque() &&
"Struct body already set!");
542 if (
auto E = checkBody(Elements))
545 setSubclassData(getSubclassData() | SCDB_HasBody);
547 setSubclassData(getSubclassData() | SCDB_Packed);
559 for (
unsigned I = 0;
I < Worklist.size(); ++
I) {
560 Type *Ty = Worklist[
I];
564 Worklist.insert_range(Ty->subtypes());
593 getContext().pImpl->NamedStructTypes.insert(std::make_pair(Name,
this));
596 if (!IterBool.second) {
598 TempStr.push_back(
'.');
604 TmpStream <<
getContext().pImpl->NamedStructTypesUniqueID++;
606 IterBool =
getContext().pImpl->NamedStructTypes.insert(
607 std::make_pair(TmpStream.str(),
this));
608 }
while (!IterBool.second);
628 return get(Context, {}, isPacked);
634 ST->setBody(Elements, isPacked);
639 return create(Context, Elements,
StringRef());
649 "This method may not be invoked with an empty list");
650 return create(Elements[0]->
getContext(), Elements, Name, isPacked);
655 "This method may not be invoked with an empty list");
660 if ((getSubclassData() & SCDB_IsSized) != 0)
673 if (containsHomogeneousScalableVectorTypes()) {
674 const_cast<StructType *
>(
this)->setSubclassData(getSubclassData() |
678 for (Type *Ty : elements()) {
683 if (Ty->isScalableTy())
685 if (!Ty->isSized(Visited))
692 const_cast<StructType*
>(
this)->setSubclassData(
693 getSubclassData() | SCDB_IsSized);
698 assert(!isLiteral() &&
"Literal structs never have names");
705 return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() &&
706 !ElemTy->isMetadataTy() && !ElemTy->isFunctionTy() &&
707 !ElemTy->isTokenTy();
711 if (
this ==
Other)
return true;
713 if (isPacked() !=
Other->isPacked())
716 return elements() ==
Other->elements();
721 assert(indexValid(Idx) &&
"Invalid structure index!");
722 return getElementType(Idx);
728 if (!V->getType()->isIntOrIntVectorTy(32))
733 if (
C && V->getType()->isVectorTy())
734 C =
C->getSplatValue();
740 return C.pImpl->NamedStructTypes.lookup(Name);
748 : Type(ElType->
getContext(), ArrayTyID), ContainedType(ElType),
750 ContainedTys = &ContainedType;
759 pImpl->
ArrayTypes[std::make_pair(ElementType, NumElements)];
767 return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() &&
768 !ElemTy->isMetadataTy() && !ElemTy->isFunctionTy() &&
769 !ElemTy->isTokenTy() && !ElemTy->isX86_AMXTy();
777 : Type(ElType->
getContext(), TID), ContainedType(ElType),
778 ElementQuantity(
EQ) {
779 ContainedTys = &ContainedType;
785 return ScalableVectorType::get(ElementType,
EC.getKnownMinValue());
787 return FixedVectorType::get(ElementType,
EC.getKnownMinValue());
791 if (ElemTy->isIntegerTy() || ElemTy->isFloatingPointTy() ||
794 if (
auto *TTy = dyn_cast<TargetExtType>(ElemTy))
795 return TTy->hasProperty(TargetExtType::CanBeVectorElement);
804 assert(NumElts > 0 &&
"#Elements of a VectorType must be greater than 0");
806 "be an integer, floating point, "
807 "pointer type, or a valid target "
813 VectorType *&Entry = ElementType->getContext()
814 .pImpl->VectorTypes[std::make_pair(ElementType, EC)];
826 unsigned MinNumElts) {
827 assert(MinNumElts > 0 &&
"#Elements of a VectorType must be greater than 0");
829 "be an integer, floating point, or "
835 VectorType *&Entry = ElementType->getContext()
836 .pImpl->VectorTypes[std::make_pair(ElementType, EC)];
848 assert(EltTy &&
"Can't get a pointer to <null> type!");
852 return get(EltTy->getContext(), AddressSpace);
868 : Type(
C, PointerTyID) {
869 setSubclassData(AddrSpace);
872PointerType *Type::getPointerTo(
unsigned AddrSpace)
const {
873 return PointerType::get(
getContext(), AddrSpace);
877 return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() &&
878 !ElemTy->isMetadataTy() && !ElemTy->isTokenTy() &&
879 !ElemTy->isX86_AMXTy();
892 : Type(
C, TargetExtTyID),
Name(
C.pImpl->Saver.save(
Name)) {
893 NumContainedTys = Types.size();
896 Type **Params =
reinterpret_cast<Type **
>(
this + 1);
897 ContainedTys = Params;
898 for (Type *
T : Types)
901 setSubclassData(Ints.
size());
902 unsigned *IntParamSpace =
reinterpret_cast<unsigned *
>(Params);
903 IntParams = IntParamSpace;
904 for (
unsigned IntParam : Ints)
905 *IntParamSpace++ = IntParam;
911 return cantFail(getOrError(
C, Name, Types, Ints));
925 auto [Iter,
Inserted] =
C.pImpl->TargetExtTypes.insert_as(
nullptr,
Key);
931 sizeof(
unsigned) * Ints.
size(),
935 return checkParams(TT);
944 if (TTy->Name ==
"aarch64.svcount" &&
947 "target extension type aarch64.svcount should have no parameters");
950 if (TTy->Name ==
"riscv.vector.tuple" &&
953 "target extension type riscv.vector.tuple should have one "
954 "type parameter and one integer parameter");
957 if (TTy->Name ==
"amdgcn.named.barrier" &&
960 "should have no type parameters "
961 "and one integer parameter");
968struct TargetTypeInfo {
972 template <
typename... ArgTys>
973 TargetTypeInfo(
Type *LayoutType, ArgTys... Properties)
974 : LayoutType(LayoutType), Properties((0 | ... | Properties)) {
975 assert((!(this->Properties & TargetExtType::CanBeVectorElement) ||
976 LayoutType->isSized()) &&
977 "Vector element type must be sized");
985 if (Name ==
"spirv.Image" || Name ==
"spirv.SignedImage")
988 if (Name ==
"spirv.Type") {
989 assert(Ty->getNumIntParameters() == 3 &&
990 "Wrong number of parameters for spirv.Type");
992 auto Size = Ty->getIntParameter(1);
993 auto Alignment = Ty->getIntParameter(2);
996 if (
Size > 0 && Alignment > 0) {
1009 if (Name ==
"spirv.IntegralConstant" || Name ==
"spirv.Literal")
1011 if (
Name.starts_with(
"spirv."))
1017 if (Name ==
"aarch64.svcount")
1025 if (Name ==
"riscv.vector.tuple") {
1026 unsigned TotalNumElts =
1028 ->getMinNumElements(),
1030 Ty->getIntParameter(0);
1031 return TargetTypeInfo(
1037 if (
Name.starts_with(
"dx."))
1043 if (Name ==
"amdgcn.named.barrier") {
1050 if (Name ==
"llvm.test.vectorelement") {
1061 if (
auto *TT = dyn_cast<TargetExtType>(
this))
1062 return TT->hasProperty(TargetExtType::Property::IsTokenLike);
1072 return (Properties & Prop) == Prop;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the StringMap class.
This file implements a class to represent arbitrary precision integral constant values and operations...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static char getTypeID(Type *Ty)
static StringRef getName(Value *V)
static unsigned getNumElements(Type *Ty)
static bool isValidElementType(Type *Ty)
Predicate for the element types that the SLP vectorizer supports.
static TargetTypeInfo getTargetTypeInfo(const TargetExtType *Ty)
This file implements a set that has insertion order iteration characteristics.
This file defines the SmallString class.
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
ArrayType(const Node *Base_, Node *Dimension_)
FunctionType(const Node *Ret_, NodeArray Params_, Qualifiers CVQuals_, FunctionRefQual RefQual_, const Node *ExceptionSpec_)
PointerType(const Node *Pointee_)
VectorType(const Node *BaseType_, const Node *Dimension_)
Class for arbitrary precision integers.
static APInt getAllOnes(unsigned numBits)
Return an APInt of a specified width with all bits set.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
bool empty() const
empty - Check if the array is empty.
static LLVM_ABI ArrayType * get(Type *ElementType, uint64_t NumElements)
This static method is the primary way to construct an ArrayType.
static LLVM_ABI bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
LLVM_ATTRIBUTE_RETURNS_NONNULL void * Allocate(size_t Size, Align Alignment)
Allocate space at the specified alignment.
This is the shared class of boolean and integer constants.
This is an important base class in LLVM.
static constexpr ElementCount getScalable(ScalarTy MinVal)
static constexpr ElementCount getFixed(ScalarTy MinVal)
static ErrorSuccess success()
Create a success value.
Class to represent fixed width SIMD vectors.
static LLVM_ABI FixedVectorType * get(Type *ElementType, unsigned NumElts)
static LLVM_ABI bool isValidArgumentType(Type *ArgTy)
Return true if the specified type is valid as an argument type.
static LLVM_ABI bool isValidReturnType(Type *RetTy)
Return true if the specified type is valid as a return type.
static LLVM_ABI FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
Class to represent integer types.
static LLVM_ABI IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
LLVM_ABI APInt getMask() const
For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
StructTypeSet AnonStructTypes
DenseMap< std::pair< Type *, uint64_t >, ArrayType * > ArrayTypes
DenseMap< unsigned, PointerType * > PointerTypes
PointerType * AS0PointerType
FunctionTypeSet FunctionTypes
This is an important class for using LLVM in a threaded context.
static LLVM_ABI bool isLoadableOrStorableType(Type *ElemTy)
Return true if we can load or store from a pointer to this type.
static LLVM_ABI bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
static LLVM_ABI PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space.
Class to represent scalable SIMD vectors.
static LLVM_ABI ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
A SetVector that performs no allocations if smaller than a certain size.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
void remove(MapEntryTy *KeyValue)
remove - Remove the specified key/value pair from the map, but do not erase it.
AllocatorTy & getAllocator()
StringMapEntry< ValueTy > MapEntryTy
StringRef - Represent a constant reference to a string, i.e.
Class to represent struct types.
LLVM_ABI bool indexValid(const Value *V) const
static LLVM_ABI StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
LLVM_ABI bool containsNonLocalTargetExtType(SmallPtrSetImpl< const Type * > &Visited) const
Return true if this type is or contains a target extension type that disallows being used as a local.
LLVM_ABI void setBody(ArrayRef< Type * > Elements, bool isPacked=false)
Specify a body for an opaque identified type, which must not make the type recursive.
LLVM_ABI bool containsHomogeneousScalableVectorTypes() const
Returns true if this struct contains homogeneous scalable vector types.
LLVM_ABI Error checkBody(ArrayRef< Type * > Elements)
Return an error if the body for an opaque identified type would make it recursive.
LLVM_ABI bool containsHomogeneousTypes() const
Return true if this struct is non-empty and all element types are the same.
LLVM_ABI bool containsNonGlobalTargetExtType(SmallPtrSetImpl< const Type * > &Visited) const
Return true if this type is or contains a target extension type that disallows being used as a global...
static LLVM_ABI StructType * getTypeByName(LLVMContext &C, StringRef Name)
Return the type with the specified name, or null if there is none by that name.
static LLVM_ABI StructType * create(LLVMContext &Context, StringRef Name)
This creates an identified struct.
static LLVM_ABI bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
LLVM_ABI bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
isSized - Return true if this is a sized type.
LLVM_ABI void setName(StringRef Name)
Change the name of this type to the specified name, or to a name with a suffix if there is a collisio...
LLVM_ABI bool isLayoutIdentical(StructType *Other) const
Return true if this is layout identical to the specified struct.
LLVM_ABI Error setBodyOrError(ArrayRef< Type * > Elements, bool isPacked=false)
Specify a body for an opaque identified type or return an error if it would make the type recursive.
LLVM_ABI Type * getTypeAtIndex(const Value *V) const
Given an index value into the type, return the type of the element.
LLVM_ABI bool isScalableTy(SmallPtrSetImpl< const Type * > &Visited) const
Returns true if this struct contains a scalable vector.
LLVM_ABI StringRef getName() const
Return the name for this struct type if it has an identity.
Symbol info for RuntimeDyld.
Class to represent target extensions types, which are generally unintrospectable from target-independ...
unsigned getNumIntParameters() const
static LLVM_ABI TargetExtType * get(LLVMContext &Context, StringRef Name, ArrayRef< Type * > Types={}, ArrayRef< unsigned > Ints={})
Return a target extension type having the specified name and optional type and integer parameters.
unsigned getNumTypeParameters() const
static LLVM_ABI Expected< TargetExtType * > checkParams(TargetExtType *TTy)
Check that a newly created target extension type has the expected number of type parameters and integ...
LLVM_ABI bool hasProperty(Property Prop) const
Returns true if the target extension type contains the given property.
@ IsTokenLike
In particular, it cannot be used in select and phi instructions.
@ HasZeroInit
zeroinitializer is valid for this target extension type.
@ CanBeVectorElement
This type may be used as an element in a vector.
@ CanBeGlobal
This type may be used as the value type of a global variable.
@ CanBeLocal
This type may be allocated on the stack, either as the allocated type of an alloca instruction or as ...
static LLVM_ABI Expected< TargetExtType * > getOrError(LLVMContext &Context, StringRef Name, ArrayRef< Type * > Types={}, ArrayRef< unsigned > Ints={})
Return a target extension type having the specified name and optional type and integer parameters,...
LLVM_ABI Type * getLayoutType() const
Returns an underlying layout type for the target extension type.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
static LLVM_ABI IntegerType * getInt64Ty(LLVMContext &C)
static LLVM_ABI Type * getX86_AMXTy(LLVMContext &C)
LLVM_ABI bool isEmptyTy() const
Return true if this type is empty, that is, it has no elements or all of its elements are empty.
static LLVM_ABI Type * getWasm_ExternrefTy(LLVMContext &C)
LLVM_ABI bool containsNonGlobalTargetExtType(SmallPtrSetImpl< const Type * > &Visited) const
Return true if this type is or contains a target extension type that disallows being used as a global...
static LLVM_ABI Type * getMetadataTy(LLVMContext &C)
static LLVM_ABI Type * getTokenTy(LLVMContext &C)
LLVM_ABI bool containsNonLocalTargetExtType(SmallPtrSetImpl< const Type * > &Visited) const
Return true if this type is or contains a target extension type that disallows being used as a local.
LLVM_ABI bool isScalableTy(SmallPtrSetImpl< const Type * > &Visited) const
Return true if this is a type whose size is a known multiple of vscale.
static LLVM_ABI IntegerType * getInt128Ty(LLVMContext &C)
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
static LLVM_ABI Type * getPPC_FP128Ty(LLVMContext &C)
static LLVM_ABI Type * getFP128Ty(LLVMContext &C)
static LLVM_ABI Type * getLabelTy(LLVMContext &C)
bool isTokenLikeTy() const
Returns true if this is 'token' or a token-like target type.s.
TypeID
Definitions of all of the base types for the Type system.
@ X86_AMXTyID
AMX vectors (8192 bits, X86 specific)
@ TypedPointerTyID
Typed pointer used by some GPU targets.
@ HalfTyID
16-bit floating point type
@ VoidTyID
type with no size
@ ScalableVectorTyID
Scalable SIMD vector type.
@ FloatTyID
32-bit floating point type
@ BFloatTyID
16-bit floating point type (7-bit significand)
@ DoubleTyID
64-bit floating point type
@ X86_FP80TyID
80-bit floating point type (X87)
@ PPC_FP128TyID
128-bit floating point type (two 64-bits, PowerPC)
@ FP128TyID
128-bit floating point type (112-bit significand)
LLVM_ABI bool canLosslesslyBitCastTo(Type *Ty) const
Return true if this type could be converted with a lossless BitCast to type 'Ty'.
static LLVM_ABI Type * getVoidTy(LLVMContext &C)
LLVM_ABI bool isFirstClassType() const
Return true if the type is "first class", meaning it is a valid type for a Value.
static LLVM_ABI Type * getFloatingPointTy(LLVMContext &C, const fltSemantics &S)
static LLVM_ABI IntegerType * getInt8Ty(LLVMContext &C)
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
Type(LLVMContext &C, TypeID tid)
LLVM_ABI bool isRISCVVectorTupleTy() const
LLVM_ABI TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
bool isTargetExtTy() const
Return true if this is a target extension type.
static LLVM_ABI IntegerType * getInt16Ty(LLVMContext &C)
static LLVM_ABI Type * getPrimitiveType(LLVMContext &C, TypeID IDNumber)
Return a type based on an identifier.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
LLVM_ABI unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
static LLVM_ABI IntegerType * getInt1Ty(LLVMContext &C)
friend class LLVMContextImpl
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
bool isX86_AMXTy() const
Return true if this is X86 AMX.
bool isIntegerTy() const
True if this is an instance of IntegerType.
bool isTokenTy() const
Return true if this is 'token'.
static LLVM_ABI IntegerType * getIntNTy(LLVMContext &C, unsigned N)
static LLVM_ABI Type * getDoubleTy(LLVMContext &C)
static LLVM_ABI Type * getX86_FP80Ty(LLVMContext &C)
static LLVM_ABI Type * getFloatTy(LLVMContext &C)
LLVM_ABI int getFPMantissaWidth() const
Return the width of the mantissa of this type.
LLVM_ABI const fltSemantics & getFltSemantics() const
static LLVM_ABI Type * getWasm_FuncrefTy(LLVMContext &C)
static LLVM_ABI Type * getBFloatTy(LLVMContext &C)
static LLVM_ABI Type * getHalfTy(LLVMContext &C)
LLVM_ABI bool isScalableTargetExtTy() const
Return true if this is a target extension type with a scalable layout.
static LLVM_ABI VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
static LLVM_ABI bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
std::pair< iterator, bool > insert_as(const ValueT &V, const LookupKeyT &LookupKey)
Alternative version of insert that uses a different (and possibly less expensive) key type.
constexpr ScalarTy getFixedValue() const
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
A raw_ostream that writes to an SmallVector or SmallString.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static constexpr unsigned RVVBytesPerBlock
constexpr size_t NameSize
ElementType
The element type of an SRV or UAV resource.
Context & getContext() const
LLVM_ABI Instruction & front() const
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
auto dyn_cast_or_null(const Y &Val)
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
bool all_equal(std::initializer_list< T > Values)
Returns true if all Values in the initializer lists are equal or the list.