Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
ValueTypes.h
Go to the documentation of this file.
1//===- CodeGen/ValueTypes.h - Low-Level Target independ. 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 low-level target independent types which various
10// values in the code generator are. This allows the target specific behavior
11// of instructions to be described to target independent passes.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CODEGEN_VALUETYPES_H
16#define LLVM_CODEGEN_VALUETYPES_H
17
18#include "llvm/CodeGenTypes/MachineValueType.h"
19#include "llvm/Support/Compiler.h"
20#include "llvm/Support/MathExtras.h"
21#include "llvm/Support/TypeSize.h"
22#include <cassert>
23#include <cstdint>
24#include <string>
25
26namespacellvm {
27
28classLLVMContext;
29classType;
30structfltSemantics;
31
32 /// Extended Value Type. Capable of holding value types which are not native
33 /// for any processor (such as the i12345 type), as well as the types an MVT
34 /// can represent.
35structEVT {
36private:
37MVT V =MVT::INVALID_SIMPLE_VALUE_TYPE;
38Type *LLVMTy =nullptr;
39
40public:
41constexprEVT() =default;
42constexprEVT(MVT::SimpleValueType SVT) : V(SVT) {}
43constexprEVT(MVT S) : V(S) {}
44
45booloperator==(EVT VT) const{
46return !(*this != VT);
47 }
48booloperator!=(EVT VT) const{
49if (V.SimpleTy != VT.V.SimpleTy)
50returntrue;
51if (V.SimpleTy ==MVT::INVALID_SIMPLE_VALUE_TYPE)
52return LLVMTy != VT.LLVMTy;
53returnfalse;
54 }
55
56 /// Returns the EVT that represents a floating-point type with the given
57 /// number of bits. There are two floating-point types with 128 bits - this
58 /// returns f128 rather than ppcf128.
59staticEVTgetFloatingPointVT(unsignedBitWidth) {
60returnMVT::getFloatingPointVT(BitWidth);
61 }
62
63 /// Returns the EVT that represents an integer with the given number of
64 /// bits.
65staticEVTgetIntegerVT(LLVMContext &Context,unsignedBitWidth) {
66MVT M =MVT::getIntegerVT(BitWidth);
67if (M.SimpleTy !=MVT::INVALID_SIMPLE_VALUE_TYPE)
68return M;
69return getExtendedIntegerVT(Context,BitWidth);
70 }
71
72 /// Returns the EVT that represents a vector NumElements in length, where
73 /// each element is of type VT.
74staticEVTgetVectorVT(LLVMContext &Context,EVT VT,unsigned NumElements,
75bool IsScalable =false) {
76MVT M =MVT::getVectorVT(VT.V, NumElements, IsScalable);
77if (M.SimpleTy !=MVT::INVALID_SIMPLE_VALUE_TYPE)
78return M;
79return getExtendedVectorVT(Context, VT, NumElements, IsScalable);
80 }
81
82 /// Returns the EVT that represents a vector EC.Min elements in length,
83 /// where each element is of type VT.
84staticEVTgetVectorVT(LLVMContext &Context,EVT VT,ElementCount EC) {
85MVT M =MVT::getVectorVT(VT.V, EC);
86if (M.SimpleTy !=MVT::INVALID_SIMPLE_VALUE_TYPE)
87return M;
88return getExtendedVectorVT(Context, VT, EC);
89 }
90
91 /// Return a vector with the same number of elements as this vector, but
92 /// with the element type converted to an integer type with the same
93 /// bitwidth.
94EVTchangeVectorElementTypeToInteger() const{
95if (isSimple())
96returngetSimpleVT().changeVectorElementTypeToInteger();
97return changeExtendedVectorElementTypeToInteger();
98 }
99
100 /// Return a VT for a vector type whose attributes match ourselves
101 /// with the exception of the element type that is chosen by the caller.
102EVTchangeVectorElementType(EVT EltVT) const{
103if (isSimple()) {
104assert(EltVT.isSimple() &&
105"Can't change simple vector VT to have extended element VT");
106returngetSimpleVT().changeVectorElementType(EltVT.getSimpleVT());
107 }
108return changeExtendedVectorElementType(EltVT);
109 }
110
111 /// Return a VT for a type whose attributes match ourselves with the
112 /// exception of the element type that is chosen by the caller.
113EVTchangeElementType(EVT EltVT) const{
114 EltVT = EltVT.getScalarType();
115returnisVector() ?changeVectorElementType(EltVT) : EltVT;
116 }
117
118 /// Return the type converted to an equivalently sized integer or vector
119 /// with integer element type. Similar to changeVectorElementTypeToInteger,
120 /// but also handles scalars.
121EVTchangeTypeToInteger() const{
122if (isVector())
123returnchangeVectorElementTypeToInteger();
124
125if (isSimple())
126returngetSimpleVT().changeTypeToInteger();
127return changeExtendedTypeToInteger();
128 }
129
130 /// Test if the given EVT has zero size, this will fail if called on a
131 /// scalable type
132boolisZeroSized() const{
133returngetSizeInBits().isZero();
134 }
135
136 /// Test if the given EVT is simple (as opposed to being extended).
137boolisSimple() const{
138return V.SimpleTy !=MVT::INVALID_SIMPLE_VALUE_TYPE;
139 }
140
141 /// Test if the given EVT is extended (as opposed to being simple).
142boolisExtended() const{
143return !isSimple();
144 }
145
146 /// Return true if this is a FP or a vector FP type.
147boolisFloatingPoint() const{
148returnisSimple() ? V.isFloatingPoint() : isExtendedFloatingPoint();
149 }
150
151 /// Return true if this is an integer or a vector integer type.
152boolisInteger() const{
153returnisSimple() ? V.isInteger() : isExtendedInteger();
154 }
155
156 /// Return true if this is an integer, but not a vector.
157boolisScalarInteger() const{
158returnisSimple() ? V.isScalarInteger() : isExtendedScalarInteger();
159 }
160
161 /// Return true if this is a vector type where the runtime
162 /// length is machine dependent
163boolisScalableTargetExtVT() const{
164returnisSimple() && V.isScalableTargetExtVT();
165 }
166
167 /// Return true if this is a vector value type.
168boolisVector() const{
169returnisSimple() ? V.isVector() : isExtendedVector();
170 }
171
172 /// Return true if this is a vector type where the runtime
173 /// length is machine dependent
174boolisScalableVector() const{
175returnisSimple() ? V.isScalableVector() : isExtendedScalableVector();
176 }
177
178 /// Return true if this is a vector value type.
179boolisRISCVVectorTuple() const{return V.isRISCVVectorTuple(); }
180
181boolisFixedLengthVector() const{
182returnisSimple() ? V.isFixedLengthVector()
183 : isExtendedFixedLengthVector();
184 }
185
186 /// Return true if the type is a scalable type.
187boolisScalableVT() const{
188returnisScalableVector() ||isScalableTargetExtVT();
189 }
190
191 /// Return true if this is a 16-bit vector type.
192boolis16BitVector() const{
193returnisSimple() ? V.is16BitVector() : isExtended16BitVector();
194 }
195
196 /// Return true if this is a 32-bit vector type.
197boolis32BitVector() const{
198returnisSimple() ? V.is32BitVector() : isExtended32BitVector();
199 }
200
201 /// Return true if this is a 64-bit vector type.
202boolis64BitVector() const{
203returnisSimple() ? V.is64BitVector() : isExtended64BitVector();
204 }
205
206 /// Return true if this is a 128-bit vector type.
207boolis128BitVector() const{
208returnisSimple() ? V.is128BitVector() : isExtended128BitVector();
209 }
210
211 /// Return true if this is a 256-bit vector type.
212boolis256BitVector() const{
213returnisSimple() ? V.is256BitVector() : isExtended256BitVector();
214 }
215
216 /// Return true if this is a 512-bit vector type.
217boolis512BitVector() const{
218returnisSimple() ? V.is512BitVector() : isExtended512BitVector();
219 }
220
221 /// Return true if this is a 1024-bit vector type.
222boolis1024BitVector() const{
223returnisSimple() ? V.is1024BitVector() : isExtended1024BitVector();
224 }
225
226 /// Return true if this is a 2048-bit vector type.
227boolis2048BitVector() const{
228returnisSimple() ? V.is2048BitVector() : isExtended2048BitVector();
229 }
230
231 /// Return true if this is an overloaded type for TableGen.
232boolisOverloaded() const{
233return (V == MVT::iAny || V == MVT::fAny || V == MVT::vAny ||
234 V == MVT::pAny);
235 }
236
237 /// Return true if the bit size is a multiple of 8.
238boolisByteSized() const{
239return !isZeroSized() &&getSizeInBits().isKnownMultipleOf(8);
240 }
241
242 /// Return true if the size is a power-of-two number of bytes.
243boolisRound() const{
244if (isScalableVector())
245returnfalse;
246unsigned BitSize =getSizeInBits();
247return BitSize >= 8 && !(BitSize & (BitSize - 1));
248 }
249
250 /// Return true if this has the same number of bits as VT.
251boolbitsEq(EVT VT) const{
252if (EVT::operator==(VT))returntrue;
253returngetSizeInBits() == VT.getSizeInBits();
254 }
255
256 /// Return true if we know at compile time this has more bits than VT.
257boolknownBitsGT(EVT VT) const{
258returnTypeSize::isKnownGT(getSizeInBits(), VT.getSizeInBits());
259 }
260
261 /// Return true if we know at compile time this has more than or the same
262 /// bits as VT.
263boolknownBitsGE(EVT VT) const{
264returnTypeSize::isKnownGE(getSizeInBits(), VT.getSizeInBits());
265 }
266
267 /// Return true if we know at compile time this has fewer bits than VT.
268boolknownBitsLT(EVT VT) const{
269returnTypeSize::isKnownLT(getSizeInBits(), VT.getSizeInBits());
270 }
271
272 /// Return true if we know at compile time this has fewer than or the same
273 /// bits as VT.
274boolknownBitsLE(EVT VT) const{
275returnTypeSize::isKnownLE(getSizeInBits(), VT.getSizeInBits());
276 }
277
278 /// Return true if this has more bits than VT.
279boolbitsGT(EVT VT) const{
280if (EVT::operator==(VT))returnfalse;
281assert(isScalableVector() == VT.isScalableVector() &&
282"Comparison between scalable and fixed types");
283returnknownBitsGT(VT);
284 }
285
286 /// Return true if this has no less bits than VT.
287boolbitsGE(EVT VT) const{
288if (EVT::operator==(VT))returntrue;
289assert(isScalableVector() == VT.isScalableVector() &&
290"Comparison between scalable and fixed types");
291returnknownBitsGE(VT);
292 }
293
294 /// Return true if this has less bits than VT.
295boolbitsLT(EVT VT) const{
296if (EVT::operator==(VT))returnfalse;
297assert(isScalableVector() == VT.isScalableVector() &&
298"Comparison between scalable and fixed types");
299returnknownBitsLT(VT);
300 }
301
302 /// Return true if this has no more bits than VT.
303boolbitsLE(EVT VT) const{
304if (EVT::operator==(VT))returntrue;
305assert(isScalableVector() == VT.isScalableVector() &&
306"Comparison between scalable and fixed types");
307returnknownBitsLE(VT);
308 }
309
310 /// Return the SimpleValueType held in the specified simple EVT.
311MVTgetSimpleVT() const{
312assert(isSimple() &&"Expected a SimpleValueType!");
313return V;
314 }
315
316 /// If this is a vector type, return the element type, otherwise return
317 /// this.
318EVTgetScalarType() const{
319returnisVector() ?getVectorElementType() : *this;
320 }
321
322 /// Given a vector type, return the type of each element.
323EVTgetVectorElementType() const{
324assert(isVector() &&"Invalid vector type!");
325if (isSimple())
326return V.getVectorElementType();
327return getExtendedVectorElementType();
328 }
329
330 /// Given a vector type, return the number of elements it contains.
331unsignedgetVectorNumElements() const{
332assert(isVector() &&"Invalid vector type!");
333
334if (isScalableVector())
335llvm::reportInvalidSizeRequest(
336"Possible incorrect use of EVT::getVectorNumElements() for "
337"scalable vector. Scalable flag may be dropped, use "
338"EVT::getVectorElementCount() instead");
339
340returnisSimple() ? V.getVectorNumElements()
341 : getExtendedVectorNumElements();
342 }
343
344// Given a (possibly scalable) vector type, return the ElementCount
345ElementCountgetVectorElementCount() const{
346assert((isVector()) &&"Invalid vector type!");
347if (isSimple())
348return V.getVectorElementCount();
349
350return getExtendedVectorElementCount();
351 }
352
353 /// Given a vector type, return the minimum number of elements it contains.
354unsignedgetVectorMinNumElements() const{
355returngetVectorElementCount().getKnownMinValue();
356 }
357
358 /// Given a RISCV vector tuple type, return the num_fields.
359unsignedgetRISCVVectorTupleNumFields() const{
360return V.getRISCVVectorTupleNumFields();
361 }
362
363 /// Return the size of the specified value type in bits.
364 ///
365 /// If the value type is a scalable vector type, the scalable property will
366 /// be set and the runtime size will be a positive integer multiple of the
367 /// base size.
368TypeSizegetSizeInBits() const{
369if (isSimple())
370return V.getSizeInBits();
371return getExtendedSizeInBits();
372 }
373
374 /// Return the size of the specified fixed width value type in bits. The
375 /// function will assert if the type is scalable.
376uint64_tgetFixedSizeInBits() const{
377returngetSizeInBits().getFixedValue();
378 }
379
380uint64_tgetScalarSizeInBits() const{
381returngetScalarType().getSizeInBits().getFixedValue();
382 }
383
384 /// Return the number of bytes overwritten by a store of the specified value
385 /// type.
386 ///
387 /// If the value type is a scalable vector type, the scalable property will
388 /// be set and the runtime size will be a positive integer multiple of the
389 /// base size.
390TypeSizegetStoreSize() const{
391TypeSize BaseSize =getSizeInBits();
392return {(BaseSize.getKnownMinValue() + 7) / 8, BaseSize.isScalable()};
393 }
394
395// Return the number of bytes overwritten by a store of this value type or
396// this value type's element type in the case of a vector.
397uint64_tgetScalarStoreSize() const{
398returngetScalarType().getStoreSize().getFixedValue();
399 }
400
401 /// Return the number of bits overwritten by a store of the specified value
402 /// type.
403 ///
404 /// If the value type is a scalable vector type, the scalable property will
405 /// be set and the runtime size will be a positive integer multiple of the
406 /// base size.
407TypeSizegetStoreSizeInBits() const{
408returngetStoreSize() * 8;
409 }
410
411 /// Rounds the bit-width of the given integer EVT up to the nearest power of
412 /// two (and at least to eight), and returns the integer EVT with that
413 /// number of bits.
414EVTgetRoundIntegerType(LLVMContext &Context) const{
415assert(isInteger() && !isVector() &&"Invalid integer type!");
416unsignedBitWidth =getSizeInBits();
417if (BitWidth <= 8)
418returnEVT(MVT::i8);
419returngetIntegerVT(Context,llvm::bit_ceil(BitWidth));
420 }
421
422 /// Finds the smallest simple value type that is greater than or equal to
423 /// half the width of this EVT. If no simple value type can be found, an
424 /// extended integer value type of half the size (rounded up) is returned.
425EVTgetHalfSizedIntegerVT(LLVMContext &Context) const{
426assert(isInteger() && !isVector() &&"Invalid integer type!");
427unsigned EVTSize =getSizeInBits();
428for (unsigned IntVT = MVT::FIRST_INTEGER_VALUETYPE;
429 IntVT <= MVT::LAST_INTEGER_VALUETYPE; ++IntVT) {
430EVT HalfVT =EVT((MVT::SimpleValueType)IntVT);
431if (HalfVT.getSizeInBits() * 2 >= EVTSize)
432return HalfVT;
433 }
434returngetIntegerVT(Context, (EVTSize + 1) / 2);
435 }
436
437 /// Return a VT for an integer vector type with the size of the
438 /// elements doubled. The typed returned may be an extended type.
439EVTwidenIntegerVectorElementType(LLVMContext &Context) const{
440EVT EltVT =getVectorElementType();
441 EltVT =EVT::getIntegerVT(Context, 2 * EltVT.getSizeInBits());
442returnEVT::getVectorVT(Context, EltVT,getVectorElementCount());
443 }
444
445// Return a VT for a vector type with the same element type but
446// half the number of elements. The type returned may be an
447// extended type.
448EVTgetHalfNumVectorElementsVT(LLVMContext &Context) const{
449EVT EltVT =getVectorElementType();
450auto EltCnt =getVectorElementCount();
451assert(EltCnt.isKnownEven() &&"Splitting vector, but not in half!");
452returnEVT::getVectorVT(Context, EltVT, EltCnt.divideCoefficientBy(2));
453 }
454
455// Return a VT for a vector type with the same element type but
456// double the number of elements. The type returned may be an
457// extended type.
458EVTgetDoubleNumVectorElementsVT(LLVMContext &Context) const{
459EVT EltVT =getVectorElementType();
460auto EltCnt =getVectorElementCount();
461returnEVT::getVectorVT(Context, EltVT, EltCnt * 2);
462 }
463
464 /// Returns true if the given vector is a power of 2.
465boolisPow2VectorType() const{
466unsigned NElts =getVectorMinNumElements();
467return !(NElts & (NElts - 1));
468 }
469
470 /// Widens the length of the given vector EVT up to the nearest power of 2
471 /// and returns that type.
472EVTgetPow2VectorType(LLVMContext &Context) const{
473if (!isPow2VectorType()) {
474ElementCount NElts =getVectorElementCount();
475unsigned NewMinCount = 1 <<Log2_32_Ceil(NElts.getKnownMinValue());
476 NElts =ElementCount::get(NewMinCount, NElts.isScalable());
477returnEVT::getVectorVT(Context,getVectorElementType(), NElts);
478 }
479else {
480return *this;
481 }
482 }
483
484 /// This function returns value type as a string, e.g. "i32".
485 std::stringgetEVTString()const;
486
487 /// Support for debugging, callable in GDB: VT.dump()
488voiddump()const;
489
490 /// Implement operator<<.
491voidprint(raw_ostream &OS) const{
492OS <<getEVTString();
493 }
494
495 /// This method returns an LLVM type corresponding to the specified EVT.
496 /// For integer types, this returns an unsigned type. Note that this will
497 /// abort for types that cannot be represented.
498Type *getTypeForEVT(LLVMContext &Context)const;
499
500 /// Return the value type corresponding to the specified type.
501 /// If HandleUnknown is true, unknown types are returned as Other,
502 /// otherwise they are invalid.
503 /// NB: This includes pointer types, which require a DataLayout to convert
504 /// to a concrete value type.
505staticEVTgetEVT(Type *Ty,bool HandleUnknown =false);
506
507 intptr_tgetRawBits() const{
508if (isSimple())
509return V.SimpleTy;
510else
511return (intptr_t)(LLVMTy);
512 }
513
514 /// A meaningless but well-behaved order, useful for constructing
515 /// containers.
516structcompareRawBits {
517booloperator()(EVT L,EVT R) const{
518if (L.V.SimpleTy == R.V.SimpleTy)
519return L.LLVMTy < R.LLVMTy;
520else
521return L.V.SimpleTy < R.V.SimpleTy;
522 }
523 };
524
525 /// Returns an APFloat semantics tag appropriate for the value type. If this
526 /// is a vector type, the element semantics are returned.
527constfltSemantics &getFltSemantics()const;
528
529private:
530// Methods for handling the Extended-type case in functions above.
531// These are all out-of-line to prevent users of this header file
532// from having a dependency on Type.h.
533EVT changeExtendedTypeToInteger()const;
534EVT changeExtendedVectorElementType(EVT EltVT)const;
535EVT changeExtendedVectorElementTypeToInteger()const;
536staticEVT getExtendedIntegerVT(LLVMContext &C,unsignedBitWidth);
537staticEVT getExtendedVectorVT(LLVMContext &C,EVT VT,unsigned NumElements,
538bool IsScalable);
539staticEVT getExtendedVectorVT(LLVMContext &Context,EVT VT,
540ElementCount EC);
541bool isExtendedFloatingPoint()constLLVM_READONLY;
542bool isExtendedInteger()constLLVM_READONLY;
543bool isExtendedScalarInteger()constLLVM_READONLY;
544bool isExtendedVector()constLLVM_READONLY;
545bool isExtended16BitVector()constLLVM_READONLY;
546bool isExtended32BitVector()constLLVM_READONLY;
547bool isExtended64BitVector()constLLVM_READONLY;
548bool isExtended128BitVector()constLLVM_READONLY;
549bool isExtended256BitVector()constLLVM_READONLY;
550bool isExtended512BitVector()constLLVM_READONLY;
551bool isExtended1024BitVector()constLLVM_READONLY;
552bool isExtended2048BitVector()constLLVM_READONLY;
553bool isExtendedFixedLengthVector()constLLVM_READONLY;
554bool isExtendedScalableVector()constLLVM_READONLY;
555EVT getExtendedVectorElementType()const;
556unsigned getExtendedVectorNumElements()constLLVM_READONLY;
557ElementCount getExtendedVectorElementCount()constLLVM_READONLY;
558TypeSize getExtendedSizeInBits()constLLVM_READONLY;
559 };
560
561inlineraw_ostream &operator<<(raw_ostream &OS,constEVT &V) {
562 V.print(OS);
563returnOS;
564 }
565}// end namespace llvm
566
567#endif// LLVM_CODEGEN_VALUETYPES_H
const
aarch64 promote const
Definition:AArch64PromoteConstant.cpp:230
inline
always inline
Definition:AlwaysInliner.cpp:161
Type
RelocType Type
Definition:COFFYAML.cpp:410
Compiler.h
LLVM_READONLY
#define LLVM_READONLY
Definition:Compiler.h:306
MachineValueType.h
MathExtras.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OS
raw_pwrite_stream & OS
Definition:SampleProfWriter.cpp:51
TypeSize.h
llvm::ElementCount
Definition:TypeSize.h:300
llvm::ElementCount::get
static constexpr ElementCount get(ScalarTy MinVal, bool Scalable)
Definition:TypeSize.h:317
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition:LLVMContext.h:67
llvm::MVT
Machine Value Type.
Definition:MachineValueType.h:35
llvm::MVT::getFloatingPointVT
static MVT getFloatingPointVT(unsigned BitWidth)
Definition:MachineValueType.h:431
llvm::MVT::SimpleValueType
SimpleValueType
Definition:MachineValueType.h:37
llvm::MVT::INVALID_SIMPLE_VALUE_TYPE
@ INVALID_SIMPLE_VALUE_TYPE
Definition:MachineValueType.h:40
llvm::MVT::SimpleTy
SimpleValueType SimpleTy
Definition:MachineValueType.h:55
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::changeTypeToInteger
MVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type.
Definition:MachineValueType.h:217
llvm::MVT::getVectorVT
static MVT getVectorVT(MVT VT, unsigned NumElements)
Definition:MachineValueType.h:451
llvm::MVT::getIntegerVT
static MVT getIntegerVT(unsigned BitWidth)
Definition:MachineValueType.h:441
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::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::isZero
constexpr bool isZero() const
Definition:TypeSize.h:156
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
uint64_t
llvm::CallingConv::C
@ C
The default llvm calling convention, compatible with C.
Definition:CallingConv.h:34
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::bit_ceil
T bit_ceil(T Value)
Returns the smallest integral power of two no smaller than Value if Value is nonzero.
Definition:bit.h:342
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::BitWidth
constexpr unsigned BitWidth
Definition:BitmaskEnum.h:217
llvm::EVT::compareRawBits
A meaningless but well-behaved order, useful for constructing containers.
Definition:ValueTypes.h:516
llvm::EVT::compareRawBits::operator()
bool operator()(EVT L, EVT R) const
Definition:ValueTypes.h:517
llvm::EVT
Extended Value Type.
Definition:ValueTypes.h:35
llvm::EVT::changeVectorElementTypeToInteger
EVT changeVectorElementTypeToInteger() const
Return a vector with the same number of elements as this vector, but with the element type converted ...
Definition:ValueTypes.h:94
llvm::EVT::EVT
constexpr EVT()=default
llvm::EVT::getStoreSize
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
Definition:ValueTypes.h:390
llvm::EVT::getPow2VectorType
EVT getPow2VectorType(LLVMContext &Context) const
Widens the length of the given vector EVT up to the nearest power of 2 and returns that type.
Definition:ValueTypes.h:472
llvm::EVT::isSimple
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
Definition:ValueTypes.h:137
llvm::EVT::EVT
constexpr EVT(MVT::SimpleValueType SVT)
Definition:ValueTypes.h:42
llvm::EVT::getRawBits
intptr_t getRawBits() const
Definition:ValueTypes.h:507
llvm::EVT::knownBitsLE
bool knownBitsLE(EVT VT) const
Return true if we know at compile time this has fewer than or the same bits as VT.
Definition:ValueTypes.h:274
llvm::EVT::getVectorVT
static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements, bool IsScalable=false)
Returns the EVT that represents a vector NumElements in length, where each element is of type VT.
Definition:ValueTypes.h:74
llvm::EVT::changeTypeToInteger
EVT changeTypeToInteger() const
Return the type converted to an equivalently sized integer or vector with integer element type.
Definition:ValueTypes.h:121
llvm::EVT::getScalarStoreSize
uint64_t getScalarStoreSize() const
Definition:ValueTypes.h:397
llvm::EVT::isOverloaded
bool isOverloaded() const
Return true if this is an overloaded type for TableGen.
Definition:ValueTypes.h:232
llvm::EVT::bitsGT
bool bitsGT(EVT VT) const
Return true if this has more bits than VT.
Definition:ValueTypes.h:279
llvm::EVT::bitsLT
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
Definition:ValueTypes.h:295
llvm::EVT::isFloatingPoint
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
Definition:ValueTypes.h:147
llvm::EVT::getVectorElementCount
ElementCount getVectorElementCount() const
Definition:ValueTypes.h:345
llvm::EVT::getDoubleNumVectorElementsVT
EVT getDoubleNumVectorElementsVT(LLVMContext &Context) const
Definition:ValueTypes.h:458
llvm::EVT::is32BitVector
bool is32BitVector() const
Return true if this is a 32-bit vector type.
Definition:ValueTypes.h:197
llvm::EVT::getSizeInBits
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
Definition:ValueTypes.h:368
llvm::EVT::isByteSized
bool isByteSized() const
Return true if the bit size is a multiple of 8.
Definition:ValueTypes.h:238
llvm::EVT::changeElementType
EVT changeElementType(EVT EltVT) const
Return a VT for a type whose attributes match ourselves with the exception of the element type that i...
Definition:ValueTypes.h:113
llvm::EVT::is1024BitVector
bool is1024BitVector() const
Return true if this is a 1024-bit vector type.
Definition:ValueTypes.h:222
llvm::EVT::knownBitsGT
bool knownBitsGT(EVT VT) const
Return true if we know at compile time this has more bits than VT.
Definition:ValueTypes.h:257
llvm::EVT::getVectorMinNumElements
unsigned getVectorMinNumElements() const
Given a vector type, return the minimum number of elements it contains.
Definition:ValueTypes.h:354
llvm::EVT::getRISCVVectorTupleNumFields
unsigned getRISCVVectorTupleNumFields() const
Given a RISCV vector tuple type, return the num_fields.
Definition:ValueTypes.h:359
llvm::EVT::getScalarSizeInBits
uint64_t getScalarSizeInBits() const
Definition:ValueTypes.h:380
llvm::EVT::getHalfSizedIntegerVT
EVT getHalfSizedIntegerVT(LLVMContext &Context) const
Finds the smallest simple value type that is greater than or equal to half the width of this EVT.
Definition:ValueTypes.h:425
llvm::EVT::isPow2VectorType
bool isPow2VectorType() const
Returns true if the given vector is a power of 2.
Definition:ValueTypes.h:465
llvm::EVT::getEVT
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition:ValueTypes.cpp:289
llvm::EVT::getStoreSizeInBits
TypeSize getStoreSizeInBits() const
Return the number of bits overwritten by a store of the specified value type.
Definition:ValueTypes.h:407
llvm::EVT::getSimpleVT
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
Definition:ValueTypes.h:311
llvm::EVT::dump
void dump() const
Support for debugging, callable in GDB: VT.dump()
Definition:ValueTypes.cpp:201
llvm::EVT::EVT
constexpr EVT(MVT S)
Definition:ValueTypes.h:43
llvm::EVT::is128BitVector
bool is128BitVector() const
Return true if this is a 128-bit vector type.
Definition:ValueTypes.h:207
llvm::EVT::getIntegerVT
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
Returns the EVT that represents an integer with the given number of bits.
Definition:ValueTypes.h:65
llvm::EVT::is2048BitVector
bool is2048BitVector() const
Return true if this is a 2048-bit vector type.
Definition:ValueTypes.h:227
llvm::EVT::isRISCVVectorTuple
bool isRISCVVectorTuple() const
Return true if this is a vector value type.
Definition:ValueTypes.h:179
llvm::EVT::getFixedSizeInBits
uint64_t getFixedSizeInBits() const
Return the size of the specified fixed width value type in bits.
Definition:ValueTypes.h:376
llvm::EVT::widenIntegerVectorElementType
EVT widenIntegerVectorElementType(LLVMContext &Context) const
Return a VT for an integer vector type with the size of the elements doubled.
Definition:ValueTypes.h:439
llvm::EVT::knownBitsLT
bool knownBitsLT(EVT VT) const
Return true if we know at compile time this has fewer bits than VT.
Definition:ValueTypes.h:268
llvm::EVT::isScalableVT
bool isScalableVT() const
Return true if the type is a scalable type.
Definition:ValueTypes.h:187
llvm::EVT::is512BitVector
bool is512BitVector() const
Return true if this is a 512-bit vector type.
Definition:ValueTypes.h:217
llvm::EVT::isFixedLengthVector
bool isFixedLengthVector() const
Definition:ValueTypes.h:181
llvm::EVT::getEVTString
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
Definition:ValueTypes.cpp:162
llvm::EVT::getFloatingPointVT
static EVT getFloatingPointVT(unsigned BitWidth)
Returns the EVT that represents a floating-point type with the given number of bits.
Definition:ValueTypes.h:59
llvm::EVT::operator!=
bool operator!=(EVT VT) const
Definition:ValueTypes.h:48
llvm::EVT::getRoundIntegerType
EVT getRoundIntegerType(LLVMContext &Context) const
Rounds the bit-width of the given integer EVT up to the nearest power of two (and at least to eight),...
Definition:ValueTypes.h:414
llvm::EVT::isVector
bool isVector() const
Return true if this is a vector value type.
Definition:ValueTypes.h:168
llvm::EVT::getScalarType
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
Definition:ValueTypes.h:318
llvm::EVT::is16BitVector
bool is16BitVector() const
Return true if this is a 16-bit vector type.
Definition:ValueTypes.h:192
llvm::EVT::bitsGE
bool bitsGE(EVT VT) const
Return true if this has no less bits than VT.
Definition:ValueTypes.h:287
llvm::EVT::is256BitVector
bool is256BitVector() const
Return true if this is a 256-bit vector type.
Definition:ValueTypes.h:212
llvm::EVT::bitsEq
bool bitsEq(EVT VT) const
Return true if this has the same number of bits as VT.
Definition:ValueTypes.h:251
llvm::EVT::getTypeForEVT
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
Definition:ValueTypes.cpp:210
llvm::EVT::isRound
bool isRound() const
Return true if the size is a power-of-two number of bytes.
Definition:ValueTypes.h:243
llvm::EVT::getVectorVT
static EVT getVectorVT(LLVMContext &Context, EVT VT, ElementCount EC)
Returns the EVT that represents a vector EC.Min elements in length, where each element is of type VT.
Definition:ValueTypes.h:84
llvm::EVT::isScalableVector
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
Definition:ValueTypes.h:174
llvm::EVT::knownBitsGE
bool knownBitsGE(EVT VT) const
Return true if we know at compile time this has more than or the same bits as VT.
Definition:ValueTypes.h:263
llvm::EVT::getVectorElementType
EVT getVectorElementType() const
Given a vector type, return the type of each element.
Definition:ValueTypes.h:323
llvm::EVT::isExtended
bool isExtended() const
Test if the given EVT is extended (as opposed to being simple).
Definition:ValueTypes.h:142
llvm::EVT::print
void print(raw_ostream &OS) const
Implement operator<<.
Definition:ValueTypes.h:491
llvm::EVT::isScalableTargetExtVT
bool isScalableTargetExtVT() const
Return true if this is a vector type where the runtime length is machine dependent.
Definition:ValueTypes.h:163
llvm::EVT::isScalarInteger
bool isScalarInteger() const
Return true if this is an integer, but not a vector.
Definition:ValueTypes.h:157
llvm::EVT::changeVectorElementType
EVT changeVectorElementType(EVT EltVT) const
Return a VT for a vector type whose attributes match ourselves with the exception of the element type...
Definition:ValueTypes.h:102
llvm::EVT::getFltSemantics
const fltSemantics & getFltSemantics() const
Returns an APFloat semantics tag appropriate for the value type.
Definition:ValueTypes.cpp:320
llvm::EVT::getVectorNumElements
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
Definition:ValueTypes.h:331
llvm::EVT::operator==
bool operator==(EVT VT) const
Definition:ValueTypes.h:45
llvm::EVT::isZeroSized
bool isZeroSized() const
Test if the given EVT has zero size, this will fail if called on a scalable type.
Definition:ValueTypes.h:132
llvm::EVT::bitsLE
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
Definition:ValueTypes.h:303
llvm::EVT::getHalfNumVectorElementsVT
EVT getHalfNumVectorElementsVT(LLVMContext &Context) const
Definition:ValueTypes.h:448
llvm::EVT::isInteger
bool isInteger() const
Return true if this is an integer or a vector integer type.
Definition:ValueTypes.h:152
llvm::EVT::is64BitVector
bool is64BitVector() const
Return true if this is a 64-bit vector type.
Definition:ValueTypes.h:202
llvm::fltSemantics
Definition:APFloat.cpp:103

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

©2009-2025 Movatter.jp