Movatterモバイル変換


[0]ホーム

URL:


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"
20#include "llvm/Support/ErrorHandling.h"
21#include "llvm/Support/MathExtras.h"
22#include "llvm/Support/TypeSize.h"
23#include <cassert>
24#include <cstdint>
25
26namespacellvm {
27
28classType;
29structfltSemantics;
30classraw_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.
35classMVT {
36public:
37enumSimpleValueType :uint16_t {
38// Simple value types that aren't explicitly part of this enumeration
39// are considered extended value types.
40INVALID_SIMPLE_VALUE_TYPE = 0,
41
42#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
43 Ty = n,
44#define GET_VT_RANGES
45#include "llvm/CodeGen/GenVT.inc"
46#undef GET_VT_ATTR
47#undef GET_VT_RANGES
48
49VALUETYPE_SIZE = LAST_VALUETYPE + 1,
50 };
51
52static_assert(FIRST_VALUETYPE > 0);
53static_assert(LAST_VALUETYPE < token);
54
55SimpleValueTypeSimpleTy =INVALID_SIMPLE_VALUE_TYPE;
56
57constexprMVT() =default;
58constexprMVT(SimpleValueType SVT) :SimpleTy(SVT) {}
59
60booloperator>(constMVT& S) const{returnSimpleTy > S.SimpleTy; }
61booloperator<(constMVT& S) const{returnSimpleTy < S.SimpleTy; }
62booloperator==(constMVT& S) const{returnSimpleTy == S.SimpleTy; }
63booloperator!=(constMVT& S) const{returnSimpleTy != S.SimpleTy; }
64booloperator>=(constMVT& S) const{returnSimpleTy >= S.SimpleTy; }
65booloperator<=(constMVT& S) const{returnSimpleTy <= S.SimpleTy; }
66
67 /// Support for debugging, callable in GDB: VT.dump()
68voiddump()const;
69
70 /// Implement operator<<.
71voidprint(raw_ostream &OS)const;
72
73 /// Return true if this is a valid simple valuetype.
74boolisValid() const{
75return (SimpleTy >= MVT::FIRST_VALUETYPE &&
76SimpleTy <= MVT::LAST_VALUETYPE);
77 }
78
79 /// Return true if this is a FP or a vector FP type.
80boolisFloatingPoint() const{
81return ((SimpleTy >= MVT::FIRST_FP_VALUETYPE &&
82SimpleTy <= MVT::LAST_FP_VALUETYPE) ||
83 (SimpleTy >= MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE &&
84SimpleTy <= MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE) ||
85 (SimpleTy >= MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE &&
86SimpleTy <= MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE));
87 }
88
89 /// Return true if this is an integer or a vector integer type.
90boolisInteger() const{
91return ((SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
92SimpleTy <= MVT::LAST_INTEGER_VALUETYPE) ||
93 (SimpleTy >= MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE &&
94SimpleTy <= MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE) ||
95 (SimpleTy >= MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE &&
96SimpleTy <= MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE));
97 }
98
99 /// Return true if this is an integer, not including vectors.
100boolisScalarInteger() const{
101return (SimpleTy >= MVT::FIRST_INTEGER_VALUETYPE &&
102SimpleTy <= MVT::LAST_INTEGER_VALUETYPE);
103 }
104
105 /// Return true if this is a vector value type.
106boolisVector() const{
107return (SimpleTy >= MVT::FIRST_VECTOR_VALUETYPE &&
108SimpleTy <= MVT::LAST_VECTOR_VALUETYPE);
109 }
110
111 /// Return true if this is a vector value type where the
112 /// runtime length is machine dependent
113boolisScalableVector() const{
114return (SimpleTy >= MVT::FIRST_SCALABLE_VECTOR_VALUETYPE &&
115SimpleTy <= MVT::LAST_SCALABLE_VECTOR_VALUETYPE);
116 }
117
118 /// Return true if this is a RISCV vector tuple type where the
119 /// runtime length is machine dependent
120boolisRISCVVectorTuple() const{
121return (SimpleTy >= MVT::FIRST_RISCV_VECTOR_TUPLE_VALUETYPE &&
122SimpleTy <= MVT::LAST_RISCV_VECTOR_TUPLE_VALUETYPE);
123 }
124
125 /// Return true if this is a custom target type that has a scalable size.
126boolisScalableTargetExtVT() const{
127returnSimpleTy == MVT::aarch64svcount ||isRISCVVectorTuple();
128 }
129
130 /// Return true if the type is a scalable type.
131boolisScalableVT() const{
132returnisScalableVector() ||isScalableTargetExtVT();
133 }
134
135boolisFixedLengthVector() const{
136return (SimpleTy >= MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE &&
137SimpleTy <= MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE);
138 }
139
140 /// Return true if this is a 16-bit vector type.
141boolis16BitVector() const{
142return (isFixedLengthVector() &&getFixedSizeInBits() == 16);
143 }
144
145 /// Return true if this is a 32-bit vector type.
146boolis32BitVector() const{
147return (isFixedLengthVector() &&getFixedSizeInBits() == 32);
148 }
149
150 /// Return true if this is a 64-bit vector type.
151boolis64BitVector() const{
152return (isFixedLengthVector() &&getFixedSizeInBits() == 64);
153 }
154
155 /// Return true if this is a 128-bit vector type.
156boolis128BitVector() const{
157return (isFixedLengthVector() &&getFixedSizeInBits() == 128);
158 }
159
160 /// Return true if this is a 256-bit vector type.
161boolis256BitVector() const{
162return (isFixedLengthVector() &&getFixedSizeInBits() == 256);
163 }
164
165 /// Return true if this is a 512-bit vector type.
166boolis512BitVector() const{
167return (isFixedLengthVector() &&getFixedSizeInBits() == 512);
168 }
169
170 /// Return true if this is a 1024-bit vector type.
171boolis1024BitVector() const{
172return (isFixedLengthVector() &&getFixedSizeInBits() == 1024);
173 }
174
175 /// Return true if this is a 2048-bit vector type.
176boolis2048BitVector() const{
177return (isFixedLengthVector() &&getFixedSizeInBits() == 2048);
178 }
179
180 /// Return true if this is an overloaded type for TableGen.
181boolisOverloaded() const{
182switch (SimpleTy) {
183#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
184 case Ty: \
185 return Any;
186#include "llvm/CodeGen/GenVT.inc"
187#undef GET_VT_ATTR
188default:
189returnfalse;
190 }
191 }
192
193 /// Return a vector with the same number of elements as this vector, but
194 /// with the element type converted to an integer type with the same
195 /// bitwidth.
196MVTchangeVectorElementTypeToInteger() const{
197MVT EltTy =getVectorElementType();
198MVT IntTy =MVT::getIntegerVT(EltTy.getSizeInBits());
199MVT VecTy =MVT::getVectorVT(IntTy,getVectorElementCount());
200assert(VecTy.SimpleTy !=MVT::INVALID_SIMPLE_VALUE_TYPE &&
201"Simple vector VT not representable by simple integer vector VT!");
202return VecTy;
203 }
204
205 /// Return a VT for a vector type whose attributes match ourselves
206 /// with the exception of the element type that is chosen by the caller.
207MVTchangeVectorElementType(MVT EltVT) const{
208MVT VecTy =MVT::getVectorVT(EltVT,getVectorElementCount());
209assert(VecTy.SimpleTy !=MVT::INVALID_SIMPLE_VALUE_TYPE &&
210"Simple vector VT not representable by simple integer vector VT!");
211return VecTy;
212 }
213
214 /// Return the type converted to an equivalently sized integer or vector
215 /// with integer element type. Similar to changeVectorElementTypeToInteger,
216 /// but also handles scalars.
217MVTchangeTypeToInteger() {
218if (isVector())
219returnchangeVectorElementTypeToInteger();
220returnMVT::getIntegerVT(getSizeInBits());
221 }
222
223 /// Return a VT for a vector type with the same element type but
224 /// half the number of elements.
225MVTgetHalfNumVectorElementsVT() const{
226MVT EltVT =getVectorElementType();
227auto EltCnt =getVectorElementCount();
228assert(EltCnt.isKnownEven() &&"Splitting vector, but not in half!");
229returngetVectorVT(EltVT, EltCnt.divideCoefficientBy(2));
230 }
231
232// Return a VT for a vector type with the same element type but
233// double the number of elements.
234MVTgetDoubleNumVectorElementsVT() const{
235MVT EltVT =getVectorElementType();
236auto EltCnt =getVectorElementCount();
237returnMVT::getVectorVT(EltVT, EltCnt * 2);
238 }
239
240 /// Returns true if the given vector is a power of 2.
241boolisPow2VectorType() const{
242unsigned NElts =getVectorMinNumElements();
243return !(NElts & (NElts - 1));
244 }
245
246 /// Widens the length of the given vector MVT up to the nearest power of 2
247 /// and returns that type.
248MVTgetPow2VectorType() const{
249if (isPow2VectorType())
250return *this;
251
252ElementCount NElts =getVectorElementCount();
253unsigned NewMinCount = 1 <<Log2_32_Ceil(NElts.getKnownMinValue());
254 NElts =ElementCount::get(NewMinCount, NElts.isScalable());
255returnMVT::getVectorVT(getVectorElementType(), NElts);
256 }
257
258 /// If this is a vector, return the element type, otherwise return this.
259MVTgetScalarType() const{
260returnisVector() ?getVectorElementType() : *this;
261 }
262
263MVTgetVectorElementType() const{
264assert(SimpleTy >= FIRST_VALUETYPE &&SimpleTy <= LAST_VALUETYPE);
265staticconstexprSimpleValueType EltTyTable[] = {
266#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
267 EltTy,
268#include "llvm/CodeGen/GenVT.inc"
269#undef GET_VT_ATTR
270 };
271SimpleValueType VT = EltTyTable[SimpleTy - FIRST_VALUETYPE];
272assert(VT !=INVALID_SIMPLE_VALUE_TYPE &&"Not a vector MVT!");
273return VT;
274 }
275
276 /// Given a vector type, return the minimum number of elements it contains.
277unsignedgetVectorMinNumElements() const{
278assert(SimpleTy >= FIRST_VALUETYPE &&SimpleTy <= LAST_VALUETYPE);
279staticconstexpruint16_t NElemTable[] = {
280#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
281 NElem,
282#include "llvm/CodeGen/GenVT.inc"
283#undef GET_VT_ATTR
284 };
285unsigned NElem = NElemTable[SimpleTy - FIRST_VALUETYPE];
286assert(NElem != 0 &&"Not a vector MVT!");
287return NElem;
288 }
289
290ElementCountgetVectorElementCount() const{
291returnElementCount::get(getVectorMinNumElements(),isScalableVector());
292 }
293
294unsignedgetVectorNumElements() const{
295if (isScalableVector())
296llvm::reportInvalidSizeRequest(
297"Possible incorrect use of MVT::getVectorNumElements() for "
298"scalable vector. Scalable flag may be dropped, use "
299"MVT::getVectorElementCount() instead");
300returngetVectorMinNumElements();
301 }
302
303 /// Returns the size of the specified MVT in bits.
304 ///
305 /// If the value type is a scalable vector type, the scalable property will
306 /// be set and the runtime size will be a positive integer multiple of the
307 /// base size.
308TypeSizegetSizeInBits() const{
309staticconstexprTypeSize SizeTable[] = {
310#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
311 TypeSize(Sz, Sc || Tup || Ty == aarch64svcount/* FIXME: Not in the td. \
312 */),
313#include "llvm/CodeGen/GenVT.inc"
314#undef GET_VT_ATTR
315 };
316
317switch (SimpleTy) {
318caseINVALID_SIMPLE_VALUE_TYPE:
319llvm_unreachable("getSizeInBits called on extended MVT.");
320caseOther:
321llvm_unreachable("Value type is non-standard value, Other.");
322case iPTR:
323llvm_unreachable("Value type size is target-dependent. Ask TLI.");
324case pAny:
325case iAny:
326case fAny:
327case vAny:
328caseAny:
329llvm_unreachable("Value type is overloaded.");
330case token:
331llvm_unreachable("Token type is a sentinel that cannot be used "
332"in codegen and has no size");
333caseMetadata:
334llvm_unreachable("Value type is metadata.");
335default:
336assert(SimpleTy <VALUETYPE_SIZE &&"Unexpected value type!");
337return SizeTable[SimpleTy - FIRST_VALUETYPE];
338 }
339 }
340
341 /// Return the size of the specified fixed width value type in bits. The
342 /// function will assert if the type is scalable.
343uint64_tgetFixedSizeInBits() const{
344returngetSizeInBits().getFixedValue();
345 }
346
347uint64_tgetScalarSizeInBits() const{
348returngetScalarType().getSizeInBits().getFixedValue();
349 }
350
351 /// Return the number of bytes overwritten by a store of the specified value
352 /// type.
353 ///
354 /// If the value type is a scalable vector type, the scalable property will
355 /// be set and the runtime size will be a positive integer multiple of the
356 /// base size.
357TypeSizegetStoreSize() const{
358TypeSize BaseSize =getSizeInBits();
359return {(BaseSize.getKnownMinValue() + 7) / 8, BaseSize.isScalable()};
360 }
361
362// Return the number of bytes overwritten by a store of this value type or
363// this value type's element type in the case of a vector.
364uint64_tgetScalarStoreSize() const{
365returngetScalarType().getStoreSize().getFixedValue();
366 }
367
368 /// Return the number of bits overwritten by a store of the specified value
369 /// type.
370 ///
371 /// If the value type is a scalable vector type, the scalable property will
372 /// be set and the runtime size will be a positive integer multiple of the
373 /// base size.
374TypeSizegetStoreSizeInBits() const{
375returngetStoreSize() * 8;
376 }
377
378 /// Returns true if the number of bits for the type is a multiple of an
379 /// 8-bit byte.
380boolisByteSized() const{returngetSizeInBits().isKnownMultipleOf(8); }
381
382 /// Return true if we know at compile time this has more bits than VT.
383boolknownBitsGT(MVT VT) const{
384returnTypeSize::isKnownGT(getSizeInBits(), VT.getSizeInBits());
385 }
386
387 /// Return true if we know at compile time this has more than or the same
388 /// bits as VT.
389boolknownBitsGE(MVT VT) const{
390returnTypeSize::isKnownGE(getSizeInBits(), VT.getSizeInBits());
391 }
392
393 /// Return true if we know at compile time this has fewer bits than VT.
394boolknownBitsLT(MVT VT) const{
395returnTypeSize::isKnownLT(getSizeInBits(), VT.getSizeInBits());
396 }
397
398 /// Return true if we know at compile time this has fewer than or the same
399 /// bits as VT.
400boolknownBitsLE(MVT VT) const{
401returnTypeSize::isKnownLE(getSizeInBits(), VT.getSizeInBits());
402 }
403
404 /// Return true if this has more bits than VT.
405boolbitsGT(MVT VT) const{
406assert(isScalableVector() == VT.isScalableVector() &&
407"Comparison between scalable and fixed types");
408returnknownBitsGT(VT);
409 }
410
411 /// Return true if this has no less bits than VT.
412boolbitsGE(MVT VT) const{
413assert(isScalableVector() == VT.isScalableVector() &&
414"Comparison between scalable and fixed types");
415returnknownBitsGE(VT);
416 }
417
418 /// Return true if this has less bits than VT.
419boolbitsLT(MVT VT) const{
420assert(isScalableVector() == VT.isScalableVector() &&
421"Comparison between scalable and fixed types");
422returnknownBitsLT(VT);
423 }
424
425 /// Return true if this has no more bits than VT.
426boolbitsLE(MVT VT) const{
427assert(isScalableVector() == VT.isScalableVector() &&
428"Comparison between scalable and fixed types");
429returnknownBitsLE(VT);
430 }
431
432staticMVTgetFloatingPointVT(unsignedBitWidth) {
433#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
434 if (FP == 3 && sz == BitWidth) \
435 return Ty;
436#include "llvm/CodeGen/GenVT.inc"
437#undef GET_VT_ATTR
438
439llvm_unreachable("Bad bit width!");
440 }
441
442staticMVTgetIntegerVT(unsignedBitWidth) {
443#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
444 if (Int == 3 && sz == BitWidth) \
445 return Ty;
446#include "llvm/CodeGen/GenVT.inc"
447#undef GET_VT_ATTR
448
449return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
450 }
451
452staticMVTgetVectorVT(MVT VT,unsigned NumElements) {
453#define GET_VT_VECATTR(Ty, Sc, Tup, nElem, ElTy) \
454 if (!Sc && !Tup && VT.SimpleTy == ElTy && NumElements == nElem) \
455 return Ty;
456#include "llvm/CodeGen/GenVT.inc"
457#undef GET_VT_VECATTR
458
459return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
460 }
461
462staticMVTgetScalableVectorVT(MVT VT,unsigned NumElements) {
463#define GET_VT_VECATTR(Ty, Sc, Tup, nElem, ElTy) \
464 if (Sc && VT.SimpleTy == ElTy && NumElements == nElem) \
465 return Ty;
466#include "llvm/CodeGen/GenVT.inc"
467#undef GET_VT_VECATTR
468
469return (MVT::SimpleValueType)(MVT::INVALID_SIMPLE_VALUE_TYPE);
470 }
471
472staticMVTgetRISCVVectorTupleVT(unsigned Sz,unsigned NFields) {
473#define GET_VT_ATTR(Ty, n, sz, Any, Int, FP, Vec, Sc, Tup, NF, nElem, EltTy) \
474 if (Tup && sz == Sz && NF == NFields) \
475 return Ty;
476#include "llvm/CodeGen/GenVT.inc"
477#undef GET_VT_ATTR
478
479llvm_unreachable("Invalid RISCV vector tuple type");
480 }
481
482 /// Given a RISC-V vector tuple type, return the num_fields.
483unsignedgetRISCVVectorTupleNumFields() const{
484assert(isRISCVVectorTuple() &&SimpleTy >= FIRST_VALUETYPE &&
485SimpleTy <= LAST_VALUETYPE);
486staticconstexpruint8_t NFTable[] = {
487#define GET_VT_ATTR(Ty, N, Sz, Any, Int, FP, Vec, Sc, Tup, NF, NElem, EltTy) \
488 NF,
489#include "llvm/CodeGen/GenVT.inc"
490#undef GET_VT_ATTR
491 };
492return NFTable[SimpleTy - FIRST_VALUETYPE];
493 }
494
495staticMVTgetVectorVT(MVT VT,unsigned NumElements,bool IsScalable) {
496if (IsScalable)
497returngetScalableVectorVT(VT, NumElements);
498returngetVectorVT(VT, NumElements);
499 }
500
501staticMVTgetVectorVT(MVT VT,ElementCount EC) {
502if (EC.isScalable())
503returngetScalableVectorVT(VT, EC.getKnownMinValue());
504returngetVectorVT(VT, EC.getKnownMinValue());
505 }
506
507 /// Return the value type corresponding to the specified type.
508 /// If HandleUnknown is true, unknown types are returned as Other,
509 /// otherwise they are invalid.
510 /// NB: This includes pointer types, which require a DataLayout to convert
511 /// to a concrete value type.
512staticMVTgetVT(Type *Ty,bool HandleUnknown =false);
513
514 /// Returns an APFloat semantics tag appropriate for the value type. If this
515 /// is a vector type, the element semantics are returned.
516constfltSemantics &getFltSemantics()const;
517
518public:
519 /// SimpleValueType Iteration
520 /// @{
521staticautoall_valuetypes() {
522returnenum_seq_inclusive(MVT::FIRST_VALUETYPE, MVT::LAST_VALUETYPE,
523force_iteration_on_noniterable_enum);
524 }
525
526staticautointeger_valuetypes() {
527returnenum_seq_inclusive(MVT::FIRST_INTEGER_VALUETYPE,
528 MVT::LAST_INTEGER_VALUETYPE,
529force_iteration_on_noniterable_enum);
530 }
531
532staticautofp_valuetypes() {
533returnenum_seq_inclusive(MVT::FIRST_FP_VALUETYPE, MVT::LAST_FP_VALUETYPE,
534force_iteration_on_noniterable_enum);
535 }
536
537staticautovector_valuetypes() {
538returnenum_seq_inclusive(MVT::FIRST_VECTOR_VALUETYPE,
539 MVT::LAST_VECTOR_VALUETYPE,
540force_iteration_on_noniterable_enum);
541 }
542
543staticautofixedlen_vector_valuetypes() {
544returnenum_seq_inclusive(MVT::FIRST_FIXEDLEN_VECTOR_VALUETYPE,
545 MVT::LAST_FIXEDLEN_VECTOR_VALUETYPE,
546force_iteration_on_noniterable_enum);
547 }
548
549staticautoscalable_vector_valuetypes() {
550returnenum_seq_inclusive(MVT::FIRST_SCALABLE_VECTOR_VALUETYPE,
551 MVT::LAST_SCALABLE_VECTOR_VALUETYPE,
552force_iteration_on_noniterable_enum);
553 }
554
555staticautointeger_fixedlen_vector_valuetypes() {
556returnenum_seq_inclusive(MVT::FIRST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE,
557 MVT::LAST_INTEGER_FIXEDLEN_VECTOR_VALUETYPE,
558force_iteration_on_noniterable_enum);
559 }
560
561staticautofp_fixedlen_vector_valuetypes() {
562returnenum_seq_inclusive(MVT::FIRST_FP_FIXEDLEN_VECTOR_VALUETYPE,
563 MVT::LAST_FP_FIXEDLEN_VECTOR_VALUETYPE,
564force_iteration_on_noniterable_enum);
565 }
566
567staticautointeger_scalable_vector_valuetypes() {
568returnenum_seq_inclusive(MVT::FIRST_INTEGER_SCALABLE_VECTOR_VALUETYPE,
569 MVT::LAST_INTEGER_SCALABLE_VECTOR_VALUETYPE,
570force_iteration_on_noniterable_enum);
571 }
572
573staticautofp_scalable_vector_valuetypes() {
574returnenum_seq_inclusive(MVT::FIRST_FP_SCALABLE_VECTOR_VALUETYPE,
575 MVT::LAST_FP_SCALABLE_VECTOR_VALUETYPE,
576force_iteration_on_noniterable_enum);
577 }
578 /// @}
579 };
580
581inlineraw_ostream &operator<<(raw_ostream &OS,constMVT &VT) {
582 VT.print(OS);
583returnOS;
584 }
585
586}// end namespace llvm
587
588#endif// LLVM_CODEGEN_MACHINEVALUETYPE_H
Type
RelocType Type
Definition:COFFYAML.cpp:410
MathExtras.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OS
raw_pwrite_stream & OS
Definition:SampleProfWriter.cpp:51
Sequence.h
Provides some synthesis utilities to produce sequences of values.
TypeSize.h
llvm::Any
Definition:Any.h:28
llvm::ElementCount
Definition:TypeSize.h:300
llvm::ElementCount::get
static constexpr ElementCount get(ScalarTy MinVal, bool Scalable)
Definition:TypeSize.h:317
llvm::MVT
Machine Value Type.
Definition:MachineValueType.h:35
llvm::MVT::dump
void dump() const
Support for debugging, callable in GDB: VT.dump()
Definition:ValueTypes.cpp:325
llvm::MVT::getFloatingPointVT
static MVT getFloatingPointVT(unsigned BitWidth)
Definition:MachineValueType.h:431
llvm::MVT::isByteSized
bool isByteSized() const
Returns true if the number of bits for the type is a multiple of an 8-bit byte.
Definition:MachineValueType.h:379
llvm::MVT::is128BitVector
bool is128BitVector() const
Return true if this is a 128-bit vector type.
Definition:MachineValueType.h:156
llvm::MVT::knownBitsGT
bool knownBitsGT(MVT VT) const
Return true if we know at compile time this has more bits than VT.
Definition:MachineValueType.h:382
llvm::MVT::SimpleValueType
SimpleValueType
Definition:MachineValueType.h:37
llvm::MVT::VALUETYPE_SIZE
@ VALUETYPE_SIZE
Definition:MachineValueType.h:49
llvm::MVT::INVALID_SIMPLE_VALUE_TYPE
@ INVALID_SIMPLE_VALUE_TYPE
Definition:MachineValueType.h:40
llvm::MVT::integer_fixedlen_vector_valuetypes
static auto integer_fixedlen_vector_valuetypes()
Definition:MachineValueType.h:554
llvm::MVT::getVectorMinNumElements
unsigned getVectorMinNumElements() const
Given a vector type, return the minimum number of elements it contains.
Definition:MachineValueType.h:277
llvm::MVT::isRISCVVectorTuple
bool isRISCVVectorTuple() const
Return true if this is a RISCV vector tuple type where the runtime length is machine dependent.
Definition:MachineValueType.h:120
llvm::MVT::operator>
bool operator>(const MVT &S) const
Definition:MachineValueType.h:60
llvm::MVT::SimpleTy
SimpleValueType SimpleTy
Definition:MachineValueType.h:55
llvm::MVT::isOverloaded
bool isOverloaded() const
Return true if this is an overloaded type for TableGen.
Definition:MachineValueType.h:181
llvm::MVT::isScalableTargetExtVT
bool isScalableTargetExtVT() const
Return true if this is a custom target type that has a scalable size.
Definition:MachineValueType.h:126
llvm::MVT::getScalarSizeInBits
uint64_t getScalarSizeInBits() const
Definition:MachineValueType.h:346
llvm::MVT::changeVectorElementType
MVT changeVectorElementType(MVT EltVT) const
Return a VT for a vector type whose attributes match ourselves with the exception of the element type...
Definition:MachineValueType.h:207
llvm::MVT::operator<=
bool operator<=(const MVT &S) const
Definition:MachineValueType.h:65
llvm::MVT::MVT
constexpr MVT()=default
llvm::MVT::bitsLE
bool bitsLE(MVT VT) const
Return true if this has no more bits than VT.
Definition:MachineValueType.h:425
llvm::MVT::getVectorNumElements
unsigned getVectorNumElements() const
Definition:MachineValueType.h:294
llvm::MVT::knownBitsLT
bool knownBitsLT(MVT VT) const
Return true if we know at compile time this has fewer bits than VT.
Definition:MachineValueType.h:393
llvm::MVT::getRISCVVectorTupleVT
static MVT getRISCVVectorTupleVT(unsigned Sz, unsigned NFields)
Definition:MachineValueType.h:471
llvm::MVT::isVector
bool isVector() const
Return true if this is a vector value type.
Definition:MachineValueType.h:106
llvm::MVT::isInteger
bool isInteger() const
Return true if this is an integer or a vector integer type.
Definition:MachineValueType.h:90
llvm::MVT::isScalableVector
bool isScalableVector() const
Return true if this is a vector value type where the runtime length is machine dependent.
Definition:MachineValueType.h:113
llvm::MVT::getScalableVectorVT
static MVT getScalableVectorVT(MVT VT, unsigned NumElements)
Definition:MachineValueType.h:461
llvm::MVT::is16BitVector
bool is16BitVector() const
Return true if this is a 16-bit vector type.
Definition:MachineValueType.h:141
llvm::MVT::is32BitVector
bool is32BitVector() const
Return true if this is a 32-bit vector type.
Definition:MachineValueType.h:146
llvm::MVT::getRISCVVectorTupleNumFields
unsigned getRISCVVectorTupleNumFields() const
Given a RISC-V vector tuple type, return the num_fields.
Definition:MachineValueType.h:482
llvm::MVT::changeTypeToInteger
MVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type.
Definition:MachineValueType.h:217
llvm::MVT::getVT
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition:ValueTypes.cpp:237
llvm::MVT::isScalableVT
bool isScalableVT() const
Return true if the type is a scalable type.
Definition:MachineValueType.h:131
llvm::MVT::bitsLT
bool bitsLT(MVT VT) const
Return true if this has less bits than VT.
Definition:MachineValueType.h:418
llvm::MVT::all_valuetypes
static auto all_valuetypes()
SimpleValueType Iteration.
Definition:MachineValueType.h:520
llvm::MVT::operator<
bool operator<(const MVT &S) const
Definition:MachineValueType.h:61
llvm::MVT::is512BitVector
bool is512BitVector() const
Return true if this is a 512-bit vector type.
Definition:MachineValueType.h:166
llvm::MVT::operator==
bool operator==(const MVT &S) const
Definition:MachineValueType.h:62
llvm::MVT::integer_valuetypes
static auto integer_valuetypes()
Definition:MachineValueType.h:525
llvm::MVT::is1024BitVector
bool is1024BitVector() const
Return true if this is a 1024-bit vector type.
Definition:MachineValueType.h:171
llvm::MVT::getSizeInBits
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
Definition:MachineValueType.h:308
llvm::MVT::isPow2VectorType
bool isPow2VectorType() const
Returns true if the given vector is a power of 2.
Definition:MachineValueType.h:241
llvm::MVT::getScalarStoreSize
uint64_t getScalarStoreSize() const
Definition:MachineValueType.h:363
llvm::MVT::scalable_vector_valuetypes
static auto scalable_vector_valuetypes()
Definition:MachineValueType.h:548
llvm::MVT::fixedlen_vector_valuetypes
static auto fixedlen_vector_valuetypes()
Definition:MachineValueType.h:542
llvm::MVT::getFixedSizeInBits
uint64_t getFixedSizeInBits() const
Return the size of the specified fixed width value type in bits.
Definition:MachineValueType.h:342
llvm::MVT::getFltSemantics
const fltSemantics & getFltSemantics() const
Returns an APFloat semantics tag appropriate for the value type.
Definition:ValueTypes.cpp:307
llvm::MVT::bitsGT
bool bitsGT(MVT VT) const
Return true if this has more bits than VT.
Definition:MachineValueType.h:404
llvm::MVT::isFixedLengthVector
bool isFixedLengthVector() const
Definition:MachineValueType.h:135
llvm::MVT::vector_valuetypes
static auto vector_valuetypes()
Definition:MachineValueType.h:536
llvm::MVT::is256BitVector
bool is256BitVector() const
Return true if this is a 256-bit vector type.
Definition:MachineValueType.h:161
llvm::MVT::getVectorElementCount
ElementCount getVectorElementCount() const
Definition:MachineValueType.h:290
llvm::MVT::getStoreSize
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
Definition:MachineValueType.h:356
llvm::MVT::bitsGE
bool bitsGE(MVT VT) const
Return true if this has no less bits than VT.
Definition:MachineValueType.h:411
llvm::MVT::isScalarInteger
bool isScalarInteger() const
Return true if this is an integer, not including vectors.
Definition:MachineValueType.h:100
llvm::MVT::getStoreSizeInBits
TypeSize getStoreSizeInBits() const
Return the number of bits overwritten by a store of the specified value type.
Definition:MachineValueType.h:373
llvm::MVT::getVectorVT
static MVT getVectorVT(MVT VT, unsigned NumElements)
Definition:MachineValueType.h:451
llvm::MVT::knownBitsGE
bool knownBitsGE(MVT VT) const
Return true if we know at compile time this has more than or the same bits as VT.
Definition:MachineValueType.h:388
llvm::MVT::fp_scalable_vector_valuetypes
static auto fp_scalable_vector_valuetypes()
Definition:MachineValueType.h:572
llvm::MVT::getVectorElementType
MVT getVectorElementType() const
Definition:MachineValueType.h:263
llvm::MVT::isFloatingPoint
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
Definition:MachineValueType.h:80
llvm::MVT::operator>=
bool operator>=(const MVT &S) const
Definition:MachineValueType.h:64
llvm::MVT::isValid
bool isValid() const
Return true if this is a valid simple valuetype.
Definition:MachineValueType.h:74
llvm::MVT::getIntegerVT
static MVT getIntegerVT(unsigned BitWidth)
Definition:MachineValueType.h:441
llvm::MVT::getDoubleNumVectorElementsVT
MVT getDoubleNumVectorElementsVT() const
Definition:MachineValueType.h:234
llvm::MVT::fp_valuetypes
static auto fp_valuetypes()
Definition:MachineValueType.h:531
llvm::MVT::getHalfNumVectorElementsVT
MVT getHalfNumVectorElementsVT() const
Return a VT for a vector type with the same element type but half the number of elements.
Definition:MachineValueType.h:225
llvm::MVT::knownBitsLE
bool knownBitsLE(MVT VT) const
Return true if we know at compile time this has fewer than or the same bits as VT.
Definition:MachineValueType.h:399
llvm::MVT::operator!=
bool operator!=(const MVT &S) const
Definition:MachineValueType.h:63
llvm::MVT::getScalarType
MVT getScalarType() const
If this is a vector, return the element type, otherwise return this.
Definition:MachineValueType.h:259
llvm::MVT::integer_scalable_vector_valuetypes
static auto integer_scalable_vector_valuetypes()
Definition:MachineValueType.h:566
llvm::MVT::print
void print(raw_ostream &OS) const
Implement operator<<.
Definition:ValueTypes.cpp:331
llvm::MVT::is64BitVector
bool is64BitVector() const
Return true if this is a 64-bit vector type.
Definition:MachineValueType.h:151
llvm::MVT::changeVectorElementTypeToInteger
MVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
Definition:MachineValueType.h:196
llvm::MVT::getPow2VectorType
MVT getPow2VectorType() const
Widens the length of the given vector MVT up to the nearest power of 2 and returns that type.
Definition:MachineValueType.h:248
llvm::MVT::fp_fixedlen_vector_valuetypes
static auto fp_fixedlen_vector_valuetypes()
Definition:MachineValueType.h:560
llvm::MVT::MVT
constexpr MVT(SimpleValueType SVT)
Definition:MachineValueType.h:58
llvm::MVT::is2048BitVector
bool is2048BitVector() const
Return true if this is a 2048-bit vector type.
Definition:MachineValueType.h:176
llvm::Metadata
Root of the metadata hierarchy.
Definition:Metadata.h:62
llvm::TypeSize
Definition:TypeSize.h:334
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition:Type.h:45
llvm::details::FixedOrScalableQuantity::isKnownMultipleOf
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
llvm::details::FixedOrScalableQuantity::getFixedValue
constexpr ScalarTy getFixedValue() const
Definition:TypeSize.h:202
llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownLE
static constexpr bool isKnownLE(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition:TypeSize.h:232
llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownLT
static constexpr bool isKnownLT(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition:TypeSize.h:218
llvm::details::FixedOrScalableQuantity::isScalable
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
Definition:TypeSize.h:171
llvm::details::FixedOrScalableQuantity::getKnownMinValue
constexpr ScalarTy getKnownMinValue() const
Returns the minimum value this quantity can represent.
Definition:TypeSize.h:168
llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownGT
static constexpr bool isKnownGT(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition:TypeSize.h:225
llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownGE
static constexpr bool isKnownGE(const FixedOrScalableQuantity &LHS, const FixedOrScalableQuantity &RHS)
Definition:TypeSize.h:239
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition:raw_ostream.h:52
uint16_t
uint64_t
uint8_t
ErrorHandling.h
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition:ErrorHandling.h:143
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:AddressRanges.h:18
llvm::Log2_32_Ceil
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:354
llvm::enum_seq_inclusive
auto enum_seq_inclusive(EnumT Begin, EnumT End)
Iterate over an enum type from Begin to End inclusive.
Definition:Sequence.h:364
llvm::force_iteration_on_noniterable_enum
constexpr force_iteration_on_noniterable_enum_t force_iteration_on_noniterable_enum
Definition:Sequence.h:108
llvm::reportInvalidSizeRequest
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
llvm::IRMemLocation::Other
@ Other
Any other memory.
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition:APFixedPoint.h:303
llvm::BitWidth
constexpr unsigned BitWidth
Definition:BitmaskEnum.h:217
llvm::fltSemantics
Definition:APFloat.cpp:103

Generated on Thu Jul 17 2025 09:54:30 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp