LLVM 20.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 struct fltSemantics;
30 class raw_ostream;
31
32 /// Machine Value Type. Every type that is supported natively by some
33 /// processor targeted by LLVM occurs here. This means that any legal value
34 /// type can be represented by an MVT.
35 class MVT {
36 public:
38 // Simple value types that aren't explicitly part of this enumeration
39 // are considered extended value types.
41
42#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) Ty = n,
43#define GET_VT_RANGES
44#include "llvm/CodeGen/GenVT.inc"
45#undef GET_VT_ATTR
46#undef GET_VT_RANGES
47
48 VALUETYPE_SIZE = LAST_VALUETYPE + 1,
49 };
50
51 static_assert(FIRST_VALUETYPE > 0);
52 static_assert(LAST_VALUETYPE < token);
53
55
56 constexpr MVT() = default;
57 constexpr MVT(SimpleValueType SVT) : SimpleTy(SVT) {}
58
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 bool operator<=(const MVT& S) const { return SimpleTy <= S.SimpleTy; }
65
66 /// Support for debugging, callable in GDB: VT.dump()
67 void dump() const;
68
69 /// Implement operator<<.
70 void print(raw_ostream &OS) const;
71
72 /// Return true if this is a valid simple valuetype.
73 bool isValid() const {
74 return (SimpleTy >= MVT::FIRST_VALUETYPE &&
75 SimpleTy <= MVT::LAST_VALUETYPE);
76 }
77
78 /// Return true if this is a FP or a vector FP type.
79 bool isFloatingPoint() const {
80 return ((SimpleTy >= MVT::FIRST_FP_VALUETYPE &&
81 SimpleTy <= MVT::LAST_FP_VALUETYPE) ||
82 (SimpleTy >= MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE &&
83 SimpleTy <= MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE) ||
84 (SimpleTy >= MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE &&
85 SimpleTy <= MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE));
86 }
87
88 /// Return true if this is an integer or a vector integer type.
89 bool isInteger() const {
90 return ((SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
91 SimpleTy <= MVT::LAST_INTEGER_VALUETYPE) ||
92 (SimpleTy >= MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE &&
93 SimpleTy <= MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE) ||
94 (SimpleTy >= MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE &&
95 SimpleTy <= MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE));
96 }
97
98 /// Return true if this is an integer, not including vectors.
99 bool isScalarInteger() const {
100 return (SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
101 SimpleTy <= MVT::LAST_INTEGER_VALUETYPE);
102 }
103
104 /// Return true if this is a vector value type.
105 bool isVector() const {
106 return (SimpleTy >= MVT::FIRST_VECTOR_VALUETYPE &&
107 SimpleTy <= MVT::LAST_VECTOR_VALUETYPE);
108 }
109
110 /// Return true if this is a vector value type where the
111 /// runtime length is machine dependent
112 bool isScalableVector() const {
113 return (SimpleTy >= MVT::FIRST_SCALABLE_VECTOR_VALUETYPE &&
114 SimpleTy <= MVT::LAST_SCALABLE_VECTOR_VALUETYPE);
115 }
116
117 /// Return true if this is a custom target type that has a scalable size.
119 return SimpleTy == MVT::aarch64svcount;
120 }
121
122 /// Return true if the type is a scalable type.
123 bool isScalableVT() const {
125 }
126
127 bool isFixedLengthVector() const {
128 return (SimpleTy >= MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE &&
129 SimpleTy <= MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE);
130 }
131
132 /// Return true if this is a 16-bit vector type.
133 bool is16BitVector() const {
134 return (isFixedLengthVector() && getFixedSizeInBits() == 16);
135 }
136
137 /// Return true if this is a 32-bit vector type.
138 bool is32BitVector() const {
139 return (isFixedLengthVector() && getFixedSizeInBits() == 32);
140 }
141
142 /// Return true if this is a 64-bit vector type.
143 bool is64BitVector() const {
144 return (isFixedLengthVector() && getFixedSizeInBits() == 64);
145 }
146
147 /// Return true if this is a 128-bit vector type.
148 bool is128BitVector() const {
149 return (isFixedLengthVector() && getFixedSizeInBits() == 128);
150 }
151
152 /// Return true if this is a 256-bit vector type.
153 bool is256BitVector() const {
154 return (isFixedLengthVector() && getFixedSizeInBits() == 256);
155 }
156
157 /// Return true if this is a 512-bit vector type.
158 bool is512BitVector() const {
159 return (isFixedLengthVector() && getFixedSizeInBits() == 512);
160 }
161
162 /// Return true if this is a 1024-bit vector type.
163 bool is1024BitVector() const {
164 return (isFixedLengthVector() && getFixedSizeInBits() == 1024);
165 }
166
167 /// Return true if this is a 2048-bit vector type.
168 bool is2048BitVector() const {
169 return (isFixedLengthVector() && getFixedSizeInBits() == 2048);
170 }
171
172 /// Return true if this is an overloaded type for TableGen.
173 bool isOverloaded() const {
174 switch (SimpleTy) {
175#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
176 case Ty: \
177 return Any;
178#include "llvm/CodeGen/GenVT.inc"
179#undef GET_VT_ATTR
180 default:
181 return false;
182 }
183 }
184
185 /// Return a vector with the same number of elements as this vector, but
186 /// with the element type converted to an integer type with the same
187 /// bitwidth.
189 MVT EltTy = getVectorElementType();
190 MVT IntTy = MVT::getIntegerVT(EltTy.getSizeInBits());
193 "Simple vector VT not representable by simple integer vector VT!");
194 return VecTy;
195 }
196
197 /// Return a VT for a vector type whose attributes match ourselves
198 /// with the exception of the element type that is chosen by the caller.
202 "Simple vector VT not representable by simple integer vector VT!");
203 return VecTy;
204 }
205
206 /// Return the type converted to an equivalently sized integer or vector
207 /// with integer element type. Similar to changeVectorElementTypeToInteger,
208 /// but also handles scalars.
210 if (isVector())
213 }
214
215 /// Return a VT for a vector type with the same element type but
216 /// half the number of elements.
218 MVT EltVT = getVectorElementType();
219 auto EltCnt = getVectorElementCount();
220 assert(EltCnt.isKnownEven() && "Splitting vector, but not in half!");
221 return getVectorVT(EltVT, EltCnt.divideCoefficientBy(2));
222 }
223
224 // Return a VT for a vector type with the same element type but
225 // double the number of elements.
227 MVT EltVT = getVectorElementType();
228 auto EltCnt = getVectorElementCount();
229 return MVT::getVectorVT(EltVT, EltCnt * 2);
230 }
231
232 /// Returns true if the given vector is a power of 2.
233 bool isPow2VectorType() const {
234 unsigned NElts = getVectorMinNumElements();
235 return !(NElts & (NElts - 1));
236 }
237
238 /// Widens the length of the given vector MVT up to the nearest power of 2
239 /// and returns that type.
241 if (isPow2VectorType())
242 return *this;
243
245 unsigned NewMinCount = 1 << Log2_32_Ceil(NElts.getKnownMinValue());
246 NElts = ElementCount::get(NewMinCount, NElts.isScalable());
247 return MVT::getVectorVT(getVectorElementType(), NElts);
248 }
249
250 /// If this is a vector, return the element type, otherwise return this.
252 return isVector() ? getVectorElementType() : *this;
253 }
254
256 assert(SimpleTy >= FIRST_VALUETYPE && SimpleTy <= LAST_VALUETYPE);
257 static constexpr SimpleValueType EltTyTable[] = {
258#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, NElem, EltTy) EltTy,
259#include "llvm/CodeGen/GenVT.inc"
260#undef GET_VT_ATTR
261 };
262 SimpleValueType VT = EltTyTable[SimpleTy - FIRST_VALUETYPE];
263 assert(VT != INVALID_SIMPLE_VALUE_TYPE && "Not a vector MVT!");
264 return VT;
265 }
266
267 /// Given a vector type, return the minimum number of elements it contains.
268 unsigned getVectorMinNumElements() const {
269 assert(SimpleTy >= FIRST_VALUETYPE && SimpleTy <= LAST_VALUETYPE);
270 static constexpr uint16_t NElemTable[] = {
271#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, NElem, EltTy) NElem,
272#include "llvm/CodeGen/GenVT.inc"
273#undef GET_VT_ATTR
274 };
275 unsigned NElem = NElemTable[SimpleTy - FIRST_VALUETYPE];
276 assert(NElem != 0 && "Not a vector MVT!");
277 return NElem;
278 }
279
282 }
283
284 unsigned getVectorNumElements() const {
285 if (isScalableVector())
287 "Possible incorrect use of MVT::getVectorNumElements() for "
288 "scalable vector. Scalable flag may be dropped, use "
289 "MVT::getVectorElementCount() instead");
291 }
292
293 /// Returns the size of the specified MVT in bits.
294 ///
295 /// If the value type is a scalable vector type, the scalable property will
296 /// be set and the runtime size will be a positive integer multiple of the
297 /// base size.
299 static constexpr TypeSize SizeTable[] = {
300#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
301 TypeSize(Sz, Sc || Ty == aarch64svcount /* FIXME: Not in the td. */),
302#include "llvm/CodeGen/GenVT.inc"
303#undef GET_VT_ATTR
304 };
305
306 switch (SimpleTy) {
308 llvm_unreachable("getSizeInBits called on extended MVT.");
309 case Other:
310 llvm_unreachable("Value type is non-standard value, Other.");
311 case iPTR:
312 llvm_unreachable("Value type size is target-dependent. Ask TLI.");
313 case iPTRAny:
314 case iAny:
315 case fAny:
316 case vAny:
317 case Any:
318 llvm_unreachable("Value type is overloaded.");
319 case token:
320 llvm_unreachable("Token type is a sentinel that cannot be used "
321 "in codegen and has no size");
322 case Metadata:
323 llvm_unreachable("Value type is metadata.");
324 default:
325 assert(SimpleTy < VALUETYPE_SIZE && "Unexpected value type!");
326 return SizeTable[SimpleTy - FIRST_VALUETYPE];
327 }
328 }
329
330 /// Return the size of the specified fixed width value type in bits. The
331 /// function will assert if the type is scalable.
333 return getSizeInBits().getFixedValue();
334 }
335
338 }
339
340 /// Return the number of bytes overwritten by a store of the specified value
341 /// type.
342 ///
343 /// If the value type is a scalable vector type, the scalable property will
344 /// be set and the runtime size will be a positive integer multiple of the
345 /// base size.
347 TypeSize BaseSize = getSizeInBits();
348 return {(BaseSize.getKnownMinValue() + 7) / 8, BaseSize.isScalable()};
349 }
350
351 // Return the number of bytes overwritten by a store of this value type or
352 // this value type's element type in the case of a vector.
355 }
356
357 /// Return the number of bits overwritten by a store of the specified value
358 /// type.
359 ///
360 /// If the value type is a scalable vector type, the scalable property will
361 /// be set and the runtime size will be a positive integer multiple of the
362 /// base size.
364 return getStoreSize() * 8;
365 }
366
367 /// Returns true if the number of bits for the type is a multiple of an
368 /// 8-bit byte.
369 bool isByteSized() const { return getSizeInBits().isKnownMultipleOf(8); }
370
371 /// Return true if we know at compile time this has more bits than VT.
372 bool knownBitsGT(MVT VT) const {
374 }
375
376 /// Return true if we know at compile time this has more than or the same
377 /// bits as VT.
378 bool knownBitsGE(MVT VT) const {
380 }
381
382 /// Return true if we know at compile time this has fewer bits than VT.
383 bool knownBitsLT(MVT VT) const {
385 }
386
387 /// Return true if we know at compile time this has fewer than or the same
388 /// bits as VT.
389 bool knownBitsLE(MVT VT) const {
391 }
392
393 /// Return true if this has more bits than VT.
394 bool bitsGT(MVT VT) const {
396 "Comparison between scalable and fixed types");
397 return knownBitsGT(VT);
398 }
399
400 /// Return true if this has no less bits than VT.
401 bool bitsGE(MVT VT) const {
403 "Comparison between scalable and fixed types");
404 return knownBitsGE(VT);
405 }
406
407 /// Return true if this has less bits than VT.
408 bool bitsLT(MVT VT) const {
410 "Comparison between scalable and fixed types");
411 return knownBitsLT(VT);
412 }
413
414 /// Return true if this has no more bits than VT.
415 bool bitsLE(MVT VT) const {
417 "Comparison between scalable and fixed types");
418 return knownBitsLE(VT);
419 }
420
421 static MVT getFloatingPointVT(unsigned BitWidth) {
422#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
423 if (FP == 3 && sz == BitWidth) \
424 return Ty;
425#include "llvm/CodeGen/GenVT.inc"
426#undef GET_VT_ATTR
427
428 llvm_unreachable("Bad bit width!");
429 }
430
431 static MVT getIntegerVT(unsigned BitWidth) {
432#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, NElem, EltTy) \
433 if (Int == 3 && sz == BitWidth) \
434 return Ty;
435#include "llvm/CodeGen/GenVT.inc"
436#undef GET_VT_ATTR
437
439 }
440
441 static MVT getVectorVT(MVT VT, unsigned NumElements) {
442#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy) \
443 if (!Sc && VT.SimpleTy == ElTy && NumElements == nElem) \
444 return Ty;
445#include "llvm/CodeGen/GenVT.inc"
446#undef GET_VT_VECATTR
447
449 }
450
451 static MVT getScalableVectorVT(MVT VT, unsigned NumElements) {
452#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy) \
453 if (Sc && VT.SimpleTy == ElTy && NumElements == nElem) \
454 return Ty;
455#include "llvm/CodeGen/GenVT.inc"
456#undef GET_VT_VECATTR
457
459 }
460
461 static MVT getVectorVT(MVT VT, unsigned NumElements, bool IsScalable) {
462 if (IsScalable)
463 return getScalableVectorVT(VT, NumElements);
464 return getVectorVT(VT, NumElements);
465 }
466
468 if (EC.isScalable())
469 return getScalableVectorVT(VT, EC.getKnownMinValue());
470 return getVectorVT(VT, EC.getKnownMinValue());
471 }
472
473 /// Return the value type corresponding to the specified type.
474 /// If HandleUnknown is true, unknown types are returned as Other,
475 /// otherwise they are invalid.
476 /// NB: This includes pointer types, which require a DataLayout to convert
477 /// to a concrete value type.
478 static MVT getVT(Type *Ty, bool HandleUnknown = false);
479
480 /// Returns an APFloat semantics tag appropriate for the value type. If this
481 /// is a vector type, the element semantics are returned.
482 const fltSemantics &getFltSemantics() const;
483
484 public:
485 /// SimpleValueType Iteration
486 /// @{
487 static auto all_valuetypes() {
488 return enum_seq_inclusive(MVT::FIRST_VALUETYPE, MVT::LAST_VALUETYPE,
490 }
491
492 static auto integer_valuetypes() {
493 return enum_seq_inclusive(MVT::FIRST_INTEGER_VALUETYPE,
494 MVT::LAST_INTEGER_VALUETYPE,
496 }
497
498 static auto fp_valuetypes() {
499 return enum_seq_inclusive(MVT::FIRST_FP_VALUETYPE, MVT::LAST_FP_VALUETYPE,
501 }
502
503 static auto vector_valuetypes() {
504 return enum_seq_inclusive(MVT::FIRST_VECTOR_VALUETYPE,
505 MVT::LAST_VECTOR_VALUETYPE,
507 }
508
510 return enum_seq_inclusive(MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE,
511 MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE,
513 }
514
516 return enum_seq_inclusive(MVT::FIRST_SCALABLE_VECTOR_VALUETYPE,
517 MVT::LAST_SCALABLE_VECTOR_VALUETYPE,
519 }
520
522 return enum_seq_inclusive(MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE,
523 MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE,
525 }
526
528 return enum_seq_inclusive(MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE,
529 MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE,
531 }
532
534 return enum_seq_inclusive(MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE,
535 MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE,
537 }
538
540 return enum_seq_inclusive(MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE,
541 MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE,
543 }
544 /// @}
545 };
546
547 inline raw_ostream &operator<<(raw_ostream &OS, const MVT &VT) {
548 VT.print(OS);
549 return OS;
550 }
551
552} // end namespace llvm
553
554#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:311
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.
@ INVALID_SIMPLE_VALUE_TYPE
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
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:231
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.
const fltSemantics & getFltSemantics() const
Returns an APFloat semantics tag appropriate for the value type.
Definition: ValueTypes.cpp:293
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:317
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:292
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:191