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) 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 // This is the current maximum for LAST_VALUETYPE.
50 // MVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors
51 // This value must be a multiple of 32.
53 };
54
55 static_assert(FIRST_VALUETYPE > 0);
56 static_assert(LAST_VALUETYPE < MAX_ALLOWED_VALUETYPE);
57
59
60 constexpr MVT() = default;
61 constexpr MVT(SimpleValueType SVT) : SimpleTy(SVT) {}
62
63 bool operator>(const MVT& S) const { return SimpleTy > S.SimpleTy; }
64 bool operator<(const MVT& S) const { return SimpleTy < S.SimpleTy; }
65 bool operator==(const MVT& S) const { return SimpleTy == S.SimpleTy; }
66 bool operator!=(const MVT& S) const { return SimpleTy != S.SimpleTy; }
67 bool operator>=(const MVT& S) const { return SimpleTy >= S.SimpleTy; }
68 bool operator<=(const MVT& S) const { return SimpleTy <= S.SimpleTy; }
69
70 /// Support for debugging, callable in GDB: VT.dump()
71 void dump() const;
72
73 /// Implement operator<<.
74 void print(raw_ostream &OS) const;
75
76 /// Return true if this is a valid simple valuetype.
77 bool isValid() const {
78 return (SimpleTy >= MVT::FIRST_VALUETYPE &&
79 SimpleTy <= MVT::LAST_VALUETYPE);
80 }
81
82 /// Return true if this is a FP or a vector FP type.
83 bool isFloatingPoint() const {
84 return ((SimpleTy >= MVT::FIRST_FP_VALUETYPE &&
85 SimpleTy <= MVT::LAST_FP_VALUETYPE) ||
86 (SimpleTy >= MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE &&
87 SimpleTy <= MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE) ||
88 (SimpleTy >= MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE &&
89 SimpleTy <= MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE));
90 }
91
92 /// Return true if this is an integer or a vector integer type.
93 bool isInteger() const {
94 return ((SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
95 SimpleTy <= MVT::LAST_INTEGER_VALUETYPE) ||
96 (SimpleTy >= MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE &&
97 SimpleTy <= MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE) ||
98 (SimpleTy >= MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE &&
99 SimpleTy <= MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE));
100 }
101
102 /// Return true if this is an integer, not including vectors.
103 bool isScalarInteger() const {
104 return (SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
105 SimpleTy <= MVT::LAST_INTEGER_VALUETYPE);
106 }
107
108 /// Return true if this is a vector value type.
109 bool isVector() const {
110 return (SimpleTy >= MVT::FIRST_VECTOR_VALUETYPE &&
111 SimpleTy <= MVT::LAST_VECTOR_VALUETYPE);
112 }
113
114 /// Return true if this is a vector value type where the
115 /// runtime length is machine dependent
116 bool isScalableVector() const {
117 return (SimpleTy >= MVT::FIRST_SCALABLE_VECTOR_VALUETYPE &&
118 SimpleTy <= MVT::LAST_SCALABLE_VECTOR_VALUETYPE);
119 }
120
121 /// Return true if this is a custom target type that has a scalable size.
123 return SimpleTy == MVT::aarch64svcount;
124 }
125
126 /// Return true if the type is a scalable type.
127 bool isScalableVT() const {
129 }
130
131 bool isFixedLengthVector() const {
132 return (SimpleTy >= MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE &&
133 SimpleTy <= MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE);
134 }
135
136 /// Return true if this is a 16-bit vector type.
137 bool is16BitVector() const {
138 return (isFixedLengthVector() && getFixedSizeInBits() == 16);
139 }
140
141 /// Return true if this is a 32-bit vector type.
142 bool is32BitVector() const {
143 return (isFixedLengthVector() && getFixedSizeInBits() == 32);
144 }
145
146 /// Return true if this is a 64-bit vector type.
147 bool is64BitVector() const {
148 return (isFixedLengthVector() && getFixedSizeInBits() == 64);
149 }
150
151 /// Return true if this is a 128-bit vector type.
152 bool is128BitVector() const {
153 return (isFixedLengthVector() && getFixedSizeInBits() == 128);
154 }
155
156 /// Return true if this is a 256-bit vector type.
157 bool is256BitVector() const {
158 return (isFixedLengthVector() && getFixedSizeInBits() == 256);
159 }
160
161 /// Return true if this is a 512-bit vector type.
162 bool is512BitVector() const {
163 return (isFixedLengthVector() && getFixedSizeInBits() == 512);
164 }
165
166 /// Return true if this is a 1024-bit vector type.
167 bool is1024BitVector() const {
168 return (isFixedLengthVector() && getFixedSizeInBits() == 1024);
169 }
170
171 /// Return true if this is a 2048-bit vector type.
172 bool is2048BitVector() const {
173 return (isFixedLengthVector() && getFixedSizeInBits() == 2048);
174 }
175
176 /// Return true if this is an overloaded type for TableGen.
177 bool isOverloaded() const {
178 switch (SimpleTy) {
179#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc) \
180 case Ty: \
181 return Any;
182#include "llvm/CodeGen/GenVT.inc"
183#undef GET_VT_ATTR
184 default:
185 return false;
186 }
187 }
188
189 /// Return a vector with the same number of elements as this vector, but
190 /// with the element type converted to an integer type with the same
191 /// bitwidth.
193 MVT EltTy = getVectorElementType();
194 MVT IntTy = MVT::getIntegerVT(EltTy.getSizeInBits());
197 "Simple vector VT not representable by simple integer vector VT!");
198 return VecTy;
199 }
200
201 /// Return a VT for a vector type whose attributes match ourselves
202 /// with the exception of the element type that is chosen by the caller.
206 "Simple vector VT not representable by simple integer vector VT!");
207 return VecTy;
208 }
209
210 /// Return the type converted to an equivalently sized integer or vector
211 /// with integer element type. Similar to changeVectorElementTypeToInteger,
212 /// but also handles scalars.
214 if (isVector())
217 }
218
219 /// Return a VT for a vector type with the same element type but
220 /// half the number of elements.
222 MVT EltVT = getVectorElementType();
223 auto EltCnt = getVectorElementCount();
224 assert(EltCnt.isKnownEven() && "Splitting vector, but not in half!");
225 return getVectorVT(EltVT, EltCnt.divideCoefficientBy(2));
226 }
227
228 // Return a VT for a vector type with the same element type but
229 // double the number of elements.
231 MVT EltVT = getVectorElementType();
232 auto EltCnt = getVectorElementCount();
233 return MVT::getVectorVT(EltVT, EltCnt * 2);
234 }
235
236 /// Returns true if the given vector is a power of 2.
237 bool isPow2VectorType() const {
238 unsigned NElts = getVectorMinNumElements();
239 return !(NElts & (NElts - 1));
240 }
241
242 /// Widens the length of the given vector MVT up to the nearest power of 2
243 /// and returns that type.
245 if (isPow2VectorType())
246 return *this;
247
249 unsigned NewMinCount = 1 << Log2_32_Ceil(NElts.getKnownMinValue());
250 NElts = ElementCount::get(NewMinCount, NElts.isScalable());
251 return MVT::getVectorVT(getVectorElementType(), NElts);
252 }
253
254 /// If this is a vector, return the element type, otherwise return this.
256 return isVector() ? getVectorElementType() : *this;
257 }
258
260 switch (SimpleTy) {
261 default:
262 llvm_unreachable("Not a vector MVT!");
263
264#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz) \
265 case Ty: \
266 return ElTy;
267#include "llvm/CodeGen/GenVT.inc"
268#undef GET_VT_VECATTR
269 }
270 }
271
272 /// Given a vector type, return the minimum number of elements it contains.
273 unsigned getVectorMinNumElements() const {
274 switch (SimpleTy) {
275 default:
276 llvm_unreachable("Not a vector MVT!");
277
278#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz) \
279 case Ty: \
280 return nElem;
281#include "llvm/CodeGen/GenVT.inc"
282#undef GET_VT_VECATTR
283 }
284 }
285
288 }
289
290 unsigned getVectorNumElements() const {
291 if (isScalableVector())
293 "Possible incorrect use of MVT::getVectorNumElements() for "
294 "scalable vector. Scalable flag may be dropped, use "
295 "MVT::getVectorElementCount() instead");
297 }
298
299 /// Returns the size of the specified MVT in bits.
300 ///
301 /// If the value type is a scalable vector type, the scalable property will
302 /// be set and the runtime size will be a positive integer multiple of the
303 /// base size.
305 static constexpr TypeSize SizeTable[] = {
306#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc) \
307 TypeSize(Sz, Sc || Ty == aarch64svcount /* FIXME: Not in the td. */),
308#include "llvm/CodeGen/GenVT.inc"
309#undef GET_VT_ATTR
310 };
311
312 switch (SimpleTy) {
314 llvm_unreachable("getSizeInBits called on extended MVT.");
315 case Other:
316 llvm_unreachable("Value type is non-standard value, Other.");
317 case iPTR:
318 llvm_unreachable("Value type size is target-dependent. Ask TLI.");
319 case iPTRAny:
320 case iAny:
321 case fAny:
322 case vAny:
323 case Any:
324 llvm_unreachable("Value type is overloaded.");
325 case token:
326 llvm_unreachable("Token type is a sentinel that cannot be used "
327 "in codegen and has no size");
328 case Metadata:
329 llvm_unreachable("Value type is metadata.");
330 default:
331 assert(SimpleTy < VALUETYPE_SIZE && "Unexpected value type!");
332 return SizeTable[SimpleTy - FIRST_VALUETYPE];
333 }
334 }
335
336 /// Return the size of the specified fixed width value type in bits. The
337 /// function will assert if the type is scalable.
339 return getSizeInBits().getFixedValue();
340 }
341
344 }
345
346 /// Return the number of bytes overwritten by a store of the specified value
347 /// type.
348 ///
349 /// If the value type is a scalable vector type, the scalable property will
350 /// be set and the runtime size will be a positive integer multiple of the
351 /// base size.
353 TypeSize BaseSize = getSizeInBits();
354 return {(BaseSize.getKnownMinValue() + 7) / 8, BaseSize.isScalable()};
355 }
356
357 // Return the number of bytes overwritten by a store of this value type or
358 // this value type's element type in the case of a vector.
361 }
362
363 /// Return the number of bits overwritten by a store of the specified value
364 /// type.
365 ///
366 /// If the value type is a scalable vector type, the scalable property will
367 /// be set and the runtime size will be a positive integer multiple of the
368 /// base size.
370 return getStoreSize() * 8;
371 }
372
373 /// Returns true if the number of bits for the type is a multiple of an
374 /// 8-bit byte.
375 bool isByteSized() const { return getSizeInBits().isKnownMultipleOf(8); }
376
377 /// Return true if we know at compile time this has more bits than VT.
378 bool knownBitsGT(MVT VT) const {
380 }
381
382 /// Return true if we know at compile time this has more than or the same
383 /// bits as VT.
384 bool knownBitsGE(MVT VT) const {
386 }
387
388 /// Return true if we know at compile time this has fewer bits than VT.
389 bool knownBitsLT(MVT VT) const {
391 }
392
393 /// Return true if we know at compile time this has fewer than or the same
394 /// bits as VT.
395 bool knownBitsLE(MVT VT) const {
397 }
398
399 /// Return true if this has more bits than VT.
400 bool bitsGT(MVT VT) const {
402 "Comparison between scalable and fixed types");
403 return knownBitsGT(VT);
404 }
405
406 /// Return true if this has no less bits than VT.
407 bool bitsGE(MVT VT) const {
409 "Comparison between scalable and fixed types");
410 return knownBitsGE(VT);
411 }
412
413 /// Return true if this has less bits than VT.
414 bool bitsLT(MVT VT) const {
416 "Comparison between scalable and fixed types");
417 return knownBitsLT(VT);
418 }
419
420 /// Return true if this has no more bits than VT.
421 bool bitsLE(MVT VT) const {
423 "Comparison between scalable and fixed types");
424 return knownBitsLE(VT);
425 }
426
427 static MVT getFloatingPointVT(unsigned BitWidth) {
428#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc) \
429 if (FP == 3 && sz == BitWidth) \
430 return Ty;
431#include "llvm/CodeGen/GenVT.inc"
432#undef GET_VT_ATTR
433
434 llvm_unreachable("Bad bit width!");
435 }
436
437 static MVT getIntegerVT(unsigned BitWidth) {
438#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc) \
439 if (Int == 3 && sz == BitWidth) \
440 return Ty;
441#include "llvm/CodeGen/GenVT.inc"
442#undef GET_VT_ATTR
443
445 }
446
447 static MVT getVectorVT(MVT VT, unsigned NumElements) {
448#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz) \
449 if (!Sc && VT.SimpleTy == ElTy && NumElements == nElem) \
450 return Ty;
451#include "llvm/CodeGen/GenVT.inc"
452#undef GET_VT_VECATTR
453
455 }
456
457 static MVT getScalableVectorVT(MVT VT, unsigned NumElements) {
458#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz) \
459 if (Sc && VT.SimpleTy == ElTy && NumElements == nElem) \
460 return Ty;
461#include "llvm/CodeGen/GenVT.inc"
462#undef GET_VT_VECATTR
463
465 }
466
467 static MVT getVectorVT(MVT VT, unsigned NumElements, bool IsScalable) {
468 if (IsScalable)
469 return getScalableVectorVT(VT, NumElements);
470 return getVectorVT(VT, NumElements);
471 }
472
474 if (EC.isScalable())
475 return getScalableVectorVT(VT, EC.getKnownMinValue());
476 return getVectorVT(VT, EC.getKnownMinValue());
477 }
478
479 /// Return the value type corresponding to the specified type. This returns
480 /// all pointers as iPTR. If HandleUnknown is true, unknown types are
481 /// returned as Other, otherwise they are invalid.
482 static MVT getVT(Type *Ty, bool HandleUnknown = false);
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:302
Machine Value Type.
void dump() const
Support for debugging, callable in GDB: VT.dump()
Definition: ValueTypes.cpp:647
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:585
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:653
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:180
constexpr ScalarTy getFixedValue() const
Definition: TypeSize.h:187
static constexpr bool isKnownLE(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition: TypeSize.h:217
static constexpr bool isKnownLT(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition: TypeSize.h:203
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:210
static constexpr bool isKnownGE(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition: TypeSize.h:224
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:326
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:38
@ Other
Any other memory.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:293
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:191