20EVT EVT::changeExtendedTypeToInteger()
const {
22 LLVMContext &
Context = LLVMTy->getContext();
26EVT EVT::changeExtendedVectorElementTypeToInteger()
const {
28 LLVMContext &
Context = LLVMTy->getContext();
33EVT EVT::changeExtendedVectorElementType(
EVT EltVT)
const {
35 LLVMContext &
Context = LLVMTy->getContext();
62bool EVT::isExtendedFloatingPoint()
const {
64 return LLVMTy->isFPOrFPVectorTy();
67bool EVT::isExtendedInteger()
const {
69 return LLVMTy->isIntOrIntVectorTy();
72bool EVT::isExtendedScalarInteger()
const {
74 return LLVMTy->isIntegerTy();
77bool EVT::isExtendedVector()
const {
79 return LLVMTy->isVectorTy();
82bool EVT::isExtended16BitVector()
const {
83 return isExtendedVector() &&
87bool EVT::isExtended32BitVector()
const {
88 return isExtendedVector() &&
92bool EVT::isExtended64BitVector()
const {
93 return isExtendedVector() &&
97bool EVT::isExtended128BitVector()
const {
98 return isExtendedVector() &&
102bool EVT::isExtended256BitVector()
const {
103 return isExtendedVector() &&
107bool EVT::isExtended512BitVector()
const {
108 return isExtendedVector() &&
112bool EVT::isExtended1024BitVector()
const {
113 return isExtendedVector() &&
117bool EVT::isExtended2048BitVector()
const {
118 return isExtendedVector() &&
122bool EVT::isExtendedFixedLengthVector()
const {
126bool EVT::isExtendedScalableVector()
const {
130EVT EVT::getExtendedVectorElementType()
const {
135unsigned EVT::getExtendedVectorNumElements()
const {
138 if (
EC.isScalable()) {
140 <<
"The code that requested the fixed number of elements has made the "
141 "assumption that this vector is not scalable. This assumption was "
142 "not correct, and this may lead to broken code\n";
144 return EC.getKnownMinValue();
147ElementCount EVT::getExtendedVectorElementCount()
const {
152TypeSize EVT::getExtendedSizeInBits()
const {
157 return VTy->getPrimitiveSizeInBits();
163 switch (V.SimpleTy) {
168 unsigned MinNumElts = Sz / (NF * 8);
169 OS <<
"riscv_nxv" << MinNumElts <<
"i8x" << NF;
230 case MVT::aarch64svcount:
231 OS <<
"aarch64svcount";
233 case MVT::spirvbuiltin:
234 OS <<
"spirvbuiltin";
236 case MVT::amdgpuBufferFatPointer:
237 OS <<
"amdgpuBufferFatPointer";
239 case MVT::amdgpuBufferStridedPointer:
240 OS <<
"amdgpuBufferStridedPointer";
242 case MVT::aarch64mfp8:
248#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
260 switch (V.SimpleTy) {
266 case MVT::aarch64svcount:
268 case MVT::aarch64mfp8:
273 case MVT::amdgpuBufferStridedPointer:
return IntegerType::get(Context, 192);
277#define GET_VT_EVT(Ty, EVT) case MVT::Ty: return EVT;
278#include "llvm/CodeGen/GenVT.inc"
290 assert(Ty !=
nullptr &&
"Invalid type");
291 switch (Ty->getTypeID()) {
293 if (HandleUnknown)
return MVT(MVT::Other);
306 return MVT(MVT::f80);
309 if (TargetExtTy->
getName() ==
"aarch64.svcount")
310 return MVT(MVT::aarch64svcount);
311 else if (TargetExtTy->
getName() ==
"wasm.externref")
312 return MVT(MVT::externref);
313 else if (TargetExtTy->
getName() ==
"wasm.funcref")
314 return MVT(MVT::funcref);
316 return MVT(MVT::spirvbuiltin);
317 if (TargetExtTy->
getName() ==
"riscv.vector.tuple") {
319 ->getMinNumElements() *
326 return MVT(MVT::Other);
348 switch (Ty->getTypeID()) {
384#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares a class to represent arbitrary precision floating point values and provide a varie...
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
static const fltSemantics & IEEEsingle()
static const fltSemantics & BFloat()
static const fltSemantics & IEEEquad()
static const fltSemantics & IEEEdouble()
static const fltSemantics & x87DoubleExtended()
static const fltSemantics & IEEEhalf()
static const fltSemantics & PPCDoubleDouble()
static LLVM_ABI FixedVectorType * get(Type *ElementType, unsigned NumElts)
static LLVM_ABI 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.
LLVM_ABI void dump() const
Support for debugging, callable in GDB: VT.dump()
@ INVALID_SIMPLE_VALUE_TYPE
static MVT getRISCVVectorTupleVT(unsigned Sz, unsigned NFields)
static LLVM_ABI MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
LLVM_ABI const fltSemantics & getFltSemantics() const
Returns an APFloat semantics tag appropriate for the value type.
static MVT getVectorVT(MVT VT, unsigned NumElements)
static MVT getIntegerVT(unsigned BitWidth)
MVT getScalarType() const
If this is a vector, return the element type, otherwise return this.
LLVM_ABI void print(raw_ostream &OS) const
Implement operator<<.
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 LLVM_ABI TargetExtType * get(LLVMContext &Context, StringRef Name, ArrayRef< Type * > Types={}, ArrayRef< unsigned > Ints={})
Return a target extension type having the specified name and optional type and integer parameters.
Type * getTypeParameter(unsigned i) const
unsigned getIntParameter(unsigned i) const
StringRef getName() const
Return the name for this target extension type.
static constexpr TypeSize getFixed(ScalarTy ExactSize)
The instances of the Type class are immutable: once they are created, they are never changed.
static LLVM_ABI Type * getX86_AMXTy(LLVMContext &C)
static LLVM_ABI Type * getWasm_ExternrefTy(LLVMContext &C)
static LLVM_ABI Type * getMetadataTy(LLVMContext &C)
@ 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)
@ ByteTyID
Arbitrary bit width bytes.
@ FP128TyID
128-bit floating point type (112-bit significand)
static LLVM_ABI Type * getVoidTy(LLVMContext &C)
static LLVM_ABI Type * getWasm_FuncrefTy(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 LLVM_ABI VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
Type * getElementType() const
static LLVM_ABI raw_ostream & warning()
Convenience method for printing "warning: " to stderr.
constexpr ScalarTy getKnownMinValue() const
Returns the minimum value this quantity can represent.
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.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
constexpr unsigned BitWidth
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
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.
bool isCheriCapability() const
Return true if this is a capability type.
unsigned getRISCVVectorTupleNumFields() const
Given a RISCV vector tuple type, return the num_fields.
uint64_t getScalarSizeInBits() const
static LLVM_ABI EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
LLVM_ABI 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.
bool isRISCVVectorTuple() const
Return true if this is a vector value type.
bool isVector() const
Return true if this is a vector value type.
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
LLVM_ABI 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).
LLVM_ABI const fltSemantics & getFltSemantics() const
Returns an APFloat semantics tag appropriate for the value type.
LLVM_ABI void print(raw_ostream &OS) const
Implement operator<<.
bool isInteger() const
Return true if this is an integer or a vector integer type.