Go to the documentation of this file.
15 #ifndef LLVM_CODEGEN_VALUETYPES_H
16 #define LLVM_CODEGEN_VALUETYPES_H
37 Type *LLVMTy =
nullptr;
40 constexpr
EVT() =
default;
45 return !(*
this != VT);
51 return LLVMTy != VT.LLVMTy;
74 bool IsScalable =
false) {
78 return getExtendedVectorVT(
Context, VT, NumElements, IsScalable);
87 return getExtendedVectorVT(
Context, VT, EC);
96 return changeExtendedVectorElementTypeToInteger();
104 "Can't change simple vector VT to have extended element VT");
107 return changeExtendedVectorElementType(EltVT);
119 return changeExtendedTypeToInteger();
166 : isExtendedFixedLengthVector();
224 return BitSize >= 8 && !(BitSize & (BitSize - 1));
229 if (EVT::operator==(VT))
return true;
257 if (EVT::operator==(VT))
return false;
259 "Comparison between scalable and fixed types");
265 if (EVT::operator==(VT))
return true;
267 "Comparison between scalable and fixed types");
273 if (EVT::operator==(VT))
return false;
275 "Comparison between scalable and fixed types");
281 if (EVT::operator==(VT))
return true;
283 "Comparison between scalable and fixed types");
304 return getExtendedVectorElementType();
313 "Possible incorrect use of EVT::getVectorNumElements() for "
314 "scalable vector. Scalable flag may be dropped, use "
315 "EVT::getVectorElementCount() instead");
318 : getExtendedVectorNumElements();
327 return getExtendedVectorElementCount();
343 return getExtendedSizeInBits();
423 assert(EltCnt.isKnownEven() &&
"Splitting vector, but not in half!");
439 return !(NElts & (NElts - 1));
481 return L.LLVMTy < R.LLVMTy;
491 EVT changeExtendedTypeToInteger()
const;
492 EVT changeExtendedVectorElementType(
EVT EltVT)
const;
493 EVT changeExtendedVectorElementTypeToInteger()
const;
513 EVT getExtendedVectorElementType()
const;
521 #endif // LLVM_CODEGEN_VALUETYPES_H
MVT getVectorElementType() const
bool knownBitsGT(EVT VT) const
Return true if we know at compile time this has more bits than VT.
bool is32BitVector() const
Return true if this is a 32-bit vector type.
bool operator!=(EVT VT) const
uint64_t getScalarStoreSize() const
bool is16BitVector() const
Return true if this is a 16-bit vector type.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
bool isScalarInteger() const
Return true if this is an integer, but not a vector.
bool isFixedLengthVector() const
bool isInteger() const
Return true if this is an integer or a vector integer type.
static bool isKnownGT(const LinearPolySize &LHS, const LinearPolySize &RHS)
A meaningless but well-behaved order, useful for constructing containers.
ElementCount getVectorElementCount() const
uint64_t getFixedSizeInBits() const
Return the size of the specified fixed width value type in bits.
ScalarTy getFixedSize() const
bool is256BitVector() const
Return true if this is a 256-bit vector type.
static bool isKnownLE(const LinearPolySize &LHS, const LinearPolySize &RHS)
bool isVector() const
Return true if this is a vector value type.
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
The instances of the Type class are immutable: once they are created, they are never changed.
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 isOverloaded() const
Return true if this is an overloaded type for TableGen.
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
bool isZeroSized() const
Test if the given EVT has zero size, this will fail if called on a scalable type.
EVT getRoundIntegerType(LLVMContext &Context) const
Rounds the bit-width of the given integer EVT up to the nearest power of two (and at least to eight),...
bool isScalable() const
Returns whether the size is scaled by a runtime quantity (vscale).
constexpr EVT(MVT::SimpleValueType SVT)
bool is32BitVector() const
Return true if this is a 32-bit vector type.
EVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type.
static bool isKnownLT(const LinearPolySize &LHS, const LinearPolySize &RHS)
bool isScalableVector() const
Return true if this is a vector value type where the runtime length is machine dependent.
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
bool is256BitVector() const
Return true if this is a 256-bit vector type.
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
static ElementCount get(ScalarTy MinVal, bool Scalable)
MVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type.
EVT getPow2VectorType(LLVMContext &Context) const
Widens the length of the given vector EVT up to the nearest power of 2 and returns that type.
(vector float) vec_cmpeq(*A, *B) C
bool is64BitVector() const
Return true if this is a 64-bit vector type.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
bool isInteger() const
Return true if this is an integer or a vector integer type.
static EVT getVectorVT(LLVMContext &Context, EVT VT, ElementCount EC)
Returns the EVT that represents a vector EC.Min elements in length, where each element is of type VT.
@ INVALID_SIMPLE_VALUE_TYPE
EVT changeVectorElementType(EVT EltVT) const
Return a VT for a vector type whose attributes match ourselves with the exception of the element type...
@ FIRST_INTEGER_VALUETYPE
bool is1024BitVector() const
Return true if this is a 1024-bit vector type.
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
unsigned Log2_32_Ceil(uint32_t Value)
Return the ceil log base 2 of the specified value, 32 if the value is zero.
bool isExtended() const
Test if the given EVT is extended (as opposed to being simple).
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
TypeSize getStoreSizeInBits() const
Return the number of bits overwritten by a store of the specified value type.
bool knownBitsLE(EVT VT) const
Return true if we know at compile time this has fewer than or the same bits as VT.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
bool is16BitVector() const
Return true if this is a 16-bit vector type.
This is an important class for using LLVM in a threaded context.
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
EVT getHalfSizedIntegerVT(LLVMContext &Context) const
Finds the smallest simple value type that is greater than or equal to half the width of this EVT.
unsigned getVectorMinNumElements() const
Given a vector type, return the minimum number of elements it contains.
intptr_t getRawBits() const
unsigned getVectorNumElements() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
Returns the EVT that represents an integer with the given number of bits.
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
static bool isKnownGE(const LinearPolySize &LHS, const LinearPolySize &RHS)
bool isByteSized() const
Return true if the bit size is a multiple of 8.
static MVT getFloatingPointVT(unsigned BitWidth)
EVT widenIntegerVectorElementType(LLVMContext &Context) const
Return a VT for an integer vector type with the size of the elements doubled.
ScalarTy getKnownMinValue() const
Returns the minimum value this size can represent.
bool isKnownMultipleOf(ScalarTy RHS) const
This function tells the caller whether the element count is known at compile time to be a multiple of...
static MVT getVectorVT(MVT VT, unsigned NumElements)
bool isVector() const
Return true if this is a vector value type.
MVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
uint64_t getScalarSizeInBits() const
bool is2048BitVector() const
Return true if this is a 2048-bit vector type.
bool is128BitVector() const
Return true if this is a 128-bit vector 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 is64BitVector() const
Return true if this is a 64-bit vector type.
bool operator==(EVT VT) const
ElementCount getVectorElementCount() const
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
bool is2048BitVector() const
Return true if this is a 2048-bit vector type.
EVT getHalfNumVectorElementsVT(LLVMContext &Context) const
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
bool operator()(EVT L, EVT R) const
constexpr unsigned BitWidth
bool is512BitVector() const
Return true if this is a 512-bit vector type.
static EVT getFloatingPointVT(unsigned BitWidth)
Returns the EVT that represents a floating-point type with the given number of bits.
EVT getVectorElementType() const
Given a vector type, return the type of each element.
bool isScalarInteger() const
Return true if this is an integer, not including vectors.
bool isPow2VectorType() const
Returns true if the given vector is a power of 2.
MVT changeVectorElementType(MVT EltVT) const
Return a VT for a vector type whose attributes match ourselves with the exception of the element type...
ScalarTy getKnownMinSize() const
bool is1024BitVector() const
Return true if this is a 1024-bit vector type.
bool knownBitsGE(EVT VT) const
Return true if we know at compile time this has more than or the same bits as VT.
bool bitsGT(EVT VT) const
Return true if this has more bits than VT.
bool isRound() const
Return true if the size is a power-of-two number of bytes.
bool bitsGE(EVT VT) const
Return true if this has no less bits than VT.
bool is128BitVector() const
Return true if this is a 128-bit vector type.
EVT getDoubleNumVectorElementsVT(LLVMContext &Context) const
bool isFixedLengthVector() const
bool bitsEq(EVT VT) const
Return true if this has the same number of bits as VT.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
bool knownBitsLT(EVT VT) const
Return true if we know at compile time this has fewer bits than VT.
bool is512BitVector() const
Return true if this is a 512-bit vector type.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
void reportInvalidSizeRequest(const char *Msg)
Reports a diagnostic message to indicate an invalid size request has been done on a scalable vector.
static MVT getIntegerVT(unsigned BitWidth)