13#ifndef LLVM_SANDBOXIR_TYPE_H
14#define LLVM_SANDBOXIR_TYPE_H
30class ConstantDataSequential;
37class ScalableVectorType;
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 {
233 LLVMVisited.
reserve(Visited->size());
234 for (
Type *Ty : *Visited)
235 LLVMVisited.
insert(Ty->LLVMTy);
300 return isa<llvm::PointerType>(
From->LLVMTy);
309 return isa<llvm::ArrayType>(
From->LLVMTy);
317 bool IsPacked =
false);
323 return isa<llvm::StructType>(
From->LLVMTy);
342 return cast<llvm::VectorType>(
LLVMTy)->getElementCount();
354 return isa<llvm::VectorType>(
From->LLVMTy);
375 return cast<FixedVectorType>(
381 return cast<FixedVectorType>(
394 return isa<llvm::FixedVectorType>(
T->LLVMTy);
398 return cast<llvm::FixedVectorType>(
LLVMTy)->getNumElements();
405 unsigned MinNumElts);
418 return cast<ScalableVectorType>(
424 return cast<ScalableVectorType>(
430 return cast<ScalableVectorType>(
441 return cast<ScalableVectorType>(
446 return cast<llvm::ScalableVectorType>(
LLVMTy)->getMinNumElements();
450 return isa<llvm::ScalableVectorType>(
T->LLVMTy);
458 return isa<llvm::FunctionType>(
From->LLVMTy);
471 return isa<llvm::IntegerType>(
From->LLVMTy);
474 return *cast<llvm::IntegerType>(
LLVMTy);
BlockVerifier::State From
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Machine Check Debug Module
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.
Class to represent target extensions types, which are generally unintrospectable from target-independ...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM_ABI TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
bool isVectorTy() const
True if this is an instance of VectorType.
bool isX86_FP80Ty() const
Return true if this is x86 long double.
LLVM_ABI int getFPMantissaWidth() const
Return the width of the mantissa of this type.
LLVM_ABI bool canLosslesslyBitCastTo(Type *Ty) const
Return true if this type could be converted with a lossless BitCast to type 'Ty'.
bool isArrayTy() const
True if this is an instance of ArrayType.
bool isLabelTy() const
Return true if this is 'label'.
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
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 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 isBFloatTy() const
Return true if this is 'bfloat', a 16-bit bfloat type.
LLVM_ABI bool isFirstClassType() const
Return true if the type is "first class", meaning it is a valid type for a Value.
LLVM_ABI bool isScalableTargetExtTy() const
Return true if this is a target extension type with a scalable layout.
bool isSingleValueType() const
Return true if the type is a valid type for a register in codegen.
bool isPPC_FP128Ty() const
Return true if this is powerpc long double.
bool isFP128Ty() const
Return true if this is 'fp128'.
bool is16bitFPTy() const
Return true if this is a 16-bit float type.
LLVM_ABI unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
LLVM_ABI bool isScalableTy(SmallPtrSetImpl< const Type * > &Visited) const
Return true if this is a type whose size is a known multiple of vscale.
bool isMultiUnitFPType() const
Returns true if this is a floating-point type that is an unevaluated sum of multiple floating-point u...
bool isStructTy() const
True if this is an instance of StructType.
bool isTargetExtTy() const
Return true if this is a target extension type.
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
bool isAggregateType() const
Return true if the type is an aggregate type.
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
bool isPtrOrPtrVectorTy() const
Return true if this is a pointer type or a vector of pointer types.
bool isX86_AMXTy() const
Return true if this is X86 AMX.
bool isFunctionTy() const
True if this is an instance of FunctionType.
bool isIntOrPtrTy() const
Return true if this is an integer type or a pointer type.
LLVM_ABI const fltSemantics & getFltSemantics() const
LLVM_ABI unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
bool isIntegerTy() const
True if this is an instance of IntegerType.
bool isTokenTy() const
Return true if this is 'token'.
LLVM_ABI void print(raw_ostream &O, bool IsForDebug=false, bool NoDetails=false) const
Print the current type.
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
bool isIEEELikeFPTy() const
Return true if this is a well-behaved IEEE-like type, which has a IEEE compatible layout,...
bool isVoidTy() const
Return true if this is 'void'.
bool isMetadataTy() const
Return true if this is 'metadata'.
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'.
const fltSemantics & getFltSemantics() const
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.
static LLVM_ABI Type * getDoubleTy(Context &Ctx)
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.
static LLVM_ABI Type * getInt8Ty(Context &Ctx)
bool canLosslesslyBitCastTo(Type *Ty) const
Return true if this type could be converted with a lossless BitCast to type 'Ty'.
bool isMetadataTy() const
Return true if this is 'metadata'.
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.
void dumpOS(raw_ostream &OS)
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.
bool is16bitFPTy() const
Return true if this is a 16-bit float type.
static LLVM_ABI Type * getInt64Ty(Context &Ctx)
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)
bool isPtrOrPtrVectorTy() const
Return true if this is a pointer type or a vector of pointer types.
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.
bool isTokenTy() const
Return true if this is 'token'.
bool isVoidTy() const
Return true if this is 'void'.
static LLVM_ABI Type * getInt16Ty(Context &Ctx)
int getFPMantissaWidth() const
Return the width of the mantissa of this type.
bool isFunctionTy() const
True if this is an instance of FunctionType.
bool isScalableTargetExtTy() const
Return true if this is a target extension type with a scalable layout.
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.
static LLVM_ABI Type * getHalfTy(Context &Ctx)
static LLVM_ABI Type * getInt32Ty(Context &Ctx)
Context & getContext() const
static LLVM_ABI Type * getFloatTy(Context &Ctx)
LLVM_DUMP_METHOD void dump()
bool isLabelTy() const
Return true if this is 'label'.
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.
constexpr unsigned BitWidth