13#ifndef LLVM_SANDBOXIR_TYPE_H
14#define LLVM_SANDBOXIR_TYPE_H
41#define DEF_INSTR(ID, OPCODE, CLASS) class CLASS;
42#define DEF_CONST(ID, CLASS) class CLASS;
43#include "llvm/SandboxIR/Values.def"
73#define DEF_INSTR(ID, OPCODE, CLASS) friend class CLASS;
74#define DEF_CONST(ID, CLASS) friend class CLASS;
75#include "llvm/SandboxIR/Values.def"
90 bool NoDetails =
false)
const {
91 LLVMTy->print(OS, IsForDebug, NoDetails);
138 return LLVMTy->getFltSemantics();
170 return LLVMTy->isIntegerTy(Bitwidth);
208 return LLVMTy->canLosslesslyBitCastTo(Ty->LLVMTy);
233 LLVMVisited.
reserve(Visited->size());
234 for (
Type *Ty : *Visited)
235 LLVMVisited.
insert(Ty->LLVMTy);
236 return LLVMTy->isSized(&LLVMVisited);
253 return LLVMTy->getPrimitiveSizeInBits();
284 return LLVMTy->getPointerAddressSpace();
317 bool IsPacked =
false);
405 unsigned MinNumElts);
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file defines the SmallPtrSet class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
static constexpr ElementCount get(ScalarTy MinVal, bool Scalable)
Class to represent integer types.
void reserve(size_type NewNumEntries)
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.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
The instances of the Type class are immutable: once they are created, they are never changed.
This class implements an extremely fast bulk output stream that can only output to a stream.
static bool classof(const Type *From)
static LLVM_ABI ArrayType * get(Type *ElementType, uint64_t NumElements)
ConstantDataSequential - A vector or array constant whose element type is a simple 1/2/4/8-byte integ...
static FixedVectorType * getExtendedElementVectorType(FixedVectorType *VTy)
unsigned getNumElements() const
static LLVM_ABI FixedVectorType * get(Type *ElementType, unsigned NumElts)
static bool classof(const Type *T)
static FixedVectorType * getDoubleElementsVectorType(FixedVectorType *VTy)
static FixedVectorType * get(Type *ElementType, const FixedVectorType *FVTy)
static FixedVectorType * getHalfElementsVectorType(FixedVectorType *VTy)
static FixedVectorType * getSubdividedVectorType(FixedVectorType *VTy, int NumSubdivs)
static FixedVectorType * getTruncatedElementVectorType(FixedVectorType *VTy)
static FixedVectorType * getInteger(FixedVectorType *VTy)
static bool classof(const Type *From)
Class to represent integer types.
static LLVM_ABI IntegerType * get(Context &C, unsigned NumBits)
static bool classof(const Type *From)
In SandboxIR the Module is mainly used to access the list of global objects.
static bool classof(const Type *From)
static LLVM_ABI PointerType * get(Context &Ctx, unsigned AddressSpace)
static ScalableVectorType * getExtendedElementVectorType(ScalableVectorType *VTy)
static bool classof(const Type *T)
static ScalableVectorType * getInteger(ScalableVectorType *VTy)
static ScalableVectorType * getHalfElementsVectorType(ScalableVectorType *VTy)
unsigned getMinNumElements() const
static ScalableVectorType * getDoubleElementsVectorType(ScalableVectorType *VTy)
static ScalableVectorType * get(Type *ElementType, const ScalableVectorType *SVTy)
static ScalableVectorType * getSubdividedVectorType(ScalableVectorType *VTy, int NumSubdivs)
static ScalableVectorType * getTruncatedElementVectorType(ScalableVectorType *VTy)
static LLVM_ABI ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
static bool classof(const Type *From)
static LLVM_ABI StructType * get(Context &Ctx, ArrayRef< Type * > Elements, bool IsPacked=false)
This static method is the primary way to create a literal StructType.
Just like llvm::Type these are immutable, unique, never get freed and can only be created via static ...
bool isX86_FP80Ty() const
Return true if this is x86 long double.
bool isScalableTy() const
Return true if this is a type whose size is a known multiple of vscale.
bool isFP128Ty() const
Return true if this is 'fp128'.
static LLVM_ABI Type * getHalfTy(Context &Ctx)
friend class ConstantStruct
friend class ConstantVector
const fltSemantics & getFltSemantics() const
friend class FPMathOperator
bool isIntOrPtrTy() const
Return true if this is an integer type or a pointer type.
bool isTargetExtTy() const
Return true if this is a target extension type.
bool isIEEELikeFPTy() const
Return true if this is a well-behaved IEEE-like type, which has a IEEE compatible layout,...
Type(llvm::Type *LLVMTy, Context &Ctx)
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
bool canLosslesslyBitCastTo(Type *Ty) const
Return true if this type could be converted with a lossless BitCast to type 'Ty'.
friend class TargetExtType
bool isMetadataTy() const
Return true if this is 'metadata'.
static LLVM_ABI Type * getInt8Ty(Context &Ctx)
static LLVM_ABI Type * getDoubleTy(Context &Ctx)
TypeSize getPrimitiveSizeInBits() const
Return the basic size of this type if it is a primitive type.
bool isIntegerTy() const
True if this is an instance of IntegerType.
void print(raw_ostream &OS, bool IsForDebug=false, bool NoDetails=false) const
Print the current type.
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
bool isStructTy() const
True if this is an instance of StructType.
bool isX86_AMXTy() const
Return true if this is X86 AMX.
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
unsigned getScalarSizeInBits() const
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
friend class ConstantDataSequential
bool is16bitFPTy() const
Return true if this is a 16-bit float type.
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
static LLVM_ABI Type * getInt1Ty(Context &Ctx)
friend class FixedVectorType
bool isPtrOrPtrVectorTy() const
Return true if this is a pointer type or a vector of pointer types.
friend class FunctionType
static LLVM_ABI Type * getInt32Ty(Context &Ctx)
bool isArrayTy() const
True if this is an instance of ArrayType.
bool isPPC_FP128Ty() const
Return true if this is powerpc long double.
LLVM_ABI Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
bool isSingleValueType() const
Return true if the type is a valid type for a register in codegen.
LLVM_DUMP_METHOD void dump()
static LLVM_ABI Type * getInt64Ty(Context &Ctx)
bool isTokenTy() const
Return true if this is 'token'.
bool isVoidTy() const
Return true if this is 'void'.
int getFPMantissaWidth() const
Return the width of the mantissa of this type.
bool isFunctionTy() const
True if this is an instance of FunctionType.
friend class ConstantArray
bool isScalableTargetExtTy() const
Return true if this is a target extension type with a scalable layout.
void dumpOS(raw_ostream &OS)
bool isVectorTy() const
True if this is an instance of VectorType.
bool isMultiUnitFPType() const
Returns true if this is a floating-point type that is an unevaluated sum of multiple floating-point u...
bool isEmptyTy() const
Return true if this type is empty, that is, it has no elements or all of its elements are empty.
bool isPointerTy() const
True if this is an instance of PointerType.
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
bool isIntegerTy(unsigned Bitwidth) const
Return true if this is an IntegerType of the given width.
bool isAggregateType() const
Return true if the type is an aggregate type.
bool isFirstClassType() const
Return true if the type is "first class", meaning it is a valid type for a Value.
friend class ScalableVectorType
Context & getContext() const
bool isLabelTy() const
Return true if this is 'label'.
static LLVM_ABI Type * getFloatTy(Context &Ctx)
static LLVM_ABI Type * getInt16Ty(Context &Ctx)
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.
static LLVM_ABI bool isValidElementType(Type *ElemTy)
ElementCount getElementCount() const
static LLVM_ABI VectorType * getSubdividedVectorType(VectorType *VTy, int NumSubdivs)
static VectorType * get(Type *ElementType, const VectorType *Other)
static bool classof(const Type *From)
static VectorType * get(Type *ElementType, unsigned NumElements, bool Scalable)
static LLVM_ABI VectorType * getInteger(VectorType *VTy)
static LLVM_ABI VectorType * get(Type *ElementType, ElementCount EC)
static LLVM_ABI VectorType * getTruncatedElementVectorType(VectorType *VTy)
static LLVM_ABI VectorType * getDoubleElementsVectorType(VectorType *VTy)
static LLVM_ABI VectorType * getHalfElementsVectorType(VectorType *VTy)
static LLVM_ABI VectorType * getExtendedElementVectorType(VectorType *VTy)
LLVM_ABI Type * getElementType() const
@ C
The default llvm calling convention, compatible with C.
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...
constexpr unsigned BitWidth
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.