68 return cast<ArrayType>(
this)->getElementType()->isScalableTy();
70 return cast<StructType>(
this)->isScalableTy();
78 return ATy->getElementType()->containsNonGlobalTargetExtType();
80 return STy->containsNonGlobalTargetExtType();
82 return !
TT->hasProperty(TargetExtType::CanBeGlobal);
88 return ATy->getElementType()->containsNonLocalTargetExtType();
90 return STy->containsNonLocalTargetExtType();
92 return !
TT->hasProperty(TargetExtType::CanBeLocal);
98 case HalfTyID:
return APFloat::IEEEhalf();
100 case FloatTyID:
return APFloat::IEEEsingle();
101 case DoubleTyID:
return APFloat::IEEEdouble();
103 case FP128TyID:
return APFloat::IEEEquad();
111 return isa<ScalableVectorType>(
TT->getLayoutType());
140 return cast<TargetExtType>(
this)->getName() ==
"riscv.vector.tuple";
154 if (isa<VectorType>(
this) && isa<VectorType>(Ty))
158 if (((isa<FixedVectorType>(
this)) && Ty->isX86_AMXTy()) &&
162 Ty->getPrimitiveSizeInBits().getFixedValue() == 8192)
172 unsigned NumElements = ATy->getNumElements();
173 return NumElements == 0 || ATy->getElementType()->isEmptyTy();
177 unsigned NumElements = STy->getNumElements();
178 for (
unsigned i = 0; i < NumElements; ++i)
179 if (!STy->getElementType(i)->isEmptyTy())
190 return TypeSize::getFixed(16);
191 case Type::BFloatTyID:
192 return TypeSize::getFixed(16);
193 case Type::FloatTyID:
194 return TypeSize::getFixed(32);
195 case Type::DoubleTyID:
196 return TypeSize::getFixed(64);
197 case Type::X86_FP80TyID:
198 return TypeSize::getFixed(80);
199 case Type::FP128TyID:
200 return TypeSize::getFixed(128);
201 case Type::PPC_FP128TyID:
202 return TypeSize::getFixed(128);
203 case Type::X86_AMXTyID:
204 return TypeSize::getFixed(8192);
206 return TypeSize::getFixed(cast<ByteType>(
this)->
getBitWidth());
207 case Type::IntegerTyID:
208 return TypeSize::getFixed(cast<IntegerType>(
this)->
getBitWidth());
209 case Type::FixedVectorTyID:
210 case Type::ScalableVectorTyID: {
211 const VectorType *VTy = cast<VectorType>(
this);
212 ElementCount
EC = VTy->getElementCount();
213 TypeSize ETS = VTy->getElementType()->getPrimitiveSizeInBits();
214 assert(!ETS.
isScalable() &&
"Vector type should have fixed-width elements");
218 return TypeSize::getFixed(0);
224 return VTy->getElementType()->getFPMantissaWidth();
244 auto *
ST = cast<StructType>(
this);
245 return !
ST->isOpaque();
250bool Type::isSizedDerivedType()
const {
252 return ATy->getElementType()->isSized();
255 return VTy->getElementType()->isSized();
258 return TTy->getLayoutType()->isSized();
260 return cast<StructType>(
this)->isSized();
288 return ByteType::get(
C,
N);
299 return IntegerType::get(
C,
N);
303 assert(Ty->isByteOrByteVectorTy() &&
"Expected a byte or byte vector type.");
304 unsigned NumBits = Ty->getScalarSizeInBits();
305 IntegerType *IntTy = IntegerType::get(Ty->getContext(), NumBits);
307 return VectorType::get(IntTy, VecTy);
312 assert(!Ty->isPtrOrPtrVectorTy() &&
313 "Expected a non-pointer or non-pointer vector type.");
314 unsigned NumBits = Ty->getScalarSizeInBits();
315 ByteType *ByteTy = ByteType::get(Ty->getContext(), NumBits);
317 return VectorType::get(ByteTy, VecTy);
322 return TargetExtType::get(
C,
"wasm.externref", {}, {});
326 return TargetExtType::get(
C,
"wasm.funcref", {}, {});
334 assert(NumBits >= MIN_INT_BITS &&
"bitwidth too small");
335 assert(NumBits <= MAX_INT_BITS &&
"bitwidth too large");
364 assert(NumBits >= MIN_BYTE_BITS &&
"bitwidth too small");
365 assert(NumBits <= MAX_BYTE_BITS &&
"bitwidth too large");
383 ByteType *&Entry =
C.pImpl->ByteTypes[NumBits];
386 Entry =
new (
C.pImpl->Alloc)
ByteType(
C, NumBits);
400 Type **SubTys =
reinterpret_cast<Type**
>(
this+1);
401 assert(isValidReturnType(Result) &&
"invalid return type for function");
402 setSubclassData(IsVarArgs);
406 for (
unsigned i = 0, e = Params.
size(); i != e; ++i) {
407 assert(isValidArgumentType(Params[i]) &&
408 "Not a valid type for function argument!");
409 SubTys[i+1] = Params[i];
412 ContainedTys = SubTys;
413 NumContainedTys = Params.
size() + 1;
420 const FunctionTypeKeyInfo::KeyTy
Key(ReturnType, Params,
isVarArg);
428 if (Insertion.second) {
435 *Insertion.first = FT;
438 FT = *Insertion.first;
448 return !RetTy->isFunctionTy() && !RetTy->isLabelTy() &&
449 !RetTy->isMetadataTy();
453 return ArgTy->isFirstClassType() && !ArgTy->isLabelTy();
474 if (Insertion.second) {
478 ST->setSubclassData(SCDB_IsLiteral);
479 ST->setBody(ETypes, isPacked);
480 *Insertion.first =
ST;
483 ST = *Insertion.first;
490 if ((getSubclassData() & SCDB_ContainsScalableVector) != 0)
493 if ((getSubclassData() & SCDB_NotContainsScalableVector) != 0)
496 for (Type *Ty : elements()) {
497 if (Ty->isScalableTy()) {
498 const_cast<StructType *
>(
this)->setSubclassData(
499 getSubclassData() | SCDB_ContainsScalableVector);
508 const_cast<StructType *
>(
this)->setSubclassData(
509 getSubclassData() | SCDB_NotContainsScalableVector);
514 if ((getSubclassData() & SCDB_ContainsNonGlobalTargetExtType) != 0)
517 if ((getSubclassData() & SCDB_NotContainsNonGlobalTargetExtType) != 0)
520 for (Type *Ty : elements()) {
521 if (Ty->containsNonGlobalTargetExtType()) {
522 const_cast<StructType *
>(
this)->setSubclassData(
523 getSubclassData() | SCDB_ContainsNonGlobalTargetExtType);
532 const_cast<StructType *
>(
this)->setSubclassData(
533 getSubclassData() | SCDB_NotContainsNonGlobalTargetExtType);
538 if ((getSubclassData() & SCDB_ContainsNonLocalTargetExtType) != 0)
541 if ((getSubclassData() & SCDB_NotContainsNonLocalTargetExtType) != 0)
544 for (Type *Ty : elements()) {
545 if (Ty->containsNonLocalTargetExtType()) {
546 const_cast<StructType *
>(
this)->setSubclassData(
547 getSubclassData() | SCDB_ContainsNonLocalTargetExtType);
556 const_cast<StructType *
>(
this)->setSubclassData(
557 getSubclassData() | SCDB_NotContainsNonLocalTargetExtType);
564 return containsHomogeneousTypes();
573 cantFail(setBodyOrError(Elements, isPacked));
577 assert(isOpaque() &&
"Struct body already set!");
579 if (
auto E = checkBody(Elements))
582 setSubclassData(getSubclassData() | SCDB_HasBody);
584 setSubclassData(getSubclassData() | SCDB_Packed);
596 for (
unsigned I = 0;
I < Worklist.size(); ++
I) {
597 Type *Ty = Worklist[
I];
601 Worklist.insert_range(Ty->subtypes());
630 getContext().pImpl->NamedStructTypes.insert(std::make_pair(Name,
this));
633 if (!IterBool.second) {
635 TempStr.push_back(
'.');
641 TmpStream <<
getContext().pImpl->NamedStructTypesUniqueID++;
643 IterBool =
getContext().pImpl->NamedStructTypes.insert(
644 std::make_pair(TmpStream.str(),
this));
645 }
while (!IterBool.second);
671 ST->setBody(Elements, isPacked);
676 return create(Context, Elements,
StringRef());
686 "This method may not be invoked with an empty list");
687 return create(Elements[0]->
getContext(), Elements, Name, isPacked);
692 "This method may not be invoked with an empty list");
697 if ((getSubclassData() & SCDB_IsSized) != 0)
707 if (containsHomogeneousScalableVectorTypes()) {
708 const_cast<StructType *
>(
this)->setSubclassData(getSubclassData() |
712 for (Type *Ty : elements()) {
717 if (Ty->isScalableTy())
726 const_cast<StructType*
>(
this)->setSubclassData(
727 getSubclassData() | SCDB_IsSized);
732 assert(!isLiteral() &&
"Literal structs never have names");
745 if (
this ==
Other)
return true;
750 return elements() ==
Other->elements();
755 assert(indexValid(Idx) &&
"Invalid structure index!");
756 return getElementType(Idx);
762 if (!
V->getType()->isIntOrIntVectorTy(32))
767 if (
C &&
V->getType()->isVectorTy())
768 C =
C->getSplatValue();
774 return C.pImpl->NamedStructTypes.lookup(Name);
784 ContainedTys = &ContainedType;
793 pImpl->
ArrayTypes[std::make_pair(ElementType, NumElements)];
801 return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() &&
802 !ElemTy->isMetadataTy() && !ElemTy->isFunctionTy() &&
803 !ElemTy->isTokenTy() && !ElemTy->isX86_AMXTy();
811 : Type(ElType->
getContext(), TID), ContainedType(ElType),
812 ElementQuantity(
EQ) {
813 ContainedTys = &ContainedType;
819 return ScalableVectorType::get(ElementType,
EC.getKnownMinValue());
821 return FixedVectorType::get(ElementType,
EC.getKnownMinValue());
825 if (ElemTy->isIntegerTy() || ElemTy->isFloatingPointTy() ||
830 return TTy->hasProperty(TargetExtType::CanBeVectorElement);
839 assert(NumElts > 0 &&
"#Elements of a VectorType must be greater than 0");
841 "be an integer, floating point, "
842 "pointer type, or a valid target "
848 VectorType *&Entry = ElementType->getContext()
849 .pImpl->VectorTypes[std::make_pair(ElementType, EC)];
861 unsigned MinNumElts) {
862 assert(MinNumElts > 0 &&
"#Elements of a VectorType must be greater than 0");
864 "be an integer, floating point, or "
870 VectorType *&Entry = ElementType->getContext()
871 .pImpl->VectorTypes[std::make_pair(ElementType, EC)];
896 setSubclassData(AddrSpace);
900 return !ElemTy->isVoidTy() && !ElemTy->isLabelTy() &&
901 !ElemTy->isMetadataTy() && !ElemTy->isTokenTy() &&
902 !ElemTy->isX86_AMXTy();
916 NumContainedTys = Types.size();
919 Type **Params =
reinterpret_cast<Type **
>(
this + 1);
920 ContainedTys = Params;
921 for (Type *
T : Types)
924 setSubclassData(Ints.
size());
925 unsigned *IntParamSpace =
reinterpret_cast<unsigned *
>(Params);
926 IntParams = IntParamSpace;
927 for (
unsigned IntParam : Ints)
928 *IntParamSpace++ = IntParam;
934 return cantFail(getOrError(
C, Name, Types, Ints));
948 auto [Iter,
Inserted] =
C.pImpl->TargetExtTypes.insert_as(
nullptr,
Key);
954 sizeof(
unsigned) * Ints.
size(),
958 return checkParams(TT);
967 if (TTy->Name ==
"aarch64.svcount" &&
970 "target extension type aarch64.svcount should have no parameters");
973 if (TTy->Name ==
"riscv.vector.tuple" &&
976 "target extension type riscv.vector.tuple should have one "
977 "type parameter and one integer parameter");
980 if (TTy->Name ==
"amdgcn.named.barrier" &&
983 "should have no type parameters "
984 "and one integer parameter");
986 if (TTy->Name ==
"amdgpu.stridemark" &&
989 "should have no type parameters "
990 "and at most one integer parameter");
997struct TargetTypeInfo {
1001 template <
typename... ArgTys>
1002 TargetTypeInfo(
Type *LayoutType, ArgTys... Properties)
1003 : LayoutType(LayoutType), Properties((0 | ... | Properties)) {
1004 assert((!(this->Properties & TargetExtType::CanBeVectorElement) ||
1005 LayoutType->isSized()) &&
1006 "Vector element type must be sized");
1014 if (Name ==
"spirv.Image" || Name ==
"spirv.SignedImage")
1017 if (Name ==
"spirv.Type") {
1018 assert(Ty->getNumIntParameters() == 3 &&
1019 "Wrong number of parameters for spirv.Type");
1021 auto Size = Ty->getIntParameter(1);
1022 auto Alignment = Ty->getIntParameter(2);
1025 if (
Size > 0 && Alignment > 0) {
1038 if (Name ==
"spirv.IntegralConstant" || Name ==
"spirv.Literal")
1040 if (Name ==
"spirv.Padding")
1041 return TargetTypeInfo(
1044 if (
Name.starts_with(
"spirv.")) {
1045 if (
Name.ends_with(
"TypedPointerType"))
1056 if (Name ==
"aarch64.svcount")
1064 if (Name ==
"riscv.vector.tuple") {
1065 unsigned TotalNumElts =
1067 ->getMinNumElements(),
1069 Ty->getIntParameter(0);
1070 return TargetTypeInfo(
1076 if (Name ==
"dx.Padding")
1077 return TargetTypeInfo(
1080 if (
Name.starts_with(
"dx."))
1087 if (Name ==
"amdgcn.named.barrier")
1089 if (Name ==
"amdgpu.stridemark")
1094 if (Name ==
"llvm.test.vectorelement") {
1100 if (Name ==
"wasm.funcref" || Name ==
"wasm.externref")
1112 return TT->hasProperty(TargetExtType::Property::IsTokenLike);
1122 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...
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
static char getTypeID(Type *Ty)
@ TargetExtTyID
Target extension type.
static StringRef getName(Value *V)
Func getContext().diagnose(DiagnosticInfoUnsupported(Func
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_)
static LLVM_ABI Semantics SemanticsToEnum(const llvm::fltSemantics &Sem)
Class for arbitrary precision integers.
static APInt getAllOnes(unsigned numBits)
Return an APInt of a specified width with all bits set.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
Get the array size.
bool empty() const
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.
Class to represent byte types.
static LLVM_ABI ByteType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing a ByteType.
LLVM_ABI APInt getMask() const
For example, this is 0xFF for an 8 bit byte, 0xFFFF for b16, etc.
This is the shared class of boolean and integer constants.
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 PointerType * getUnqual(LLVMContext &C)
This constructs an opaque pointer to an object in the default address space (address space zero).
static LLVM_ABI bool isLoadableOrStorableType(Type *ElemTy)
Return true if we can load or store from a pointer to this type.
static LLVM_ABI PointerType * get(LLVMContext &C, unsigned AddressSpace)
This constructs an opaque pointer to an object in a numbered address space.
static LLVM_ABI bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
Class to represent scalable SIMD vectors.
static LLVM_ABI ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
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
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 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 bool containsNonLocalTargetExtType() const
Return true if this type is or contains a target extension type that disallows being used as a local.
LLVM_ABI bool containsNonGlobalTargetExtType() const
Return true if this type is or contains a target extension type that disallows being used as a global...
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.
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 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() const
Returns true if this struct contains a scalable vector.
LLVM_ABI bool isSized() const
isSized - Return true if this is a sized type.
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 ByteType * getByte16Ty(LLVMContext &C)
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.
bool isByteTy() const
True if this is an instance of ByteType.
static LLVM_ABI Type * getWasm_ExternrefTy(LLVMContext &C)
static LLVM_ABI Type * getMetadataTy(LLVMContext &C)
static LLVM_ABI Type * getTokenTy(LLVMContext &C)
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)
LLVM_ABI bool isTokenLikeTy() const
Returns true if this is 'token' or a token-like target type.s.
static LLVM_ABI Type * getByteFromIntType(Type *)
Returns a byte (vector of byte) type with the same size of an integer of the given integer (vector of...
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
@ TargetExtTyID
Target extension 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)
static LLVM_ABI ByteType * getByte32Ty(LLVMContext &C)
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(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.
static LLVM_ABI Type * getIntFromByteType(Type *)
Returns an integer (vector of integer) type with the same size of a byte of the given byte (vector of...
static LLVM_ABI ByteType * getByte8Ty(LLVMContext &C)
static LLVM_ABI IntegerType * getInt1Ty(LLVMContext &C)
friend class LLVMContextImpl
static LLVM_ABI ByteType * getByte128Ty(LLVMContext &C)
static LLVM_ABI ByteType * getByte1Ty(LLVMContext &C)
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.
LLVM_ABI bool isScalableTy() const
Return true if this is a type whose size is a known multiple of vscale.
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.
static LLVM_ABI ByteType * getByteNTy(LLVMContext &C, unsigned N)
LLVM_ABI const fltSemantics & getFltSemantics() const
static LLVM_ABI Type * getWasm_FuncrefTy(LLVMContext &C)
static LLVM_ABI ByteType * getByte64Ty(LLVMContext &C)
static LLVM_ABI Type * getBFloatTy(LLVMContext &C)
static LLVM_ABI Type * getHalfTy(LLVMContext &C)
LLVM_ABI bool containsNonLocalTargetExtType() const
Return true if this type is or contains a target extension type that disallows being used as a local.
LLVM_ABI bool containsNonGlobalTargetExtType() const
Return true if this type is or contains a target extension type that disallows being used as a global...
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 bool isPacked(const T &...O)
constexpr size_t NameSize
ElementType
The element type of an SRV or UAV resource.
EnumSet< Property > Properties
LLVM_ABI Instruction & front() const
unsigned getNumElements(Type *Ty)
bool isValidElementType(Type *Ty, bool ReVec)
Predicate for the element types that the SLP vectorizer supports.
This is an optimization pass for GlobalISel generic memory operations.
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.