LLVM  13.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 "llvm/Support/WithColor.h"
23 #include <cassert>
24 #include <cstdint>
25 #include <string>
26 
27 namespace llvm {
28 
29  class LLVMContext;
30  class Type;
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.
35  struct EVT {
36  private:
38  Type *LLVMTy = nullptr;
39 
40  public:
41  constexpr EVT() = default;
42  constexpr EVT(MVT::SimpleValueType SVT) : V(SVT) {}
43  constexpr EVT(MVT S) : V(S) {}
44 
45  bool operator==(EVT VT) const {
46  return !(*this != VT);
47  }
48  bool operator!=(EVT VT) const {
49  if (V.SimpleTy != VT.V.SimpleTy)
50  return true;
52  return LLVMTy != VT.LLVMTy;
53  return false;
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.
59  static EVT getFloatingPointVT(unsigned BitWidth) {
61  }
62 
63  /// Returns the EVT that represents an integer with the given number of
64  /// bits.
67  if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
68  return M;
69  return getExtendedIntegerVT(Context, BitWidth);
70  }
71 
72  /// Returns the EVT that represents a vector NumElements in length, where
73  /// each element is of type VT.
74  static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements,
75  bool IsScalable = false) {
76  MVT M = MVT::getVectorVT(VT.V, NumElements, IsScalable);
77  if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
78  return M;
79  return 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.
85  MVT M = MVT::getVectorVT(VT.V, EC);
86  if (M.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE)
87  return M;
88  return 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.
95  if (isSimple())
97  return 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.
103  if (isSimple()) {
104  assert(EltVT.isSimple() &&
105  "Can't change simple vector VT to have extended element VT");
107  }
108  return changeExtendedVectorElementType(EltVT);
109  }
110 
111  /// Return the type converted to an equivalently sized integer or vector
112  /// with integer element type. Similar to changeVectorElementTypeToInteger,
113  /// but also handles scalars.
115  if (isVector())
117 
118  if (isSimple())
119  return getSimpleVT().changeTypeToInteger();
120  return changeExtendedTypeToInteger();
121  }
122 
123  /// Test if the given EVT is simple (as opposed to being extended).
124  bool isSimple() const {
126  }
127 
128  /// Test if the given EVT is extended (as opposed to being simple).
129  bool isExtended() const {
130  return !isSimple();
131  }
132 
133  /// Return true if this is a FP or a vector FP type.
134  bool isFloatingPoint() const {
135  return isSimple() ? V.isFloatingPoint() : isExtendedFloatingPoint();
136  }
137 
138  /// Return true if this is an integer or a vector integer type.
139  bool isInteger() const {
140  return isSimple() ? V.isInteger() : isExtendedInteger();
141  }
142 
143  /// Return true if this is an integer, but not a vector.
144  bool isScalarInteger() const {
145  return isSimple() ? V.isScalarInteger() : isExtendedScalarInteger();
146  }
147 
148  /// Return true if this is a vector value type.
149  bool isVector() const {
150  return isSimple() ? V.isVector() : isExtendedVector();
151  }
152 
153  /// Return true if this is a vector type where the runtime
154  /// length is machine dependent
155  bool isScalableVector() const {
156  return isSimple() ? V.isScalableVector() : isExtendedScalableVector();
157  }
158 
159  bool isFixedLengthVector() const {
160  return isSimple() ? V.isFixedLengthVector()
161  : isExtendedFixedLengthVector();
162  }
163 
164  /// Return true if this is a 16-bit vector type.
165  bool is16BitVector() const {
166  return isSimple() ? V.is16BitVector() : isExtended16BitVector();
167  }
168 
169  /// Return true if this is a 32-bit vector type.
170  bool is32BitVector() const {
171  return isSimple() ? V.is32BitVector() : isExtended32BitVector();
172  }
173 
174  /// Return true if this is a 64-bit vector type.
175  bool is64BitVector() const {
176  return isSimple() ? V.is64BitVector() : isExtended64BitVector();
177  }
178 
179  /// Return true if this is a 128-bit vector type.
180  bool is128BitVector() const {
181  return isSimple() ? V.is128BitVector() : isExtended128BitVector();
182  }
183 
184  /// Return true if this is a 256-bit vector type.
185  bool is256BitVector() const {
186  return isSimple() ? V.is256BitVector() : isExtended256BitVector();
187  }
188 
189  /// Return true if this is a 512-bit vector type.
190  bool is512BitVector() const {
191  return isSimple() ? V.is512BitVector() : isExtended512BitVector();
192  }
193 
194  /// Return true if this is a 1024-bit vector type.
195  bool is1024BitVector() const {
196  return isSimple() ? V.is1024BitVector() : isExtended1024BitVector();
197  }
198 
199  /// Return true if this is a 2048-bit vector type.
200  bool is2048BitVector() const {
201  return isSimple() ? V.is2048BitVector() : isExtended2048BitVector();
202  }
203 
204  /// Return true if this is an overloaded type for TableGen.
205  bool isOverloaded() const {
206  return (V==MVT::iAny || V==MVT::fAny || V==MVT::vAny || V==MVT::iPTRAny);
207  }
208 
209  /// Return true if the bit size is a multiple of 8.
210  bool isByteSized() const { return getSizeInBits().isKnownMultipleOf(8); }
211 
212  /// Return true if the size is a power-of-two number of bytes.
213  bool isRound() const {
214  if (isScalableVector())
215  return false;
216  unsigned BitSize = getSizeInBits();
217  return BitSize >= 8 && !(BitSize & (BitSize - 1));
218  }
219 
220  /// Return true if this has the same number of bits as VT.
221  bool bitsEq(EVT VT) const {
222  if (EVT::operator==(VT)) return true;
223  return getSizeInBits() == VT.getSizeInBits();
224  }
225 
226  /// Return true if we know at compile time this has more bits than VT.
227  bool knownBitsGT(EVT VT) const {
229  }
230 
231  /// Return true if we know at compile time this has more than or the same
232  /// bits as VT.
233  bool knownBitsGE(EVT VT) const {
235  }
236 
237  /// Return true if we know at compile time this has fewer bits than VT.
238  bool knownBitsLT(EVT VT) const {
240  }
241 
242  /// Return true if we know at compile time this has fewer than or the same
243  /// bits as VT.
244  bool knownBitsLE(EVT VT) const {
246  }
247 
248  /// Return true if this has more bits than VT.
249  bool bitsGT(EVT VT) const {
250  if (EVT::operator==(VT)) return false;
252  "Comparison between scalable and fixed types");
253  return knownBitsGT(VT);
254  }
255 
256  /// Return true if this has no less bits than VT.
257  bool bitsGE(EVT VT) const {
258  if (EVT::operator==(VT)) return true;
260  "Comparison between scalable and fixed types");
261  return knownBitsGE(VT);
262  }
263 
264  /// Return true if this has less bits than VT.
265  bool bitsLT(EVT VT) const {
266  if (EVT::operator==(VT)) return false;
268  "Comparison between scalable and fixed types");
269  return knownBitsLT(VT);
270  }
271 
272  /// Return true if this has no more bits than VT.
273  bool bitsLE(EVT VT) const {
274  if (EVT::operator==(VT)) return true;
276  "Comparison between scalable and fixed types");
277  return knownBitsLE(VT);
278  }
279 
280  /// Return the SimpleValueType held in the specified simple EVT.
281  MVT getSimpleVT() const {
282  assert(isSimple() && "Expected a SimpleValueType!");
283  return V;
284  }
285 
286  /// If this is a vector type, return the element type, otherwise return
287  /// this.
288  EVT getScalarType() const {
289  return isVector() ? getVectorElementType() : *this;
290  }
291 
292  /// Given a vector type, return the type of each element.
294  assert(isVector() && "Invalid vector type!");
295  if (isSimple())
296  return V.getVectorElementType();
297  return getExtendedVectorElementType();
298  }
299 
300  /// Given a vector type, return the number of elements it contains.
301  unsigned getVectorNumElements() const {
302  assert(isVector() && "Invalid vector type!");
303 
304  if (isScalableVector())
306  "Possible incorrect use of EVT::getVectorNumElements() for "
307  "scalable vector. Scalable flag may be dropped, use "
308  "EVT::getVectorElementCount() instead");
309 
310  return isSimple() ? V.getVectorNumElements()
311  : getExtendedVectorNumElements();
312  }
313 
314  // Given a (possibly scalable) vector type, return the ElementCount
316  assert((isVector()) && "Invalid vector type!");
317  if (isSimple())
318  return V.getVectorElementCount();
319 
320  return getExtendedVectorElementCount();
321  }
322 
323  /// Given a vector type, return the minimum number of elements it contains.
324  unsigned getVectorMinNumElements() const {
326  }
327 
328  /// Return the size of the specified value type in bits.
329  ///
330  /// If the value type is a scalable vector type, the scalable property will
331  /// be set and the runtime size will be a positive integer multiple of the
332  /// base size.
334  if (isSimple())
335  return V.getSizeInBits();
336  return getExtendedSizeInBits();
337  }
338 
339  /// Return the size of the specified fixed width value type in bits. The
340  /// function will assert if the type is scalable.
341  uint64_t getFixedSizeInBits() const {
342  return getSizeInBits().getFixedSize();
343  }
344 
345  uint64_t getScalarSizeInBits() const {
347  }
348 
349  /// Return the number of bytes overwritten by a store of the specified value
350  /// type.
351  ///
352  /// If the value type is a scalable vector type, the scalable property will
353  /// be set and the runtime size will be a positive integer multiple of the
354  /// base size.
356  TypeSize BaseSize = getSizeInBits();
357  return {(BaseSize.getKnownMinSize() + 7) / 8, BaseSize.isScalable()};
358  }
359 
360  /// Return the number of bits overwritten by a store of the specified value
361  /// type.
362  ///
363  /// If the value type is a scalable vector type, the scalable property will
364  /// be set and the runtime size will be a positive integer multiple of the
365  /// base size.
367  return getStoreSize() * 8;
368  }
369 
370  /// Rounds the bit-width of the given integer EVT up to the nearest power of
371  /// two (and at least to eight), and returns the integer EVT with that
372  /// number of bits.
374  assert(isInteger() && !isVector() && "Invalid integer type!");
375  unsigned BitWidth = getSizeInBits();
376  if (BitWidth <= 8)
377  return EVT(MVT::i8);
378  return getIntegerVT(Context, 1 << Log2_32_Ceil(BitWidth));
379  }
380 
381  /// Finds the smallest simple value type that is greater than or equal to
382  /// half the width of this EVT. If no simple value type can be found, an
383  /// extended integer value type of half the size (rounded up) is returned.
385  assert(isInteger() && !isVector() && "Invalid integer type!");
386  unsigned EVTSize = getSizeInBits();
387  for (unsigned IntVT = MVT::FIRST_INTEGER_VALUETYPE;
388  IntVT <= MVT::LAST_INTEGER_VALUETYPE; ++IntVT) {
389  EVT HalfVT = EVT((MVT::SimpleValueType)IntVT);
390  if (HalfVT.getSizeInBits() * 2 >= EVTSize)
391  return HalfVT;
392  }
393  return getIntegerVT(Context, (EVTSize + 1) / 2);
394  }
395 
396  /// Return a VT for an integer vector type with the size of the
397  /// elements doubled. The typed returned may be an extended type.
399  EVT EltVT = getVectorElementType();
400  EltVT = EVT::getIntegerVT(Context, 2 * EltVT.getSizeInBits());
402  }
403 
404  // Return a VT for a vector type with the same element type but
405  // half the number of elements. The type returned may be an
406  // extended type.
408  EVT EltVT = getVectorElementType();
409  auto EltCnt = getVectorElementCount();
410  assert(EltCnt.isKnownEven() && "Splitting vector, but not in half!");
411  return EVT::getVectorVT(Context, EltVT, EltCnt.divideCoefficientBy(2));
412  }
413 
414  // Return a VT for a vector type with the same element type but
415  // double the number of elements. The type returned may be an
416  // extended type.
418  EVT EltVT = getVectorElementType();
419  auto EltCnt = getVectorElementCount();
420  return EVT::getVectorVT(Context, EltVT, EltCnt * 2);
421  }
422 
423  /// Returns true if the given vector is a power of 2.
424  bool isPow2VectorType() const {
425  unsigned NElts = getVectorMinNumElements();
426  return !(NElts & (NElts - 1));
427  }
428 
429  /// Widens the length of the given vector EVT up to the nearest power of 2
430  /// and returns that type.
432  if (!isPow2VectorType()) {
434  unsigned NewMinCount = 1 << Log2_32_Ceil(NElts.getKnownMinValue());
435  NElts = ElementCount::get(NewMinCount, NElts.isScalable());
437  }
438  else {
439  return *this;
440  }
441  }
442 
443  /// This function returns value type as a string, e.g. "i32".
444  std::string getEVTString() const;
445 
446  /// This method returns an LLVM type corresponding to the specified EVT.
447  /// For integer types, this returns an unsigned type. Note that this will
448  /// abort for types that cannot be represented.
450 
451  /// Return the value type corresponding to the specified type.
452  /// This returns all pointers as iPTR. If HandleUnknown is true, unknown
453  /// types are returned as Other, otherwise they are invalid.
454  static EVT getEVT(Type *Ty, bool HandleUnknown = false);
455 
457  if (isSimple())
458  return V.SimpleTy;
459  else
460  return (intptr_t)(LLVMTy);
461  }
462 
463  /// A meaningless but well-behaved order, useful for constructing
464  /// containers.
465  struct compareRawBits {
466  bool operator()(EVT L, EVT R) const {
467  if (L.V.SimpleTy == R.V.SimpleTy)
468  return L.LLVMTy < R.LLVMTy;
469  else
470  return L.V.SimpleTy < R.V.SimpleTy;
471  }
472  };
473 
474  private:
475  // Methods for handling the Extended-type case in functions above.
476  // These are all out-of-line to prevent users of this header file
477  // from having a dependency on Type.h.
478  EVT changeExtendedTypeToInteger() const;
479  EVT changeExtendedVectorElementType(EVT EltVT) const;
480  EVT changeExtendedVectorElementTypeToInteger() const;
481  static EVT getExtendedIntegerVT(LLVMContext &C, unsigned BitWidth);
482  static EVT getExtendedVectorVT(LLVMContext &C, EVT VT, unsigned NumElements,
483  bool IsScalable);
484  static EVT getExtendedVectorVT(LLVMContext &Context, EVT VT,
485  ElementCount EC);
486  bool isExtendedFloatingPoint() const LLVM_READONLY;
487  bool isExtendedInteger() const LLVM_READONLY;
488  bool isExtendedScalarInteger() const LLVM_READONLY;
489  bool isExtendedVector() const LLVM_READONLY;
490  bool isExtended16BitVector() const LLVM_READONLY;
491  bool isExtended32BitVector() const LLVM_READONLY;
492  bool isExtended64BitVector() const LLVM_READONLY;
493  bool isExtended128BitVector() const LLVM_READONLY;
494  bool isExtended256BitVector() const LLVM_READONLY;
495  bool isExtended512BitVector() const LLVM_READONLY;
496  bool isExtended1024BitVector() const LLVM_READONLY;
497  bool isExtended2048BitVector() const LLVM_READONLY;
498  bool isExtendedFixedLengthVector() const LLVM_READONLY;
499  bool isExtendedScalableVector() const LLVM_READONLY;
500  EVT getExtendedVectorElementType() const;
501  unsigned getExtendedVectorNumElements() const LLVM_READONLY;
502  ElementCount getExtendedVectorElementCount() const LLVM_READONLY;
503  TypeSize getExtendedSizeInBits() const LLVM_READONLY;
504  };
505 
506 } // end namespace llvm
507 
508 #endif // LLVM_CODEGEN_VALUETYPES_H
llvm::MVT::getVectorElementType
MVT getVectorElementType() const
Definition: MachineValueType.h:502
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:227
llvm::EVT::is32BitVector
bool is32BitVector() const
Return true if this is a 32-bit vector type.
Definition: ValueTypes.h:170
llvm::EVT::operator!=
bool operator!=(EVT VT) const
Definition: ValueTypes.h:48
LLVM_READONLY
#define LLVM_READONLY
Definition: Compiler.h:212
MathExtras.h
llvm::EVT::is16BitVector
bool is16BitVector() const
Return true if this is a 16-bit vector type.
Definition: ValueTypes.h:165
llvm
Definition: AllocatorList.h:23
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:144
llvm::MVT::isFixedLengthVector
bool isFixedLengthVector() const
Definition: MachineValueType.h:361
llvm::MVT::isInteger
bool isInteger() const
Return true if this is an integer or a vector integer type.
Definition: MachineValueType.h:333
intptr_t
llvm::LinearPolySize< TypeSize >::isKnownGT
static bool isKnownGT(const LinearPolySize &LHS, const LinearPolySize &RHS)
Definition: TypeSize.h:335
llvm::EVT::compareRawBits
A meaningless but well-behaved order, useful for constructing containers.
Definition: ValueTypes.h:465
llvm::EVT::getVectorElementCount
ElementCount getVectorElementCount() const
Definition: ValueTypes.h:315
llvm::ElementCount
Definition: TypeSize.h:386
llvm::EVT::getFixedSizeInBits
uint64_t getFixedSizeInBits() const
Return the size of the specified fixed width value type in bits.
Definition: ValueTypes.h:341
llvm::TypeSize::getFixedSize
ScalarTy getFixedSize() const
Definition: TypeSize.h:426
llvm::MVT::is256BitVector
bool is256BitVector() const
Return true if this is a 256-bit vector type.
Definition: MachineValueType.h:399
TypeSize.h
llvm::LinearPolySize< TypeSize >::isKnownLE
static bool isKnownLE(const LinearPolySize &LHS, const LinearPolySize &RHS)
Definition: TypeSize.h:341
llvm::MVT::isVector
bool isVector() const
Return true if this is a vector value type.
Definition: MachineValueType.h:349
llvm::MVT::fAny
@ fAny
Definition: MachineValueType.h:288
llvm::EVT::isScalableVector
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
Definition: ValueTypes.h:155
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
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::isOverloaded
bool isOverloaded() const
Return true if this is an overloaded type for TableGen.
Definition: ValueTypes.h:205
llvm::EVT::bitsLE
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
Definition: ValueTypes.h:273
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:373
llvm::LinearPolySize::isScalable
bool isScalable() const
Returns whether the size is scaled by a runtime quantity (vscale).
Definition: TypeSize.h:299
llvm::EVT::EVT
constexpr EVT(MVT::SimpleValueType SVT)
Definition: ValueTypes.h:42
llvm::MVT::is32BitVector
bool is32BitVector() const
Return true if this is a 32-bit vector type.
Definition: MachineValueType.h:373
llvm::EVT::changeTypeToInteger
EVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type.
Definition: ValueTypes.h:114
llvm::LinearPolySize< TypeSize >::isKnownLT
static bool isKnownLT(const LinearPolySize &LHS, const LinearPolySize &RHS)
Definition: TypeSize.h:329
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:356
llvm::EVT::isSimple
bool isSimple() const
Test if the given EVT is simple (as opposed to being extended).
Definition: ValueTypes.h:124
llvm::EVT::is256BitVector
bool is256BitVector() const
Return true if this is a 256-bit vector type.
Definition: ValueTypes.h:185
MachineValueType.h
llvm::MVT::SimpleValueType
SimpleValueType
Definition: MachineValueType.h:32
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:355
llvm::LinearPolySize< ElementCount >::get
static ElementCount get(ScalarTy MinVal, bool Scalable)
Definition: TypeSize.h:290
llvm::MVT::changeTypeToInteger
MVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type.
Definition: MachineValueType.h:464
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:431
llvm::EVT
Extended Value Type.
Definition: ValueTypes.h:35
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:175
llvm::EVT::getVectorNumElements
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
Definition: ValueTypes.h:301
llvm::MVT::SimpleTy
SimpleValueType SimpleTy
Definition: MachineValueType.h:304
llvm::EVT::isInteger
bool isInteger() const
Return true if this is an integer or a vector integer type.
Definition: ValueTypes.h:139
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::MVT::INVALID_SIMPLE_VALUE_TYPE
@ INVALID_SIMPLE_VALUE_TYPE
Definition: MachineValueType.h:35
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::EVT
constexpr EVT(MVT S)
Definition: ValueTypes.h:43
llvm::EVT::EVT
constexpr EVT()=default
llvm::MVT::FIRST_INTEGER_VALUETYPE
@ FIRST_INTEGER_VALUETYPE
Definition: MachineValueType.h:47
llvm::EVT::is1024BitVector
bool is1024BitVector() const
Return true if this is a 1024-bit vector type.
Definition: ValueTypes.h:195
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::bitsLT
bool bitsLT(EVT VT) const
Return true if this has less bits than VT.
Definition: ValueTypes.h:265
llvm::EVT::getTypeForEVT
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
Definition: ValueTypes.cpp:181
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:609
llvm::EVT::isExtended
bool isExtended() const
Test if the given EVT is extended (as opposed to being simple).
Definition: ValueTypes.h:129
llvm::MVT::isFloatingPoint
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
Definition: MachineValueType.h:323
llvm::EVT::getStoreSizeInBits
TypeSize getStoreSizeInBits() const
Return the number of bits overwritten by a store of the specified value type.
Definition: ValueTypes.h:366
llvm::MVT::iPTRAny
@ iPTRAny
Definition: MachineValueType.h:278
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:244
llvm::EVT::getSizeInBits
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
Definition: ValueTypes.h:333
llvm::MVT::is16BitVector
bool is16BitVector() const
Return true if this is a 16-bit vector type.
Definition: MachineValueType.h:367
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:533
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:384
llvm::EVT::getVectorMinNumElements
unsigned getVectorMinNumElements() const
Given a vector type, return the minimum number of elements it contains.
Definition: ValueTypes.h:324
TemplateParamKind::Type
@ Type
llvm::EVT::getRawBits
intptr_t getRawBits() const
Definition: ValueTypes.h:456
llvm::MVT::getVectorNumElements
unsigned getVectorNumElements() const
Definition: MachineValueType.h:813
llvm::MVT::i8
@ i8
Definition: MachineValueType.h:41
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:65
llvm::MVT::getSizeInBits
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
Definition: MachineValueType.h:823
llvm::LinearPolySize< TypeSize >::isKnownGE
static bool isKnownGE(const LinearPolySize &LHS, const LinearPolySize &RHS)
Definition: TypeSize.h:347
llvm::EVT::isByteSized
bool isByteSized() const
Return true if the bit size is a multiple of 8.
Definition: ValueTypes.h:210
llvm::MVT::getFloatingPointVT
static MVT getFloatingPointVT(unsigned BitWidth)
Definition: MachineValueType.h:1093
llvm::MVT
Machine Value Type.
Definition: MachineValueType.h:30
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:398
llvm::LinearPolySize::getKnownMinValue
ScalarTy getKnownMinValue() const
Returns the minimum value this size can represent.
Definition: TypeSize.h:297
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:306
llvm::MVT::getVectorVT
static MVT getVectorVT(MVT VT, unsigned NumElements)
Definition: MachineValueType.h:1129
llvm::EVT::isVector
bool isVector() const
Return true if this is a vector value type.
Definition: ValueTypes.h:149
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:443
llvm::EVT::getScalarSizeInBits
uint64_t getScalarSizeInBits() const
Definition: ValueTypes.h:345
llvm::MVT::is2048BitVector
bool is2048BitVector() const
Return true if this is a 2048-bit vector type.
Definition: MachineValueType.h:426
Compiler.h
llvm::MVT::is128BitVector
bool is128BitVector() const
Return true if this is a 128-bit vector type.
Definition: MachineValueType.h:390
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:381
llvm::EVT::operator==
bool operator==(EVT VT) const
Definition: ValueTypes.h:45
llvm::MVT::getVectorElementCount
ElementCount getVectorElementCount() const
Definition: MachineValueType.h:809
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:200
llvm::EVT::getHalfNumVectorElementsVT
EVT getHalfNumVectorElementsVT(LLVMContext &Context) const
Definition: ValueTypes.h:407
WithColor.h
llvm::EVT::getScalarType
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
Definition: ValueTypes.h:288
llvm::MVT::iAny
@ iAny
Definition: MachineValueType.h:293
llvm::EVT::compareRawBits::operator()
bool operator()(EVT L, EVT R) const
Definition: ValueTypes.h:466
llvm::TypeSize
Definition: TypeSize.h:417
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:190
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::getVectorElementType
EVT getVectorElementType() const
Given a vector type, return the type of each element.
Definition: ValueTypes.h:293
llvm::MVT::isScalarInteger
bool isScalarInteger() const
Return true if this is an integer, not including vectors.
Definition: MachineValueType.h:343
llvm::EVT::isPow2VectorType
bool isPow2VectorType() const
Returns true if the given vector is a power of 2.
Definition: ValueTypes.h:424
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:454
llvm::TypeSize::getKnownMinSize
ScalarTy getKnownMinSize() const
Definition: TypeSize.h:427
llvm::MVT::is1024BitVector
bool is1024BitVector() const
Return true if this is a 1024-bit vector type.
Definition: MachineValueType.h:417
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:233
llvm::EVT::bitsGT
bool bitsGT(EVT VT) const
Return true if this has more bits than VT.
Definition: ValueTypes.h:249
llvm::EVT::isRound
bool isRound() const
Return true if the size is a power-of-two number of bytes.
Definition: ValueTypes.h:213
llvm::EVT::bitsGE
bool bitsGE(EVT VT) const
Return true if this has no less bits than VT.
Definition: ValueTypes.h:257
llvm::EVT::is128BitVector
bool is128BitVector() const
Return true if this is a 128-bit vector type.
Definition: ValueTypes.h:180
llvm::MVT::LAST_INTEGER_VALUETYPE
@ LAST_INTEGER_VALUETYPE
Definition: MachineValueType.h:48
llvm::MVT::vAny
@ vAny
Definition: MachineValueType.h:283
llvm::EVT::getDoubleNumVectorElementsVT
EVT getDoubleNumVectorElementsVT(LLVMContext &Context) const
Definition: ValueTypes.h:417
llvm::EVT::isFixedLengthVector
bool isFixedLengthVector() const
Definition: ValueTypes.h:159
llvm::EVT::bitsEq
bool bitsEq(EVT VT) const
Return true if this has the same number of bits as VT.
Definition: ValueTypes.h:221
llvm::EVT::isFloatingPoint
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
Definition: ValueTypes.h:134
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:238
llvm::MVT::is512BitVector
bool is512BitVector() const
Return true if this is a 512-bit vector type.
Definition: MachineValueType.h:408
llvm::EVT::getSimpleVT
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
Definition: ValueTypes.h:281
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:22
llvm::MVT::getIntegerVT
static MVT getIntegerVT(unsigned BitWidth)
Definition: MachineValueType.h:1110