LLVM  15.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/Support/Compiler.h"
21 #include "llvm/Support/TypeSize.h"
22 #include <cassert>
23 #include <cstdint>
24 #include <string>
25 
26 namespace llvm {
27 
28  class LLVMContext;
29  class Type;
30 
31  /// Extended Value Type. Capable of holding value types which are not native
32  /// for any processor (such as the i12345 type), as well as the types an MVT
33  /// can represent.
34  struct EVT {
35  private:
37  Type *LLVMTy = nullptr;
38 
39  public:
40  constexpr EVT() = default;
41  constexpr EVT(MVT::SimpleValueType SVT) : V(SVT) {}
42  constexpr EVT(MVT S) : V(S) {}
43 
44  bool operator==(EVT VT) const {
45  return !(*this != VT);
46  }
47  bool operator!=(EVT VT) const {
48  if (V.SimpleTy != VT.V.SimpleTy)
49  return true;
51  return LLVMTy != VT.LLVMTy;
52  return false;
53  }
54 
55  /// Returns the EVT that represents a floating-point type with the given
56  /// number of bits. There are two floating-point types with 128 bits - this
57  /// returns f128 rather than ppcf128.
58  static EVT getFloatingPointVT(unsigned BitWidth) {
60  }
61 
62  /// Returns the EVT that represents an integer with the given number of
63  /// bits.
66  if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
67  return M;
68  return getExtendedIntegerVT(Context, BitWidth);
69  }
70 
71  /// Returns the EVT that represents a vector NumElements in length, where
72  /// each element is of type VT.
73  static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements,
74  bool IsScalable = false) {
75  MVT M = MVT::getVectorVT(VT.V, NumElements, IsScalable);
76  if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
77  return M;
78  return getExtendedVectorVT(Context, VT, NumElements, IsScalable);
79  }
80 
81  /// Returns the EVT that represents a vector EC.Min elements in length,
82  /// where each element is of type VT.
84  MVT M = MVT::getVectorVT(VT.V, EC);
85  if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
86  return M;
87  return getExtendedVectorVT(Context, VT, EC);
88  }
89 
90  /// Return a vector with the same number of elements as this vector, but
91  /// with the element type converted to an integer type with the same
92  /// bitwidth.
94  if (isSimple())
96  return changeExtendedVectorElementTypeToInteger();
97  }
98 
99  /// Return a VT for a vector type whose attributes match ourselves
100  /// with the exception of the element type that is chosen by the caller.
102  if (isSimple()) {
103  assert(EltVT.isSimple() &&
104  "Can't change simple vector VT to have extended element VT");
106  }
107  return changeExtendedVectorElementType(EltVT);
108  }
109 
110  /// Return the type converted to an equivalently sized integer or vector
111  /// with integer element type. Similar to changeVectorElementTypeToInteger,
112  /// but also handles scalars.
114  if (isVector())
116 
117  if (isSimple())
118  return getSimpleVT().changeTypeToInteger();
119  return changeExtendedTypeToInteger();
120  }
121 
122  /// Test if the given EVT has zero size, this will fail if called on a
123  /// scalable type
124  bool isZeroSized() const {
125  return !isScalableVector() && getSizeInBits() == 0;
126  }
127 
128  /// Test if the given EVT is simple (as opposed to being extended).
129  bool isSimple() const {
131  }
132 
133  /// Test if the given EVT is extended (as opposed to being simple).
134  bool isExtended() const {
135  return !isSimple();
136  }
137 
138  /// Return true if this is a FP or a vector FP type.
139  bool isFloatingPoint() const {
140  return isSimple() ? V.isFloatingPoint() : isExtendedFloatingPoint();
141  }
142 
143  /// Return true if this is an integer or a vector integer type.
144  bool isInteger() const {
145  return isSimple() ? V.isInteger() : isExtendedInteger();
146  }
147 
148  /// Return true if this is an integer, but not a vector.
149  bool isScalarInteger() const {
150  return isSimple() ? V.isScalarInteger() : isExtendedScalarInteger();
151  }
152 
153  /// Return true if this is a vector value type.
154  bool isVector() const {
155  return isSimple() ? V.isVector() : isExtendedVector();
156  }
157 
158  /// Return true if this is a vector type where the runtime
159  /// length is machine dependent
160  bool isScalableVector() const {
161  return isSimple() ? V.isScalableVector() : isExtendedScalableVector();
162  }
163 
164  bool isFixedLengthVector() const {
165  return isSimple() ? V.isFixedLengthVector()
166  : isExtendedFixedLengthVector();
167  }
168 
169  /// Return true if this is a 16-bit vector type.
170  bool is16BitVector() const {
171  return isSimple() ? V.is16BitVector() : isExtended16BitVector();
172  }
173 
174  /// Return true if this is a 32-bit vector type.
175  bool is32BitVector() const {
176  return isSimple() ? V.is32BitVector() : isExtended32BitVector();
177  }
178 
179  /// Return true if this is a 64-bit vector type.
180  bool is64BitVector() const {
181  return isSimple() ? V.is64BitVector() : isExtended64BitVector();
182  }
183 
184  /// Return true if this is a 128-bit vector type.
185  bool is128BitVector() const {
186  return isSimple() ? V.is128BitVector() : isExtended128BitVector();
187  }
188 
189  /// Return true if this is a 256-bit vector type.
190  bool is256BitVector() const {
191  return isSimple() ? V.is256BitVector() : isExtended256BitVector();
192  }
193 
194  /// Return true if this is a 512-bit vector type.
195  bool is512BitVector() const {
196  return isSimple() ? V.is512BitVector() : isExtended512BitVector();
197  }
198 
199  /// Return true if this is a 1024-bit vector type.
200  bool is1024BitVector() const {
201  return isSimple() ? V.is1024BitVector() : isExtended1024BitVector();
202  }
203 
204  /// Return true if this is a 2048-bit vector type.
205  bool is2048BitVector() const {
206  return isSimple() ? V.is2048BitVector() : isExtended2048BitVector();
207  }
208 
209  /// Return true if this is an overloaded type for TableGen.
210  bool isOverloaded() const {
211  return (V==MVT::iAny || V==MVT::fAny || V==MVT::vAny || V==MVT::iPTRAny);
212  }
213 
214  /// Return true if the bit size is a multiple of 8.
215  bool isByteSized() const {
216  return !isZeroSized() && getSizeInBits().isKnownMultipleOf(8);
217  }
218 
219  /// Return true if the size is a power-of-two number of bytes.
220  bool isRound() const {
221  if (isScalableVector())
222  return false;
223  unsigned BitSize = getSizeInBits();
224  return BitSize >= 8 && !(BitSize & (BitSize - 1));
225  }
226 
227  /// Return true if this has the same number of bits as VT.
228  bool bitsEq(EVT VT) const {
229  if (EVT::operator==(VT)) return true;
230  return getSizeInBits() == VT.getSizeInBits();
231  }
232 
233  /// Return true if we know at compile time this has more bits than VT.
234  bool knownBitsGT(EVT VT) const {
236  }
237 
238  /// Return true if we know at compile time this has more than or the same
239  /// bits as VT.
240  bool knownBitsGE(EVT VT) const {
242  }
243 
244  /// Return true if we know at compile time this has fewer bits than VT.
245  bool knownBitsLT(EVT VT) const {
247  }
248 
249  /// Return true if we know at compile time this has fewer than or the same
250  /// bits as VT.
251  bool knownBitsLE(EVT VT) const {
253  }
254 
255  /// Return true if this has more bits than VT.
256  bool bitsGT(EVT VT) const {
257  if (EVT::operator==(VT)) return false;
259  "Comparison between scalable and fixed types");
260  return knownBitsGT(VT);
261  }
262 
263  /// Return true if this has no less bits than VT.
264  bool bitsGE(EVT VT) const {
265  if (EVT::operator==(VT)) return true;
267  "Comparison between scalable and fixed types");
268  return knownBitsGE(VT);
269  }
270 
271  /// Return true if this has less bits than VT.
272  bool bitsLT(EVT VT) const {
273  if (EVT::operator==(VT)) return false;
275  "Comparison between scalable and fixed types");
276  return knownBitsLT(VT);
277  }
278 
279  /// Return true if this has no more bits than VT.
280  bool bitsLE(EVT VT) const {
281  if (EVT::operator==(VT)) return true;
283  "Comparison between scalable and fixed types");
284  return knownBitsLE(VT);
285  }
286 
287  /// Return the SimpleValueType held in the specified simple EVT.
288  MVT getSimpleVT() const {
289  assert(isSimple() && "Expected a SimpleValueType!");
290  return V;
291  }
292 
293  /// If this is a vector type, return the element type, otherwise return
294  /// this.
295  EVT getScalarType() const {
296  return isVector() ? getVectorElementType() : *this;
297  }
298 
299  /// Given a vector type, return the type of each element.
301  assert(isVector() && "Invalid vector type!");
302  if (isSimple())
303  return V.getVectorElementType();
304  return getExtendedVectorElementType();
305  }
306 
307  /// Given a vector type, return the number of elements it contains.
308  unsigned getVectorNumElements() const {
309  assert(isVector() && "Invalid vector type!");
310 
311  if (isScalableVector())
313  "Possible incorrect use of EVT::getVectorNumElements() for "
314  "scalable vector. Scalable flag may be dropped, use "
315  "EVT::getVectorElementCount() instead");
316 
317  return isSimple() ? V.getVectorNumElements()
318  : getExtendedVectorNumElements();
319  }
320 
321  // Given a (possibly scalable) vector type, return the ElementCount
323  assert((isVector()) && "Invalid vector type!");
324  if (isSimple())
325  return V.getVectorElementCount();
326 
327  return getExtendedVectorElementCount();
328  }
329 
330  /// Given a vector type, return the minimum number of elements it contains.
331  unsigned getVectorMinNumElements() const {
333  }
334 
335  /// Return the size of the specified value type in bits.
336  ///
337  /// If the value type is a scalable vector type, the scalable property will
338  /// be set and the runtime size will be a positive integer multiple of the
339  /// base size.
341  if (isSimple())
342  return V.getSizeInBits();
343  return getExtendedSizeInBits();
344  }
345 
346  /// Return the size of the specified fixed width value type in bits. The
347  /// function will assert if the type is scalable.
349  return getSizeInBits().getFixedSize();
350  }
351 
354  }
355 
356  /// Return the number of bytes overwritten by a store of the specified value
357  /// type.
358  ///
359  /// If the value type is a scalable vector type, the scalable property will
360  /// be set and the runtime size will be a positive integer multiple of the
361  /// base size.
363  TypeSize BaseSize = getSizeInBits();
364  return {(BaseSize.getKnownMinSize() + 7) / 8, BaseSize.isScalable()};
365  }
366 
367  // Return the number of bytes overwritten by a store of this value type or
368  // this value type's element type in the case of a vector.
371  }
372 
373  /// Return the number of bits overwritten by a store of the specified value
374  /// type.
375  ///
376  /// If the value type is a scalable vector type, the scalable property will
377  /// be set and the runtime size will be a positive integer multiple of the
378  /// base size.
380  return getStoreSize() * 8;
381  }
382 
383  /// Rounds the bit-width of the given integer EVT up to the nearest power of
384  /// two (and at least to eight), and returns the integer EVT with that
385  /// number of bits.
387  assert(isInteger() && !isVector() && "Invalid integer type!");
388  unsigned BitWidth = getSizeInBits();
389  if (BitWidth <= 8)
390  return EVT(MVT::i8);
391  return getIntegerVT(Context, 1 << Log2_32_Ceil(BitWidth));
392  }
393 
394  /// Finds the smallest simple value type that is greater than or equal to
395  /// half the width of this EVT. If no simple value type can be found, an
396  /// extended integer value type of half the size (rounded up) is returned.
398  assert(isInteger() && !isVector() && "Invalid integer type!");
399  unsigned EVTSize = getSizeInBits();
400  for (unsigned IntVT = MVT::FIRST_INTEGER_VALUETYPE;
401  IntVT <= MVT::LAST_INTEGER_VALUETYPE; ++IntVT) {
402  EVT HalfVT = EVT((MVT::SimpleValueType)IntVT);
403  if (HalfVT.getSizeInBits() * 2 >= EVTSize)
404  return HalfVT;
405  }
406  return getIntegerVT(Context, (EVTSize + 1) / 2);
407  }
408 
409  /// Return a VT for an integer vector type with the size of the
410  /// elements doubled. The typed returned may be an extended type.
412  EVT EltVT = getVectorElementType();
413  EltVT = EVT::getIntegerVT(Context, 2 * EltVT.getSizeInBits());
415  }
416 
417  // Return a VT for a vector type with the same element type but
418  // half the number of elements. The type returned may be an
419  // extended type.
421  EVT EltVT = getVectorElementType();
422  auto EltCnt = getVectorElementCount();
423  assert(EltCnt.isKnownEven() && "Splitting vector, but not in half!");
424  return EVT::getVectorVT(Context, EltVT, EltCnt.divideCoefficientBy(2));
425  }
426 
427  // Return a VT for a vector type with the same element type but
428  // double the number of elements. The type returned may be an
429  // extended type.
431  EVT EltVT = getVectorElementType();
432  auto EltCnt = getVectorElementCount();
433  return EVT::getVectorVT(Context, EltVT, EltCnt * 2);
434  }
435 
436  /// Returns true if the given vector is a power of 2.
437  bool isPow2VectorType() const {
438  unsigned NElts = getVectorMinNumElements();
439  return !(NElts & (NElts - 1));
440  }
441 
442  /// Widens the length of the given vector EVT up to the nearest power of 2
443  /// and returns that type.
445  if (!isPow2VectorType()) {
447  unsigned NewMinCount = 1 << Log2_32_Ceil(NElts.getKnownMinValue());
448  NElts = ElementCount::get(NewMinCount, NElts.isScalable());
450  }
451  else {
452  return *this;
453  }
454  }
455 
456  /// This function returns value type as a string, e.g. "i32".
457  std::string getEVTString() const;
458 
459  /// This method returns an LLVM type corresponding to the specified EVT.
460  /// For integer types, this returns an unsigned type. Note that this will
461  /// abort for types that cannot be represented.
463 
464  /// Return the value type corresponding to the specified type.
465  /// This returns all pointers as iPTR. If HandleUnknown is true, unknown
466  /// types are returned as Other, otherwise they are invalid.
467  static EVT getEVT(Type *Ty, bool HandleUnknown = false);
468 
470  if (isSimple())
471  return V.SimpleTy;
472  else
473  return (intptr_t)(LLVMTy);
474  }
475 
476  /// A meaningless but well-behaved order, useful for constructing
477  /// containers.
478  struct compareRawBits {
479  bool operator()(EVT L, EVT R) const {
480  if (L.V.SimpleTy == R.V.SimpleTy)
481  return L.LLVMTy < R.LLVMTy;
482  else
483  return L.V.SimpleTy < R.V.SimpleTy;
484  }
485  };
486 
487  private:
488  // Methods for handling the Extended-type case in functions above.
489  // These are all out-of-line to prevent users of this header file
490  // from having a dependency on Type.h.
491  EVT changeExtendedTypeToInteger() const;
492  EVT changeExtendedVectorElementType(EVT EltVT) const;
493  EVT changeExtendedVectorElementTypeToInteger() const;
494  static EVT getExtendedIntegerVT(LLVMContext &C, unsigned BitWidth);
495  static EVT getExtendedVectorVT(LLVMContext &C, EVT VT, unsigned NumElements,
496  bool IsScalable);
497  static EVT getExtendedVectorVT(LLVMContext &Context, EVT VT,
498  ElementCount EC);
499  bool isExtendedFloatingPoint() const LLVM_READONLY;
500  bool isExtendedInteger() const LLVM_READONLY;
501  bool isExtendedScalarInteger() const LLVM_READONLY;
502  bool isExtendedVector() const LLVM_READONLY;
503  bool isExtended16BitVector() const LLVM_READONLY;
504  bool isExtended32BitVector() const LLVM_READONLY;
505  bool isExtended64BitVector() const LLVM_READONLY;
506  bool isExtended128BitVector() const LLVM_READONLY;
507  bool isExtended256BitVector() const LLVM_READONLY;
508  bool isExtended512BitVector() const LLVM_READONLY;
509  bool isExtended1024BitVector() const LLVM_READONLY;
510  bool isExtended2048BitVector() const LLVM_READONLY;
511  bool isExtendedFixedLengthVector() const LLVM_READONLY;
512  bool isExtendedScalableVector() const LLVM_READONLY;
513  EVT getExtendedVectorElementType() const;
514  unsigned getExtendedVectorNumElements() const LLVM_READONLY;
515  ElementCount getExtendedVectorElementCount() const LLVM_READONLY;
516  TypeSize getExtendedSizeInBits() const LLVM_READONLY;
517  };
518 
519 } // end namespace llvm
520 
521 #endif // LLVM_CODEGEN_VALUETYPES_H
llvm::MVT::getVectorElementType
MVT getVectorElementType() const
Definition: MachineValueType.h:519
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:234
llvm::EVT::is32BitVector
bool is32BitVector() const
Return true if this is a 32-bit vector type.
Definition: ValueTypes.h:175
llvm::EVT::operator!=
bool operator!=(EVT VT) const
Definition: ValueTypes.h:47
LLVM_READONLY
#define LLVM_READONLY
Definition: Compiler.h:206
MathExtras.h
llvm::EVT::getScalarStoreSize
uint64_t getScalarStoreSize() const
Definition: ValueTypes.h:369
llvm::EVT::is16BitVector
bool is16BitVector() const
Return true if this is a 16-bit vector type.
Definition: ValueTypes.h:170
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::EVT::isScalarInteger
bool isScalarInteger() const
Return true if this is an integer, but not a vector.
Definition: ValueTypes.h:149
llvm::MVT::isFixedLengthVector
bool isFixedLengthVector() const
Definition: MachineValueType.h:378
llvm::MVT::isInteger
bool isInteger() const
Return true if this is an integer or a vector integer type.
Definition: MachineValueType.h:350
intptr_t
llvm::LinearPolySize< TypeSize >::isKnownGT
static bool isKnownGT(const LinearPolySize &LHS, const LinearPolySize &RHS)
Definition: TypeSize.h:334
llvm::EVT::compareRawBits
A meaningless but well-behaved order, useful for constructing containers.
Definition: ValueTypes.h:478
llvm::EVT::getVectorElementCount
ElementCount getVectorElementCount() const
Definition: ValueTypes.h:322
llvm::ElementCount
Definition: TypeSize.h:390
llvm::EVT::getFixedSizeInBits
uint64_t getFixedSizeInBits() const
Return the size of the specified fixed width value type in bits.
Definition: ValueTypes.h:348
llvm::TypeSize::getFixedSize
ScalarTy getFixedSize() const
Definition: TypeSize.h:430
llvm::MVT::is256BitVector
bool is256BitVector() const
Return true if this is a 256-bit vector type.
Definition: MachineValueType.h:416
TypeSize.h
llvm::LinearPolySize< TypeSize >::isKnownLE
static bool isKnownLE(const LinearPolySize &LHS, const LinearPolySize &RHS)
Definition: TypeSize.h:340
llvm::MVT::isVector
bool isVector() const
Return true if this is a vector value type.
Definition: MachineValueType.h:366
llvm::MVT::fAny
@ fAny
Definition: MachineValueType.h:303
llvm::EVT::isScalableVector
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
Definition: ValueTypes.h:160
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
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:73
llvm::EVT::isOverloaded
bool isOverloaded() const
Return true if this is an overloaded type for TableGen.
Definition: ValueTypes.h:210
llvm::EVT::bitsLE
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
Definition: ValueTypes.h:280
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:124
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:386
llvm::LinearPolySize::isScalable
bool isScalable() const
Returns whether the size is scaled by a runtime quantity (vscale).
Definition: TypeSize.h:298
llvm::EVT::EVT
constexpr EVT(MVT::SimpleValueType SVT)
Definition: ValueTypes.h:41
llvm::MVT::is32BitVector
bool is32BitVector() const
Return true if this is a 32-bit vector type.
Definition: MachineValueType.h:390
llvm::EVT::changeTypeToInteger
EVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type.
Definition: ValueTypes.h:113
llvm::LinearPolySize< TypeSize >::isKnownLT
static bool isKnownLT(const LinearPolySize &LHS, const LinearPolySize &RHS)
Definition: TypeSize.h:328
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:373
llvm::EVT::isSimple
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
Definition: ValueTypes.h:129
llvm::EVT::is256BitVector
bool is256BitVector() const
Return true if this is a 256-bit vector type.
Definition: ValueTypes.h:190
MachineValueType.h
llvm::MVT::SimpleValueType
SimpleValueType
Definition: MachineValueType.h:33
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::EVT::getStoreSize
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
Definition: ValueTypes.h:362
llvm::LinearPolySize< ElementCount >::get
static ElementCount get(ScalarTy MinVal, bool Scalable)
Definition: TypeSize.h:289
llvm::MVT::changeTypeToInteger
MVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type.
Definition: MachineValueType.h:481
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:444
llvm::EVT
Extended Value Type.
Definition: ValueTypes.h:34
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::EVT::is64BitVector
bool is64BitVector() const
Return true if this is a 64-bit vector type.
Definition: ValueTypes.h:180
llvm::EVT::getVectorNumElements
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
Definition: ValueTypes.h:308
llvm::MVT::SimpleTy
SimpleValueType SimpleTy
Definition: MachineValueType.h:321
llvm::EVT::isInteger
bool isInteger() const
Return true if this is an integer or a vector integer type.
Definition: ValueTypes.h:144
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:83
llvm::MVT::INVALID_SIMPLE_VALUE_TYPE
@ INVALID_SIMPLE_VALUE_TYPE
Definition: MachineValueType.h:38
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:101
llvm::EVT::EVT
constexpr EVT(MVT S)
Definition: ValueTypes.h:42
llvm::EVT::EVT
constexpr EVT()=default
llvm::MVT::FIRST_INTEGER_VALUETYPE
@ FIRST_INTEGER_VALUETYPE
Definition: MachineValueType.h:50
llvm::EVT::is1024BitVector
bool is1024BitVector() const
Return true if this is a 1024-bit vector type.
Definition: ValueTypes.h:200
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:93
llvm::EVT::bitsLT
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
Definition: ValueTypes.h:272
llvm::EVT::getTypeForEVT
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
Definition: ValueTypes.cpp:182
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:636
llvm::EVT::isExtended
bool isExtended() const
Test if the given EVT is extended (as opposed to being simple).
Definition: ValueTypes.h:134
llvm::MVT::isFloatingPoint
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
Definition: MachineValueType.h:340
llvm::EVT::getStoreSizeInBits
TypeSize getStoreSizeInBits() const
Return the number of bits overwritten by a store of the specified value type.
Definition: ValueTypes.h:379
llvm::MVT::iPTRAny
@ iPTRAny
Definition: MachineValueType.h:293
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:251
llvm::EVT::getSizeInBits
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
Definition: ValueTypes.h:340
uint64_t
llvm::MVT::is16BitVector
bool is16BitVector() const
Return true if this is a 16-bit vector type.
Definition: MachineValueType.h:384
const
aarch64 promote const
Definition: AArch64PromoteConstant.cpp:232
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::EVT::getEVT
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition: ValueTypes.cpp:561
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:397
llvm::EVT::getVectorMinNumElements
unsigned getVectorMinNumElements() const
Given a vector type, return the minimum number of elements it contains.
Definition: ValueTypes.h:331
TemplateParamKind::Type
@ Type
llvm::EVT::getRawBits
intptr_t getRawBits() const
Definition: ValueTypes.h:469
llvm::MVT::getVectorNumElements
unsigned getVectorNumElements() const
Definition: MachineValueType.h:850
llvm::MVT::i8
@ i8
Definition: MachineValueType.h:44
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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:64
llvm::MVT::getSizeInBits
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
Definition: MachineValueType.h:864
llvm::LinearPolySize< TypeSize >::isKnownGE
static bool isKnownGE(const LinearPolySize &LHS, const LinearPolySize &RHS)
Definition: TypeSize.h:346
llvm::EVT::isByteSized
bool isByteSized() const
Return true if the bit size is a multiple of 8.
Definition: ValueTypes.h:215
llvm::MVT::getFloatingPointVT
static MVT getFloatingPointVT(unsigned BitWidth)
Definition: MachineValueType.h:1151
llvm::MVT
Machine Value Type.
Definition: MachineValueType.h:31
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:411
llvm::LinearPolySize::getKnownMinValue
ScalarTy getKnownMinValue() const
Returns the minimum value this size can represent.
Definition: TypeSize.h:296
llvm::LinearPolySize::isKnownMultipleOf
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:305
llvm::MVT::getVectorVT
static MVT getVectorVT(MVT VT, unsigned NumElements)
Definition: MachineValueType.h:1187
llvm::EVT::isVector
bool isVector() const
Return true if this is a vector value type.
Definition: ValueTypes.h:154
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:460
llvm::EVT::getScalarSizeInBits
uint64_t getScalarSizeInBits() const
Definition: ValueTypes.h:352
llvm::MVT::is2048BitVector
bool is2048BitVector() const
Return true if this is a 2048-bit vector type.
Definition: MachineValueType.h:443
Compiler.h
llvm::MVT::is128BitVector
bool is128BitVector() const
Return true if this is a 128-bit vector type.
Definition: MachineValueType.h:407
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MVT::is64BitVector
bool is64BitVector() const
Return true if this is a 64-bit vector type.
Definition: MachineValueType.h:398
llvm::EVT::operator==
bool operator==(EVT VT) const
Definition: ValueTypes.h:44
llvm::MVT::getVectorElementCount
ElementCount getVectorElementCount() const
Definition: MachineValueType.h:846
llvm::EVT::getEVTString
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
Definition: ValueTypes.cpp:152
llvm::EVT::is2048BitVector
bool is2048BitVector() const
Return true if this is a 2048-bit vector type.
Definition: ValueTypes.h:205
llvm::EVT::getHalfNumVectorElementsVT
EVT getHalfNumVectorElementsVT(LLVMContext &Context) const
Definition: ValueTypes.h:420
llvm::EVT::getScalarType
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
Definition: ValueTypes.h:295
llvm::MVT::iAny
@ iAny
Definition: MachineValueType.h:308
llvm::EVT::compareRawBits::operator()
bool operator()(EVT L, EVT R) const
Definition: ValueTypes.h:479
llvm::TypeSize
Definition: TypeSize.h:421
llvm::BitWidth
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:147
llvm::EVT::is512BitVector
bool is512BitVector() const
Return true if this is a 512-bit vector type.
Definition: ValueTypes.h:195
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:58
llvm::EVT::getVectorElementType
EVT getVectorElementType() const
Given a vector type, return the type of each element.
Definition: ValueTypes.h:300
llvm::MVT::isScalarInteger
bool isScalarInteger() const
Return true if this is an integer, not including vectors.
Definition: MachineValueType.h:360
llvm::EVT::isPow2VectorType
bool isPow2VectorType() const
Returns true if the given vector is a power of 2.
Definition: ValueTypes.h:437
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:471
llvm::TypeSize::getKnownMinSize
ScalarTy getKnownMinSize() const
Definition: TypeSize.h:431
llvm::MVT::is1024BitVector
bool is1024BitVector() const
Return true if this is a 1024-bit vector type.
Definition: MachineValueType.h:434
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:240
llvm::EVT::bitsGT
bool bitsGT(EVT VT) const
Return true if this has more bits than VT.
Definition: ValueTypes.h:256
llvm::EVT::isRound
bool isRound() const
Return true if the size is a power-of-two number of bytes.
Definition: ValueTypes.h:220
llvm::EVT::bitsGE
bool bitsGE(EVT VT) const
Return true if this has no less bits than VT.
Definition: ValueTypes.h:264
llvm::EVT::is128BitVector
bool is128BitVector() const
Return true if this is a 128-bit vector type.
Definition: ValueTypes.h:185
llvm::MVT::LAST_INTEGER_VALUETYPE
@ LAST_INTEGER_VALUETYPE
Definition: MachineValueType.h:51
llvm::MVT::vAny
@ vAny
Definition: MachineValueType.h:298
llvm::EVT::getDoubleNumVectorElementsVT
EVT getDoubleNumVectorElementsVT(LLVMContext &Context) const
Definition: ValueTypes.h:430
llvm::EVT::isFixedLengthVector
bool isFixedLengthVector() const
Definition: ValueTypes.h:164
llvm::EVT::bitsEq
bool bitsEq(EVT VT) const
Return true if this has the same number of bits as VT.
Definition: ValueTypes.h:228
llvm::EVT::isFloatingPoint
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
Definition: ValueTypes.h:139
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:245
llvm::MVT::is512BitVector
bool is512BitVector() const
Return true if this is a 512-bit vector type.
Definition: MachineValueType.h:425
llvm::EVT::getSimpleVT
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
Definition: ValueTypes.h:288
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::MVT::getIntegerVT
static MVT getIntegerVT(unsigned BitWidth)
Definition: MachineValueType.h:1168