19EVT EVT::changeExtendedTypeToInteger()
const {
25EVT EVT::changeExtendedVectorElementTypeToInteger()
const {
32EVT EVT::changeExtendedVectorElementType(
EVT EltVT)
const {
61bool EVT::isExtendedFloatingPoint()
const {
66bool EVT::isExtendedInteger()
const {
71bool EVT::isExtendedScalarInteger()
const {
76bool EVT::isExtendedVector()
const {
81bool EVT::isExtended16BitVector()
const {
82 return isExtendedVector() && getExtendedSizeInBits() == 16;
85bool EVT::isExtended32BitVector()
const {
86 return isExtendedVector() && getExtendedSizeInBits() == 32;
89bool EVT::isExtended64BitVector()
const {
90 return isExtendedVector() && getExtendedSizeInBits() == 64;
93bool EVT::isExtended128BitVector()
const {
94 return isExtendedVector() && getExtendedSizeInBits() == 128;
97bool EVT::isExtended256BitVector()
const {
98 return isExtendedVector() && getExtendedSizeInBits() == 256;
101bool EVT::isExtended512BitVector()
const {
102 return isExtendedVector() && getExtendedSizeInBits() == 512;
105bool EVT::isExtended1024BitVector()
const {
106 return isExtendedVector() && getExtendedSizeInBits() == 1024;
109bool EVT::isExtended2048BitVector()
const {
110 return isExtendedVector() && getExtendedSizeInBits() == 2048;
113bool EVT::isExtendedFixedLengthVector()
const {
114 return isExtendedVector() && isa<FixedVectorType>(LLVMTy);
117bool EVT::isExtendedScalableVector()
const {
118 return isExtendedVector() && isa<ScalableVectorType>(LLVMTy);
121EVT EVT::getExtendedVectorElementType()
const {
123 return EVT::getEVT(cast<VectorType>(LLVMTy)->getElementType());
126unsigned EVT::getExtendedVectorNumElements()
const {
129 if (
EC.isScalable()) {
131 <<
"The code that requested the fixed number of elements has made the "
132 "assumption that this vector is not scalable. This assumption was "
133 "not correct, and this may lead to broken code\n";
135 return EC.getKnownMinValue();
138ElementCount EVT::getExtendedVectorElementCount()
const {
140 return cast<VectorType>(LLVMTy)->getElementCount();
143TypeSize EVT::getExtendedSizeInBits()
const {
145 if (
IntegerType *ITy = dyn_cast<IntegerType>(LLVMTy))
147 if (
VectorType *VTy = dyn_cast<VectorType>(LLVMTy))
148 return VTy->getPrimitiveSizeInBits();
165 case MVT::bf16:
return "bf16";
166 case MVT::ppcf128:
return "ppcf128";
167 case MVT::isVoid:
return "isVoid";
168 case MVT::Other:
return "ch";
169 case MVT::Glue:
return "glue";
170 case MVT::x86mmx:
return "x86mmx";
171 case MVT::x86amx:
return "x86amx";
172 case MVT::i64x8:
return "i64x8";
173 case MVT::Metadata:
return "Metadata";
174 case MVT::Untyped:
return "Untyped";
175 case MVT::funcref:
return "funcref";
176 case MVT::externref:
return "externref";
177 case MVT::aarch64svcount:
178 return "aarch64svcount";
179 case MVT::spirvbuiltin:
180 return "spirvbuiltin";
184#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
217 case MVT::aarch64svcount:
574 assert(Ty !=
nullptr &&
"Invalid type");
577 if (HandleUnknown)
return MVT(MVT::Other);
591 if (TargetExtTy->
getName() ==
"aarch64.svcount")
592 return MVT(MVT::aarch64svcount);
594 return MVT(MVT::spirvbuiltin);
596 return MVT(MVT::Other);
632#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
static FixedVectorType * get(Type *ElementType, unsigned NumElts)
Class to represent integer types.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
This is an important class for using LLVM in a threaded context.
void dump() const
Support for debugging, callable in GDB: VT.dump()
@ INVALID_SIMPLE_VALUE_TYPE
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
static MVT getVectorVT(MVT VT, unsigned NumElements)
static MVT getIntegerVT(unsigned BitWidth)
void print(raw_ostream &OS) const
Implement operator<<.
static ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
Class to represent target extensions types, which are generally unintrospectable from target-independ...
static TargetExtType * get(LLVMContext &Context, StringRef Name, ArrayRef< Type * > Types=std::nullopt, ArrayRef< unsigned > Ints=std::nullopt)
Return a target extension type having the specified name and optional type and integer parameters.
StringRef getName() const
Return the name for this target extension type.
static constexpr TypeSize Fixed(ScalarTy ExactSize)
The instances of the Type class are immutable: once they are created, they are never changed.
static Type * getHalfTy(LLVMContext &C)
static Type * getDoubleTy(LLVMContext &C)
bool isVectorTy() const
True if this is an instance of VectorType.
static Type * getX86_FP80Ty(LLVMContext &C)
static Type * getBFloatTy(LLVMContext &C)
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
static IntegerType * getInt1Ty(LLVMContext &C)
static Type * getX86_AMXTy(LLVMContext &C)
static Type * getMetadataTy(LLVMContext &C)
@ X86_MMXTyID
MMX vectors (64 bits, X86 specific)
@ X86_AMXTyID
AMX vectors (8192 bits, X86 specific)
@ 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
@ IntegerTyID
Arbitrary bit width integers.
@ FixedVectorTyID
Fixed width SIMD vector 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 Type * getX86_MMXTy(LLVMContext &C)
static IntegerType * getIntNTy(LLVMContext &C, unsigned N)
static Type * getVoidTy(LLVMContext &C)
static Type * getFP128Ty(LLVMContext &C)
static IntegerType * getInt16Ty(LLVMContext &C)
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
static IntegerType * getInt8Ty(LLVMContext &C)
static IntegerType * getInt128Ty(LLVMContext &C)
static IntegerType * getInt32Ty(LLVMContext &C)
static IntegerType * getInt64Ty(LLVMContext &C)
static Type * getFloatTy(LLVMContext &C)
bool isIntegerTy() const
True if this is an instance of IntegerType.
TypeID getTypeID() const
Return the type id for the type.
static Type * getWasm_FuncrefTy(LLVMContext &C)
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
static Type * getPPC_FP128Ty(LLVMContext &C)
static Type * getWasm_ExternrefTy(LLVMContext &C)
Base class of all SIMD vector types.
ElementCount getElementCount() const
Return an ElementCount instance to represent the (possibly scalable) number of elements in the vector...
static VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
Type * getElementType() const
static raw_ostream & warning()
Convenience method for printing "warning: " to stderr.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
constexpr unsigned BitWidth
static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements, bool IsScalable=false)
Returns the EVT that represents a vector NumElements in length, where each element is of type VT.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
ElementCount getVectorElementCount() const
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
uint64_t getScalarSizeInBits() const
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
void dump() const
Support for debugging, callable in GDB: VT.dump()
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
Returns the EVT that represents an integer with the given number of bits.
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
bool isVector() const
Return true if this is a vector value type.
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
EVT getVectorElementType() const
Given a vector type, return the type of each element.
bool isExtended() const
Test if the given EVT is extended (as opposed to being simple).
void print(raw_ostream &OS) const
Implement operator<<.
bool isInteger() const
Return true if this is an integer or a vector integer type.