Go to the documentation of this file.
14 #ifndef LLVM_SUPPORT_MACHINEVALUETYPE_H
15 #define LLVM_SUPPORT_MACHINEVALUETYPE_H
331 constexpr
MVT() =
default;
474 "Simple vector VT not representable by simple integer vector VT!");
483 "Simple vector VT not representable by simple integer vector VT!");
501 assert(EltCnt.isKnownEven() &&
"Splitting vector, but not in half!");
502 return getVectorVT(EltVT, EltCnt.divideCoefficientBy(2));
508 return !(NElts & (NElts - 1));
796 case v7f32:
return 7;
798 case v6f32:
return 6;
800 case v5f32:
return 5;
825 case v3f64:
return 3;
872 "Possible incorrect use of MVT::getVectorNumElements() for "
873 "scalable vector. Scalable flag may be dropped, use "
874 "MVT::getVectorElementCount() instead");
899 "in codegen and has no size");
1151 "Comparison between scalable and fixed types");
1158 "Comparison between scalable and fixed types");
1165 "Comparison between scalable and fixed types");
1172 "Comparison between scalable and fixed types");
1443 if (EC.isScalable())
1451 static MVT getVT(
Type *Ty,
bool HandleUnknown =
false);
1518 #endif // LLVM_SUPPORT_MACHINEVALUETYPE_H
@ FIRST_FP_SCALABLE_VECTOR_VALUETYPE
@ FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE
auto enum_seq_inclusive(EnumT Begin, EnumT End)
Iterate over an enum type from Begin to End inclusive.
uint64_t getScalarStoreSize() const
@ FIRST_SCALABLE_VECTOR_VALUETYPE
MVT getVectorElementType() const
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
This is an optimization pass for GlobalISel generic memory operations.
uint64_t getFixedSizeInBits() const
Return the size of the specified fixed width value type in bits.
bool isByteSized() const
Returns true if the number of bits for the type is a multiple of an 8-bit byte.
bool operator>=(const MVT &S) const
bool isFixedLengthVector() const
@ LAST_FP_FIXEDLEN_VECTOR_VALUETYPE
bool isInteger() const
Return true if this is an integer or a vector integer type.
static bool isKnownGT(const LinearPolySize &LHS, const LinearPolySize &RHS)
ScalarTy getFixedSize() const
bool is256BitVector() const
Return true if this is a 256-bit vector type.
bool bitsLT(MVT VT) const
Return true if this has less bits than VT.
static bool isKnownLE(const LinearPolySize &LHS, const LinearPolySize &RHS)
bool isVector() const
Return true if this is a vector value type.
The instances of the Type class are immutable: once they are created, they are never changed.
@ LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE
bool knownBitsGT(MVT VT) const
Return true if we know at compile time this has more bits than VT.
static auto fp_fixedlen_vector_valuetypes()
static auto scalable_vector_valuetypes()
MVT getPow2VectorType() const
Widens the length of the given vector MVT up to the nearest power of 2 and returns that type.
@ LAST_FIXEDLEN_VECTOR_VALUETYPE
bool isScalable() const
Returns whether the size is scaled by a runtime quantity (vscale).
bool is32BitVector() const
Return true if this is a 32-bit vector 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 isValid() const
Return true if this is a valid simple valuetype.
static TypeSize Scalable(ScalarTy MinVal)
static auto integer_valuetypes()
bool operator<(const MVT &S) const
static ElementCount get(ScalarTy MinVal, bool Scalable)
MVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type.
bool knownBitsLE(MVT VT) const
Return true if we know at compile time this has fewer than or the same bits as VT.
bool operator<=(const MVT &S) const
@ LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE
static auto integer_scalable_vector_valuetypes()
uint64_t getScalarSizeInBits() const
static TypeSize Fixed(ScalarTy MinVal)
bool bitsLE(MVT VT) const
Return true if this has no more bits than VT.
@ LAST_SCALABLE_VECTOR_VALUETYPE
@ INVALID_SIMPLE_VALUE_TYPE
@ FIRST_INTEGER_VALUETYPE
static MVT getVectorVT(MVT VT, unsigned NumElements, bool IsScalable)
TypeSize getStoreSizeInBits() const
Return the number of bits overwritten by a store of the specified value type.
MVT getScalarType() const
If this is a vector, return the element type, otherwise return this.
unsigned Log2_32_Ceil(uint32_t Value)
Return the ceil log base 2 of the specified value, 32 if the value is zero.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
bool bitsGE(MVT VT) const
Return true if this has no less bits than VT.
bool is16BitVector() const
Return true if this is a 16-bit vector type.
static MVT getVectorVT(MVT VT, ElementCount EC)
unsigned getVectorNumElements() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
static auto all_valuetypes()
SimpleValueType Iteration.
static bool isKnownGE(const LinearPolySize &LHS, const LinearPolySize &RHS)
static MVT getFloatingPointVT(unsigned BitWidth)
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)
static auto fp_scalable_vector_valuetypes()
static auto fixedlen_vector_valuetypes()
MVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
bool is2048BitVector() const
Return true if this is a 2048-bit vector type.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool isPow2VectorType() const
Returns true if the given vector is a power of 2.
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
@ FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE
bool is64BitVector() const
Return true if this is a 64-bit vector type.
ElementCount getVectorElementCount() const
bool operator>(const MVT &S) const
bool operator!=(const MVT &S) const
bool isOverloaded() const
Return true if this is an overloaded type for TableGen.
bool operator==(const MVT &S) const
@ FIRST_FIXEDLEN_VECTOR_VALUETYPE
bool knownBitsGE(MVT VT) const
Return true if we know at compile time this has more than or the same bits as VT.
@ FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE
unsigned getVectorMinNumElements() const
Given a vector type, return the minimum number of elements it contains.
constexpr unsigned BitWidth
constexpr force_iteration_on_noniterable_enum_t force_iteration_on_noniterable_enum
MVT getHalfNumVectorElementsVT() const
Return a VT for a vector type with the same element type but half the number of elements.
static auto vector_valuetypes()
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
bool isScalarInteger() const
Return true if this is an integer, not including vectors.
static MVT getScalableVectorVT(MVT VT, unsigned NumElements)
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 knownBitsLT(MVT VT) const
Return true if we know at compile time this has fewer bits than VT.
static auto fp_valuetypes()
@ LAST_FP_SCALABLE_VECTOR_VALUETYPE
bool bitsGT(MVT VT) const
Return true if this has more bits than VT.
constexpr MVT(SimpleValueType SVT)
bool is512BitVector() const
Return true if this is a 512-bit vector type.
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)
static auto integer_fixedlen_vector_valuetypes()