Go to the documentation of this file.
14 #ifndef LLVM_IR_TYPE_H
15 #define LLVM_IR_TYPE_H
35 template <
typename PtrType>
class SmallPtrSetImpl;
87 unsigned SubclassData : 24;
124 bool NoDetails =
false)
const;
307 return isSizedDerivedType(Visited);
344 return const_cast<Type *
>(
this);
406 [[deprecated(
"Deprecated without replacement, see "
407 "https://llvm.org/docs/OpaquePointers.html for context and "
408 "migration instructions")]]
419 "Attempting to get element type of opaque pointer");
471 int noOfBits =
sizeof(ScalarTy) * CHAR_BIT;
472 if (std::is_integral<ScalarTy>::value) {
474 }
else if (std::is_floating_point<ScalarTy>::value) {
537 return reinterpret_cast<Type**
>(Tys);
546 #endif // LLVM_IR_TYPE_H
bool isFunctionVarArg() const
@ FloatTyID
32-bit floating point type
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
subtype_iterator subtype_end() const
@ DoubleTyID
64-bit floating point type
This is an optimization pass for GlobalISel generic memory operations.
static PointerType * getInt16PtrTy(LLVMContext &C, unsigned AS=0)
static IntegerType * getInt1Ty(LLVMContext &C)
unsigned getFunctionNumParams() const
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
bool isX86_MMXTy() const
Return true if this is X86 MMX.
static Type * getScalarTy(LLVMContext &C)
static Type * getFP128Ty(LLVMContext &C)
bool isPointerTy() const
True if this is an instance of PointerType.
@ VoidTyID
type with no size
StringRef getTargetExtName() const
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
const fltSemantics & getFltSemantics() const
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
@ X86_AMXTyID
AMX vectors (8192 bits, X86 specific)
unsigned getSubclassData() const
TypeID getTypeID() const
Return the type id for the type.
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
The instances of the Type class are immutable: once they are created, they are never changed.
static Type * getTokenTy(LLVMContext &C)
bool isX86_FP80Ty() const
Return true if this is x86 long double.
static Type * getPrimitiveType(LLVMContext &C, TypeID IDNumber)
Return a type based on an identifier.
subtype_iterator subtype_begin() const
Type *const * subtype_iterator
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
Type * getNonOpaquePointerElementType() const
Only use this method in code that is not reachable with opaque pointers, or part of deprecated method...
static PointerType * getInt32PtrTy(LLVMContext &C, unsigned AS=0)
bool isMetadataTy() const
Return true if this is 'metadata'.
static IntegerType * getInt8Ty(LLVMContext &C)
static IntegerType * getInt32Ty(LLVMContext &C)
Type * getWithNewType(Type *EltTy) const
Given vector type, change the element type, whilst keeping the old number of elements.
static PointerType * getBFloatPtrTy(LLVMContext &C, unsigned AS=0)
bool isMultiUnitFPType() const
Returns true if this is a floating-point type that is an unevaluated sum of multiple floating-point u...
static Type * getMetadataTy(LLVMContext &C)
bool isArrayTy() const
True if this is an instance of ArrayType.
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
bool isSingleValueType() const
Return true if the type is a valid type for a register in codegen.
static PointerType * getFP128PtrTy(LLVMContext &C, unsigned AS=0)
static Type * getX86_AMXTy(LLVMContext &C)
static Type * getPPC_FP128Ty(LLVMContext &C)
static Type * getDoubleTy(LLVMContext &C)
(vector float) vec_cmpeq(*A, *B) C
void print(raw_ostream &O, bool IsForDebug=false, bool NoDetails=false) const
Print the current type.
static PointerType * getPPC_FP128PtrTy(LLVMContext &C, unsigned AS=0)
StringRef getStructName() const
bool isTargetExtTy() const
Return true if this is a target extension type.
bool isVectorTy() const
True if this is an instance of VectorType.
Class to represent integer types.
bool isTokenTy() const
Return true if this is 'token'.
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
Attribute unwrap(LLVMAttributeRef Attr)
This class implements an extremely fast bulk output stream that can only output to a stream.
struct LLVMOpaqueType * LLVMTypeRef
Each value in the LLVM IR has a type, an LLVMTypeRef.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
subtype_reverse_iterator subtype_rbegin() const
static PointerType * getInt1PtrTy(LLVMContext &C, unsigned AS=0)
bool isFunctionTy() const
True if this is an instance of FunctionType.
@ BFloatTyID
16-bit floating point type (7-bit significand)
unsigned getIntegerBitWidth() const
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
unsigned getStructNumElements() const
Type * getExtendedType() const
Given scalar/vector integer type, returns a type with elements twice as wide as in the original type.
bool isIntegerTy() const
True if this is an instance of IntegerType.
static PointerType * getIntNPtrTy(LLVMContext &C, unsigned N, unsigned AS=0)
bool isIEEELikeFPTy() const
Return true if this is a well-behaved IEEE-like type, which has a IEEE compatible layout as defined b...
ArrayRef< Type * > subtypes() const
Type * getArrayElementType() const
The initial backend is deliberately restricted to z10 We should add support for later architectures at some point If an asm ties an i32 r result to an i64 the input will be treated as an leaving the upper bits uninitialised For i64 store i32 val
int getFPMantissaWidth() const
Return the width of the mantissa of this type.
Type * getWithNewBitWidth(unsigned NewBitWidth) const
Given an integer or vector type, change the lane bitwidth to NewBitwidth, whilst keeping the old numb...
@ X86_MMXTyID
MMX vectors (64 bits, X86 specific)
static PointerType * getHalfPtrTy(LLVMContext &C, unsigned AS=0)
bool isIntOrPtrTy() const
Return true if this is an integer type or a pointer type.
This is an important class for using LLVM in a threaded context.
static PointerType * getInt64PtrTy(LLVMContext &C, unsigned AS=0)
subtype_reverse_iterator subtype_rend() const
Class to represent pointers.
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
into xmm2 addss xmm2 xmm1 xmm3 addss xmm3 movaps xmm0 unpcklps xmm0 ret seems silly when it could just be one addps Expand libm rounding functions inline
static PointerType * getX86_MMXPtrTy(LLVMContext &C, unsigned AS=0)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
uint64_t getArrayNumElements() const
bool isVoidTy() const
Return true if this is 'void'.
static Type * getX86_FP80Ty(LLVMContext &C)
static PointerType * getDoublePtrTy(LLVMContext &C, unsigned AS=0)
bool is16bitFPTy() const
Return true if this is a 16-bit float type.
@ FP128TyID
128-bit floating point type (112-bit significand)
LLVMAttributeRef wrap(Attribute Attr)
void setSubclassData(unsigned val)
Type(LLVMContext &C, TypeID tid)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
@ PPC_FP128TyID
128-bit floating point type (two 64-bits, PowerPC)
StringRef - Represent a constant reference to a string, i.e.
Type * getStructElementType(unsigned N) const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned getNumContainedTypes() const
Return the number of types in the derived type.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
bool isLabelTy() const
Return true if this is 'label'.
bool isPtrOrPtrVectorTy() const
Return true if this is a pointer type or a vector of pointer types.
@ TypedPointerTyID
Typed pointer used by some GPU targets.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
static IntegerType * getInt128Ty(LLVMContext &C)
static PointerType * getFloatPtrTy(LLVMContext &C, unsigned AS=0)
@ IntegerTyID
Arbitrary bit width integers.
unsigned NumContainedTys
Keeps track of how many Type*'s there are in the ContainedTys list.
static IntegerType * getInt64Ty(LLVMContext &C)
static IntegerType * getIntNTy(LLVMContext &C, unsigned N)
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
static Type * getHalfTy(LLVMContext &C)
@ FixedVectorTyID
Fixed width SIMD vector type.
bool isEmptyTy() const
Return true if this type is empty, that is, it has no elements or all of its elements are empty.
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
constexpr unsigned BitWidth
bool isIEEE() const
Return whether the type is IEEE compatible, as defined by the eponymous method in APFloat.
PointerType * getPointerTo(unsigned AddrSpace=0) const
Return a pointer to the current type.
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
bool isPPC_FP128Ty() const
Return true if this is powerpc long double.
static Type * getBFloatTy(LLVMContext &C)
Type *const * ContainedTys
A pointer to the array of Types contained by this Type.
static PointerType * getX86_FP80PtrTy(LLVMContext &C, unsigned AS=0)
static Type * getVoidTy(LLVMContext &C)
bool isOpaquePointerTy() const
True if this is an instance of an opaque PointerType.
bool isStructTy() const
True if this is an instance of StructType.
static bool doit(const Type &Ty)
bool isBFloatTy() const
Return true if this is 'bfloat', a 16-bit bfloat type.
bool isIntOrIntVectorTy(unsigned BitWidth) const
Return true if this is an integer type or a vector of integer types of the given width.
Type * getPointerElementType() const
This method is deprecated without replacement.
std::reverse_iterator< subtype_iterator > subtype_reverse_iterator
static IntegerType * getInt16Ty(LLVMContext &C)
@ ScalableVectorTyID
Scalable SIMD vector type.
ArrayRef(const T &OneElt) -> ArrayRef< T >
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
static Type * getLabelTy(LLVMContext &C)
bool isAggregateType() const
Return true if the type is an aggregate type.
TypeID
Definitions of all of the base types for the Type system.
static Type * getX86_MMXTy(LLVMContext &C)
Type * getFunctionParamType(unsigned i) const
bool canLosslesslyBitCastTo(Type *Ty) const
Return true if this type could be converted with a lossless BitCast to type 'Ty'.
@ TargetExtTyID
Target extension type.
Type * getContainedType(unsigned i) const
This method is used to implement the type iterator (defined at the end of the file).
bool isFP128Ty() const
Return true if this is 'fp128'.
static PointerType * getX86_AMXPtrTy(LLVMContext &C, unsigned AS=0)
@ HalfTyID
16-bit floating point type
@ X86_FP80TyID
80-bit floating point type (X87)
static Type * getFloatTy(LLVMContext &C)
static Type * getFloatingPointTy(LLVMContext &C, const fltSemantics &S)
bool isX86_AMXTy() const
Return true if this is X86 AMX.
bool isFirstClassType() const
Return true if the type is "first class", meaning it is a valid type for a Value.
TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.