13#ifndef LLVM_SANDBOXIR_TYPE_H
14#define LLVM_SANDBOXIR_TYPE_H
29class ScalableVectorType;
37#define DEF_INSTR(ID, OPCODE, CLASS) class CLASS;
38#define DEF_CONST(ID, CLASS) class CLASS;
39#include "llvm/SandboxIR/Values.def"
68#define DEF_INSTR(ID, OPCODE, CLASS) friend class CLASS;
69#define DEF_CONST(ID, CLASS) friend class CLASS;
70#include "llvm/SandboxIR/Values.def"
85 bool NoDetails =
false)
const {
228 LLVMVisited.
reserve(Visited->size());
229 for (
Type *Ty : *Visited)
230 LLVMVisited.
insert(Ty->LLVMTy);
298 return isa<llvm::PointerType>(
From->LLVMTy);
307 return isa<llvm::ArrayType>(
From->LLVMTy);
315 bool IsPacked =
false);
321 return isa<llvm::StructType>(
From->LLVMTy);
340 return cast<llvm::VectorType>(
LLVMTy)->getElementCount();
351 return isa<llvm::VectorType>(
From->LLVMTy);
372 return cast<FixedVectorType>(
378 return cast<FixedVectorType>(
391 return isa<llvm::FixedVectorType>(
T->LLVMTy);
395 return cast<llvm::FixedVectorType>(
LLVMTy)->getNumElements();
414 return cast<ScalableVectorType>(
420 return cast<ScalableVectorType>(
426 return cast<ScalableVectorType>(
437 return cast<ScalableVectorType>(
442 return cast<llvm::ScalableVectorType>(
LLVMTy)->getMinNumElements();
446 return isa<llvm::ScalableVectorType>(
T->LLVMTy);
454 return isa<llvm::FunctionType>(
From->LLVMTy);
467 return isa<llvm::IntegerType>(
From->LLVMTy);
470 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 NumEntries)
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.
const fltSemantics & getFltSemantics() const
bool isVectorTy() const
True if this is an instance of VectorType.
bool isX86_FP80Ty() const
Return true if this is x86 long double.
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.
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 isEmptyTy() const
Return true if this type is empty, that is, it has no elements or all of its elements are empty.
bool isBFloatTy() const
Return true if this is 'bfloat', a 16-bit bfloat type.
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
bool isSingleValueType() const
Return true if the type is a valid type for a register in codegen.
void print(raw_ostream &O, bool IsForDebug=false, bool NoDetails=false) const
Print the current type.
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.
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
bool isScalableTargetExtTy() const
Return true if this is a target extension type with a scalable layout.
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 isFirstClassType() const
Return true if the type is "first class", meaning it is a valid type for a Value.
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 isScalableTy(SmallPtrSetImpl< const Type * > &Visited) const
Return true if this is a type whose size is a known multiple of vscale.
int getFPMantissaWidth() const
Return the width of the mantissa of this type.
bool isIEEE() const
Return whether the type is IEEE compatible, as defined by the eponymous method in APFloat.
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 canLosslesslyBitCastTo(Type *Ty) const
Return true if this type could be converted with a lossless BitCast to type 'Ty'.
bool isIntOrPtrTy() const
Return true if this is an integer type or a pointer type.
bool isIntegerTy() const
True if this is an instance of IntegerType.
bool isTokenTy() const
Return true if this is 'token'.
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
bool isIEEELikeFPTy() const
Return true if this is a well-behaved IEEE-like type, which has a IEEE compatible layout as defined b...
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 ArrayType * get(Type *ElementType, uint64_t NumElements)
static FixedVectorType * getExtendedElementVectorType(FixedVectorType *VTy)
unsigned getNumElements() const
static bool classof(const Type *T)
static FixedVectorType * getDoubleElementsVectorType(FixedVectorType *VTy)
static FixedVectorType * get(Type *ElementType, unsigned NumElts)
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 bool classof(const Type *From)
static IntegerType * get(Context &C, unsigned NumBits)
In SandboxIR the Module is mainly used to access the list of global objects.
static PointerType * get(Type *ElementType, unsigned AddressSpace)
static bool classof(const Type *From)
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 * get(Type *ElementType, unsigned MinNumElts)
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 bool classof(const Type *From)
static 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'.
bool isIEEE() const
Return whether the type is IEEE compatible, as defined by the eponymous method in APFloat.
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.
bool isIEEELikeFPTy() const
Return true if this is a well-behaved IEEE-like type, which has a IEEE compatible layout as defined b...
Type(llvm::Type *LLVMTy, Context &Ctx)
static Type * getFloatTy(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'.
static Type * getDoubleTy(Context &Ctx)
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.
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
static Type * getInt16Ty(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.
bool isSingleValueType() const
Return true if the type is a valid type for a register in codegen.
static Type * getInt1Ty(Context &Ctx)
static Type * getInt32Ty(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.
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.
static Type * getInt64Ty(Context &Ctx)
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.
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
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.
Context & getContext() const
LLVM_DUMP_METHOD void dump()
bool isLabelTy() const
Return true if this is 'label'.
static Type * getInt8Ty(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 bool isValidElementType(Type *ElemTy)
ElementCount getElementCount() const
static 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 VectorType * getInteger(VectorType *VTy)
static VectorType * get(Type *ElementType, ElementCount EC)
static VectorType * getTruncatedElementVectorType(VectorType *VTy)
static VectorType * getDoubleElementsVectorType(VectorType *VTy)
static VectorType * getHalfElementsVectorType(VectorType *VTy)
static VectorType * getExtendedElementVectorType(VectorType *VTy)
Type * getElementType() const
@ C
The default llvm calling convention, compatible with C.
constexpr unsigned BitWidth