LLVM 19.0.0git
MachineValueType.h
Go to the documentation of this file.
1//===- CodeGenTypes/MachineValueType.h - Machine-Level types ----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the set of machine-level target independent types which
10// legal values in the code generator use.
11//
12// Constants and properties are defined in ValueTypes.td.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_CODEGEN_MACHINEVALUETYPE_H
17#define LLVM_CODEGEN_MACHINEVALUETYPE_H
18
19#include "llvm/ADT/Sequence.h"
23#include <cassert>
24#include <cstdint>
25
26namespace llvm {
27
28 class Type;
29 class raw_ostream;
30
31 /// Machine Value Type. Every type that is supported natively by some
32 /// processor targeted by LLVM occurs here. This means that any legal value
33 /// type can be represented by an MVT.
34 class MVT {
35 public:
36 enum SimpleValueType : uint8_t {
37 // Simple value types that aren't explicitly part of this enumeration
38 // are considered extended value types.
40
41#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) Ty = n,
42#define GET_VT_RANGES
43#include "llvm/CodeGen/GenVT.inc"
44#undef GET_VT_ATTR
45#undef GET_VT_RANGES
46
47 VALUETYPE_SIZE = LAST_VALUETYPE + 1,
48 };
49
50 static_assert(FIRST_VALUETYPE > 0);
51 static_assert(LAST_VALUETYPE < token);
52
54
55 constexpr MVT() = default;
56 constexpr MVT(SimpleValueType SVT) : SimpleTy(SVT) {}
57
58 bool operator>(const MVT& S) const { return SimpleTy > S.SimpleTy; }
59 bool operator<(const MVT& S) const { return SimpleTy < S.SimpleTy; }
60 bool operator==(const MVT& S) const { return SimpleTy == S.SimpleTy; }
61 bool operator!=(const MVT& S) const { return SimpleTy != S.SimpleTy; }
62 bool operator>=(const MVT& S) const { return SimpleTy >= S.SimpleTy; }
63 bool operator<=(const MVT& S) const { return SimpleTy <= S.SimpleTy; }
64
65 /// Support for debugging, callable in GDB: VT.dump()
66 void dump() const;
67
68 /// Implement operator<<.
69 void print(raw_ostream &OS) const;
70
71 /// Return true if this is a valid simple valuetype.
72 bool isValid() const {
73 return (SimpleTy >= MVT::FIRST_VALUETYPE &&
74 SimpleTy <= MVT::LAST_VALUETYPE);
75 }
76
77 /// Return true if this is a FP or a vector FP type.
78 bool isFloatingPoint() const {
79 return ((SimpleTy >= MVT::FIRST_FP_VALUETYPE &&
80 SimpleTy <= MVT::LAST_FP_VALUETYPE) ||
81 (SimpleTy >= MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE &&
82 SimpleTy <= MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE) ||
83 (SimpleTy >= MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE &&
84 SimpleTy <= MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE));
85 }
86
87 /// Return true if this is an integer or a vector integer type.
88 bool isInteger() const {
89 return ((SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
90 SimpleTy <= MVT::LAST_INTEGER_VALUETYPE) ||
91 (SimpleTy >= MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE &&
92 SimpleTy <= MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE) ||
93 (SimpleTy >= MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE &&
94 SimpleTy <= MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE));
95 }
96
97 /// Return true if this is an integer, not including vectors.
98 bool isScalarInteger() const {
99 return (SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
100 SimpleTy <= MVT::LAST_INTEGER_VALUETYPE);
101 }
102
103 /// Return true if this is a vector value type.
104 bool isVector() const {
105 return (SimpleTy >= MVT::FIRST_VECTOR_VALUETYPE &&
106 SimpleTy <= MVT::LAST_VECTOR_VALUETYPE);
107 }
108
109 /// Return true if this is a vector value type where the
110 /// runtime length is machine dependent
111 bool isScalableVector() const {
112 return (SimpleTy >= MVT::FIRST_SCALABLE_VECTOR_VALUETYPE &&
113 SimpleTy <= MVT::LAST_SCALABLE_VECTOR_VALUETYPE);
114 }
115
116 /// Return true if this is a custom target type that has a scalable size.
118 return SimpleTy == MVT::aarch64svcount;
119 }
120
121 /// Return true if the type is a scalable type.
122 bool isScalableVT() const {
124 }
125
126 bool isFixedLengthVector() const {
127 return (SimpleTy >= MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE &&
128 SimpleTy <= MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE);
129 }
130
131 /// Return true if this is a 16-bit vector type.
132 bool is16BitVector() const {
133 return (isFixedLengthVector() && getFixedSizeInBits() == 16);
134 }
135
136 /// Return true if this is a 32-bit vector type.
137 bool is32BitVector() const {
138 return (isFixedLengthVector() && getFixedSizeInBits() == 32);
139 }
140
141 /// Return true if this is a 64-bit vector type.
142 bool is64BitVector() const {
143 return (isFixedLengthVector() && getFixedSizeInBits() == 64);
144 }
145
146 /// Return true if this is a 128-bit vector type.
147 bool is128BitVector() const {
148 return (isFixedLengthVector() && getFixedSizeInBits() == 128);
149 }
150
151 /// Return true if this is a 256-bit vector type.
152 bool is256BitVector() const {
153 return (isFixedLengthVector() && getFixedSizeInBits() == 256);
154 }
155
156 /// Return true if this is a 512-bit vector type.
157 bool is512BitVector() const {
158 return (isFixedLengthVector() && getFixedSizeInBits() == 512);
159 }
160
161 /// Return true if this is a 1024-bit vector type.
162 bool is1024BitVector() const {
163 return (isFixedLengthVector() && getFixedSizeInBits() == 1024);
164 }
165
166 /// Return true if this is a 2048-bit vector type.
167 bool is2048BitVector() const {
168 return (isFixedLengthVector() && getFixedSizeInBits() == 2048);
169 }
170
171 /// Return true if this is an overloaded type for TableGen.
172 bool isOverloaded() const {
173 switch (SimpleTy) {
174#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
175 case Ty: \
176 return Any;
177#include "llvm/CodeGen/GenVT.inc"
178#undef GET_VT_ATTR
179 default:
180 return false;
181 }
182 }
183
184 /// Return a vector with the same number of elements as this vector, but
185 /// with the element type converted to an integer type with the same
186 /// bitwidth.
188 MVT EltTy = getVectorElementType();
189 MVT IntTy = MVT::getIntegerVT(EltTy.getSizeInBits());
192 "Simple vector VT not representable by simple integer vector VT!");
193 return VecTy;
194 }
195
196 /// Return a VT for a vector type whose attributes match ourselves
197 /// with the exception of the element type that is chosen by the caller.
201 "Simple vector VT not representable by simple integer vector VT!");
202 return VecTy;
203 }
204
205 /// Return the type converted to an equivalently sized integer or vector
206 /// with integer element type. Similar to changeVectorElementTypeToInteger,
207 /// but also handles scalars.
209 if (isVector())
212 }
213
214 /// Return a VT for a vector type with the same element type but
215 /// half the number of elements.
217 MVT EltVT = getVectorElementType();
218 auto EltCnt = getVectorElementCount();
219 assert(EltCnt.isKnownEven() && "Splitting vector, but not in half!");
220 return getVectorVT(EltVT, EltCnt.divideCoefficientBy(2));
221 }
222
223 // Return a VT for a vector type with the same element type but
224 // double the number of elements.
226 MVT EltVT = getVectorElementType();
227 auto EltCnt = getVectorElementCount();
228 return MVT::getVectorVT(EltVT, EltCnt * 2);
229 }
230
231 /// Returns true if the given vector is a power of 2.
232 bool isPow2VectorType() const {
233 unsigned NElts = getVectorMinNumElements();
234 return !(NElts & (NElts - 1));
235 }
236
237 /// Widens the length of the given vector MVT up to the nearest power of 2
238 /// and returns that type.
240 if (isPow2VectorType())
241 return *this;
242
244 unsigned NewMinCount = 1 << Log2_32_Ceil(NElts.getKnownMinValue());
245 NElts = ElementCount::get(NewMinCount, NElts.isScalable());
246 return MVT::getVectorVT(getVectorElementType(), NElts);
247 }
248
249 /// If this is a vector, return the element type, otherwise return this.
251 return isVector() ? getVectorElementType() : *this;
252 }
253
255 assert(SimpleTy >= FIRST_VALUETYPE && SimpleTy <= LAST_VALUETYPE);
256 static constexpr SimpleValueType EltTyTable[] = {
257#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, NElem, EltTy) EltTy,
258#include "llvm/CodeGen/GenVT.inc"
259#undef GET_VT_ATTR
260 };
261 SimpleValueType VT = EltTyTable[SimpleTy - FIRST_VALUETYPE];
262 assert(VT != INVALID_SIMPLE_VALUE_TYPE && "Not a vector MVT!");
263 return VT;
264 }
265
266 /// Given a vector type, return the minimum number of elements it contains.
267 unsigned getVectorMinNumElements() const {
268 assert(SimpleTy >= FIRST_VALUETYPE && SimpleTy <= LAST_VALUETYPE);
269 static constexpr uint16_t NElemTable[] = {
270#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, NElem, EltTy) NElem,
271#include "llvm/CodeGen/GenVT.inc"
272#undef GET_VT_ATTR
273 };
274 unsigned NElem = NElemTable[SimpleTy - FIRST_VALUETYPE];
275 assert(NElem != 0 && "Not a vector MVT!");
276 return NElem;
277 }
278
281 }
282
283 unsigned getVectorNumElements() const {
284 if (isScalableVector())
286 "Possible incorrect use of MVT::getVectorNumElements() for "
287 "scalable vector. Scalable flag may be dropped, use "
288 "MVT::getVectorElementCount() instead");
290 }
291
292 /// Returns the size of the specified MVT in bits.
293 ///
294 /// If the value type is a scalable vector type, the scalable property will
295 /// be set and the runtime size will be a positive integer multiple of the
296 /// base size.
298 static constexpr TypeSize SizeTable[] = {
299#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
300 TypeSize(Sz, Sc || Ty == aarch64svcount /* FIXME: Not in the td. */),
301#include "llvm/CodeGen/GenVT.inc"
302#undef GET_VT_ATTR
303 };
304
305 switch (SimpleTy) {
307 llvm_unreachable("getSizeInBits called on extended MVT.");
308 case Other:
309 llvm_unreachable("Value type is non-standard value, Other.");
310 case iPTR:
311 llvm_unreachable("Value type size is target-dependent. Ask TLI.");
312 case iPTRAny:
313 case iAny:
314 case fAny:
315 case vAny:
316 case Any:
317 llvm_unreachable("Value type is overloaded.");
318 case token:
319 llvm_unreachable("Token type is a sentinel that cannot be used "
320 "in codegen and has no size");
321 case Metadata:
322 llvm_unreachable("Value type is metadata.");
323 default:
324 assert(SimpleTy < VALUETYPE_SIZE && "Unexpected value type!");
325 return SizeTable[SimpleTy - FIRST_VALUETYPE];
326 }
327 }
328
329 /// Return the size of the specified fixed width value type in bits. The
330 /// function will assert if the type is scalable.
332 return getSizeInBits().getFixedValue();
333 }
334
337 }
338
339 /// Return the number of bytes overwritten by a store of the specified value
340 /// type.
341 ///
342 /// If the value type is a scalable vector type, the scalable property will
343 /// be set and the runtime size will be a positive integer multiple of the
344 /// base size.
346 TypeSize BaseSize = getSizeInBits();
347 return {(BaseSize.getKnownMinValue() + 7) / 8, BaseSize.isScalable()};
348 }
349
350 // Return the number of bytes overwritten by a store of this value type or
351 // this value type's element type in the case of a vector.
354 }
355
356 /// Return the number of bits overwritten by a store of the specified value
357 /// type.
358 ///
359 /// If the value type is a scalable vector type, the scalable property will
360 /// be set and the runtime size will be a positive integer multiple of the
361 /// base size.
363 return getStoreSize() * 8;
364 }
365
366 /// Returns true if the number of bits for the type is a multiple of an
367 /// 8-bit byte.
368 bool isByteSized() const { return getSizeInBits().isKnownMultipleOf(8); }
369
370 /// Return true if we know at compile time this has more bits than VT.
371 bool knownBitsGT(MVT VT) const {
373 }
374
375 /// Return true if we know at compile time this has more than or the same
376 /// bits as VT.
377 bool knownBitsGE(MVT VT) const {
379 }
380
381 /// Return true if we know at compile time this has fewer bits than VT.
382 bool knownBitsLT(MVT VT) const {
384 }
385
386 /// Return true if we know at compile time this has fewer than or the same
387 /// bits as VT.
388 bool knownBitsLE(MVT VT) const {
390 }
391
392 /// Return true if this has more bits than VT.
393 bool bitsGT(MVT VT) const {
395 "Comparison between scalable and fixed types");
396 return knownBitsGT(VT);
397 }
398
399 /// Return true if this has no less bits than VT.
400 bool bitsGE(MVT VT) const {
402 "Comparison between scalable and fixed types");
403 return knownBitsGE(VT);
404 }
405
406 /// Return true if this has less bits than VT.
407 bool bitsLT(MVT VT) const {
409 "Comparison between scalable and fixed types");
410 return knownBitsLT(VT);
411 }
412
413 /// Return true if this has no more bits than VT.
414 bool bitsLE(MVT VT) const {
416 "Comparison between scalable and fixed types");
417 return knownBitsLE(VT);
418 }
419
420 static MVT getFloatingPointVT(unsigned BitWidth) {
421#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
422 if (FP == 3 && sz == BitWidth) \
423 return Ty;
424#include "llvm/CodeGen/GenVT.inc"
425#undef GET_VT_ATTR
426
427 llvm_unreachable("Bad bit width!");
428 }
429
430 static MVT getIntegerVT(unsigned BitWidth) {
431#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
432 if (Int == 3 && sz == BitWidth) \
433 return Ty;
434#include "llvm/CodeGen/GenVT.inc"
435#undef GET_VT_ATTR
436
438 }
439
440 static MVT getVectorVT(MVT VT, unsigned NumElements) {
441#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy) \
442 if (!Sc && VT.SimpleTy == ElTy && NumElements == nElem) \
443 return Ty;
444#include "llvm/CodeGen/GenVT.inc"
445#undef GET_VT_VECATTR
446
448 }
449
450 static MVT getScalableVectorVT(MVT VT, unsigned NumElements) {
451#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy) \
452 if (Sc && VT.SimpleTy == ElTy && NumElements == nElem) \
453 return Ty;
454#include "llvm/CodeGen/GenVT.inc"
455#undef GET_VT_VECATTR
456
458 }
459
460 static MVT getVectorVT(MVT VT, unsigned NumElements, bool IsScalable) {
461 if (IsScalable)
462 return getScalableVectorVT(VT, NumElements);
463 return getVectorVT(VT, NumElements);
464 }
465
467 if (EC.isScalable())
468 return getScalableVectorVT(VT, EC.getKnownMinValue());
469 return getVectorVT(VT, EC.getKnownMinValue());
470 }
471
472 /// Return the value type corresponding to the specified type.
473 /// If HandleUnknown is true, unknown types are returned as Other,
474 /// otherwise they are invalid.
475 /// NB: This includes pointer types, which require a DataLayout to convert
476 /// to a concrete value type.
477 static MVT getVT(Type *Ty, bool HandleUnknown = false);
478
479 public:
480 /// SimpleValueType Iteration
481 /// @{
482 static auto all_valuetypes() {
483 return enum_seq_inclusive(MVT::FIRST_VALUETYPE, MVT::LAST_VALUETYPE,
485 }
486
487 static auto integer_valuetypes() {
488 return enum_seq_inclusive(MVT::FIRST_INTEGER_VALUETYPE,
489 MVT::LAST_INTEGER_VALUETYPE,
491 }
492
493 static auto fp_valuetypes() {
494 return enum_seq_inclusive(MVT::FIRST_FP_VALUETYPE, MVT::LAST_FP_VALUETYPE,
496 }
497
498 static auto vector_valuetypes() {
499 return enum_seq_inclusive(MVT::FIRST_VECTOR_VALUETYPE,
500 MVT::LAST_VECTOR_VALUETYPE,
502 }
503
505 return enum_seq_inclusive(MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE,
506 MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE,
508 }
509
511 return enum_seq_inclusive(MVT::FIRST_SCALABLE_VECTOR_VALUETYPE,
512 MVT::LAST_SCALABLE_VECTOR_VALUETYPE,
514 }
515
517 return enum_seq_inclusive(MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE,
518 MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE,
520 }
521
523 return enum_seq_inclusive(MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE,
524 MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE,
526 }
527
529 return enum_seq_inclusive(MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE,
530 MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE,
532 }
533
535 return enum_seq_inclusive(MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE,
536 MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE,
538 }
539 /// @}
540 };
541
542 inline raw_ostream &operator<<(raw_ostream &OS, const MVT &VT) {
543 VT.print(OS);
544 return OS;
545 }
546
547} // end namespace llvm
548
549#endif // LLVM_CODEGEN_MACHINEVALUETYPE_H
RelocType Type
Definition: COFFYAML.cpp:391
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_pwrite_stream & OS
Provides some synthesis utilities to produce sequences of values.
Definition: Any.h:28
static constexpr ElementCount get(ScalarTy MinVal, bool Scalable)
Definition: TypeSize.h:317
Machine Value Type.
void dump() const
Support for debugging, callable in GDB: VT.dump()
Definition: ValueTypes.cpp:293
static MVT getFloatingPointVT(unsigned BitWidth)
bool isByteSized() const
Returns true if the number of bits for the type is a multiple of an 8-bit byte.
bool is128BitVector() const
Return true if this is a 128-bit vector type.
bool knownBitsGT(MVT VT) const
Return true if we know at compile time this has more bits than VT.
static auto integer_fixedlen_vector_valuetypes()
unsigned getVectorMinNumElements() const
Given a vector type, return the minimum number of elements it contains.
bool operator>(const MVT &S) const
SimpleValueType SimpleTy
bool isOverloaded() const
Return true if this is an overloaded type for TableGen.
bool isScalableTargetExtVT() const
Return true if this is a custom target type that has a scalable size.
uint64_t getScalarSizeInBits() const
MVT changeVectorElementType(MVT EltVT) const
Return a VT for a vector type whose attributes match ourselves with the exception of the element type...
bool operator<=(const MVT &S) const
@ INVALID_SIMPLE_VALUE_TYPE
constexpr MVT()=default
static MVT getVectorVT(MVT VT, ElementCount EC)
bool bitsLE(MVT VT) const
Return true if this has no more bits than VT.
unsigned getVectorNumElements() const
bool knownBitsLT(MVT VT) const
Return true if we know at compile time this has fewer bits than VT.
bool isVector() const
Return true if this is a vector value type.
bool isInteger() const
Return true if this is an integer or a vector integer type.
bool isScalableVector() const
Return true if this is a vector value type where the runtime length is machine dependent.
static MVT getScalableVectorVT(MVT VT, unsigned NumElements)
bool is16BitVector() const
Return true if this is a 16-bit vector type.
bool is32BitVector() const
Return true if this is a 32-bit vector type.
MVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type.
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition: ValueTypes.cpp:230
bool isScalableVT() const
Return true if the type is a scalable type.
bool bitsLT(MVT VT) const
Return true if this has less bits than VT.
static auto all_valuetypes()
SimpleValueType Iteration.
bool operator<(const MVT &S) const
static MVT getVectorVT(MVT VT, unsigned NumElements, bool IsScalable)
bool is512BitVector() const
Return true if this is a 512-bit vector type.
bool operator==(const MVT &S) const
static auto integer_valuetypes()
bool is1024BitVector() const
Return true if this is a 1024-bit vector type.
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
bool isPow2VectorType() const
Returns true if the given vector is a power of 2.
uint64_t getScalarStoreSize() const
static auto scalable_vector_valuetypes()
static auto fixedlen_vector_valuetypes()
uint64_t getFixedSizeInBits() const
Return the size of the specified fixed width value type in bits.
bool bitsGT(MVT VT) const
Return true if this has more bits than VT.
bool isFixedLengthVector() const
static auto vector_valuetypes()
bool is256BitVector() const
Return true if this is a 256-bit vector type.
ElementCount getVectorElementCount() const
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
bool bitsGE(MVT VT) const
Return true if this has no less bits than VT.
bool isScalarInteger() const
Return true if this is an integer, not including vectors.
TypeSize getStoreSizeInBits() const
Return the number of bits overwritten by a store of the specified value type.
static MVT getVectorVT(MVT VT, unsigned NumElements)
bool knownBitsGE(MVT VT) const
Return true if we know at compile time this has more than or the same bits as VT.
static auto fp_scalable_vector_valuetypes()
MVT getVectorElementType() const
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
bool operator>=(const MVT &S) const
bool isValid() const
Return true if this is a valid simple valuetype.
static MVT getIntegerVT(unsigned BitWidth)
MVT getDoubleNumVectorElementsVT() const
static auto fp_valuetypes()
MVT getHalfNumVectorElementsVT() const
Return a VT for a vector type with the same element type but half the number of elements.
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
MVT getScalarType() const
If this is a vector, return the element type, otherwise return this.
static auto integer_scalable_vector_valuetypes()
void print(raw_ostream &OS) const
Implement operator<<.
Definition: ValueTypes.cpp:299
bool is64BitVector() const
Return true if this is a 64-bit vector type.
MVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
MVT getPow2VectorType() const
Widens the length of the given vector MVT up to the nearest power of 2 and returns that type.
static auto fp_fixedlen_vector_valuetypes()
constexpr MVT(SimpleValueType SVT)
bool is2048BitVector() const
Return true if this is a 2048-bit vector type.
Root of the metadata hierarchy.
Definition: Metadata.h:62
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
constexpr bool isKnownMultipleOf(ScalarTy RHS) const
This function tells the caller whether the element count is known at compile time to be a multiple of...
Definition: TypeSize.h:183
constexpr ScalarTy getFixedValue() const
Definition: TypeSize.h:202
static constexpr bool isKnownLE(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition: TypeSize.h:232
static constexpr bool isKnownLT(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition: TypeSize.h:218
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
Definition: TypeSize.h:171
constexpr ScalarTy getKnownMinValue() const
Returns the minimum value this quantity can represent.
Definition: TypeSize.h:168
static constexpr bool isKnownGT(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition: TypeSize.h:225
static constexpr bool isKnownGE(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition: TypeSize.h:239
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
#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.
Definition: AddressRanges.h:18
unsigned Log2_32_Ceil(uint32_t Value)
Return the ceil log base 2 of the specified value, 32 if the value is zero.
Definition: MathExtras.h:353
auto enum_seq_inclusive(EnumT Begin, EnumT End)
Iterate over an enum type from Begin to End inclusive.
Definition: Sequence.h:364
constexpr force_iteration_on_noniterable_enum_t force_iteration_on_noniterable_enum
Definition: Sequence.h:108
void reportInvalidSizeRequest(const char *Msg)
Reports a diagnostic message to indicate an invalid size request has been done on a scalable vector.
Definition: TypeSize.cpp:39
@ Other
Any other memory.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:293
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:191