LLVM  14.0.0git
ValueTypes.cpp
Go to the documentation of this file.
1 //===----------- ValueTypes.cpp - Implementation of EVT methods -----------===//
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 
10 #include "llvm/ADT/StringExtras.h"
11 #include "llvm/IR/DerivedTypes.h"
12 #include "llvm/IR/Type.h"
14 #include "llvm/Support/TypeSize.h"
15 using namespace llvm;
16 
17 EVT EVT::changeExtendedTypeToInteger() const {
18  assert(isExtended() && "Type is not extended!");
19  LLVMContext &Context = LLVMTy->getContext();
21 }
22 
23 EVT EVT::changeExtendedVectorElementTypeToInteger() const {
24  assert(isExtended() && "Type is not extended!");
25  LLVMContext &Context = LLVMTy->getContext();
27  return getVectorVT(Context, IntTy, getVectorElementCount());
28 }
29 
30 EVT EVT::changeExtendedVectorElementType(EVT EltVT) const {
31  assert(isExtended() && "Type is not extended!");
32  LLVMContext &Context = LLVMTy->getContext();
33  return getVectorVT(Context, EltVT, getVectorElementCount());
34 }
35 
36 EVT EVT::getExtendedIntegerVT(LLVMContext &Context, unsigned BitWidth) {
37  EVT VT;
38  VT.LLVMTy = IntegerType::get(Context, BitWidth);
39  assert(VT.isExtended() && "Type is not extended!");
40  return VT;
41 }
42 
43 EVT EVT::getExtendedVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements,
44  bool IsScalable) {
45  EVT ResultVT;
46  ResultVT.LLVMTy =
47  VectorType::get(VT.getTypeForEVT(Context), NumElements, IsScalable);
48  assert(ResultVT.isExtended() && "Type is not extended!");
49  return ResultVT;
50 }
51 
52 EVT EVT::getExtendedVectorVT(LLVMContext &Context, EVT VT, ElementCount EC) {
53  EVT ResultVT;
54  ResultVT.LLVMTy = VectorType::get(VT.getTypeForEVT(Context), EC);
55  assert(ResultVT.isExtended() && "Type is not extended!");
56  return ResultVT;
57 }
58 
59 bool EVT::isExtendedFloatingPoint() const {
60  assert(isExtended() && "Type is not extended!");
61  return LLVMTy->isFPOrFPVectorTy();
62 }
63 
64 bool EVT::isExtendedInteger() const {
65  assert(isExtended() && "Type is not extended!");
66  return LLVMTy->isIntOrIntVectorTy();
67 }
68 
69 bool EVT::isExtendedScalarInteger() const {
70  assert(isExtended() && "Type is not extended!");
71  return LLVMTy->isIntegerTy();
72 }
73 
74 bool EVT::isExtendedVector() const {
75  assert(isExtended() && "Type is not extended!");
76  return LLVMTy->isVectorTy();
77 }
78 
79 bool EVT::isExtended16BitVector() const {
80  return isExtendedVector() && getExtendedSizeInBits() == 16;
81 }
82 
83 bool EVT::isExtended32BitVector() const {
84  return isExtendedVector() && getExtendedSizeInBits() == 32;
85 }
86 
87 bool EVT::isExtended64BitVector() const {
88  return isExtendedVector() && getExtendedSizeInBits() == 64;
89 }
90 
91 bool EVT::isExtended128BitVector() const {
92  return isExtendedVector() && getExtendedSizeInBits() == 128;
93 }
94 
95 bool EVT::isExtended256BitVector() const {
96  return isExtendedVector() && getExtendedSizeInBits() == 256;
97 }
98 
99 bool EVT::isExtended512BitVector() const {
100  return isExtendedVector() && getExtendedSizeInBits() == 512;
101 }
102 
103 bool EVT::isExtended1024BitVector() const {
104  return isExtendedVector() && getExtendedSizeInBits() == 1024;
105 }
106 
107 bool EVT::isExtended2048BitVector() const {
108  return isExtendedVector() && getExtendedSizeInBits() == 2048;
109 }
110 
111 bool EVT::isExtendedFixedLengthVector() const {
112  return isExtendedVector() && isa<FixedVectorType>(LLVMTy);
113 }
114 
115 bool EVT::isExtendedScalableVector() const {
116  return isExtendedVector() && isa<ScalableVectorType>(LLVMTy);
117 }
118 
119 EVT EVT::getExtendedVectorElementType() const {
120  assert(isExtended() && "Type is not extended!");
121  return EVT::getEVT(cast<VectorType>(LLVMTy)->getElementType());
122 }
123 
124 unsigned EVT::getExtendedVectorNumElements() const {
125  assert(isExtended() && "Type is not extended!");
126  ElementCount EC = cast<VectorType>(LLVMTy)->getElementCount();
127  if (EC.isScalable()) {
129  << "The code that requested the fixed number of elements has made the "
130  "assumption that this vector is not scalable. This assumption was "
131  "not correct, and this may lead to broken code\n";
132  }
133  return EC.getKnownMinValue();
134 }
135 
136 ElementCount EVT::getExtendedVectorElementCount() const {
137  assert(isExtended() && "Type is not extended!");
138  return cast<VectorType>(LLVMTy)->getElementCount();
139 }
140 
141 TypeSize EVT::getExtendedSizeInBits() const {
142  assert(isExtended() && "Type is not extended!");
143  if (IntegerType *ITy = dyn_cast<IntegerType>(LLVMTy))
144  return TypeSize::Fixed(ITy->getBitWidth());
145  if (VectorType *VTy = dyn_cast<VectorType>(LLVMTy))
146  return VTy->getPrimitiveSizeInBits();
147  llvm_unreachable("Unrecognized extended type!");
148 }
149 
150 /// getEVTString - This function returns value type as a string, e.g. "i32".
151 std::string EVT::getEVTString() const {
152  switch (V.SimpleTy) {
153  default:
154  if (isVector())
155  return (isScalableVector() ? "nxv" : "v") +
156  utostr(getVectorElementCount().getKnownMinValue()) +
158  if (isInteger())
159  return "i" + utostr(getSizeInBits());
160  if (isFloatingPoint())
161  return "f" + utostr(getSizeInBits());
162  llvm_unreachable("Invalid EVT!");
163  case MVT::bf16: return "bf16";
164  case MVT::ppcf128: return "ppcf128";
165  case MVT::isVoid: return "isVoid";
166  case MVT::Other: return "ch";
167  case MVT::Glue: return "glue";
168  case MVT::x86mmx: return "x86mmx";
169  case MVT::x86amx: return "x86amx";
170  case MVT::i64x8: return "i64x8";
171  case MVT::Metadata: return "Metadata";
172  case MVT::Untyped: return "Untyped";
173  case MVT::funcref: return "funcref";
174  case MVT::externref: return "externref";
175  }
176 }
177 
178 /// getTypeForEVT - This method returns an LLVM type corresponding to the
179 /// specified EVT. For integer types, this returns an unsigned type. Note
180 /// that this will abort for types that cannot be represented.
182  switch (V.SimpleTy) {
183  default:
184  assert(isExtended() && "Type is not extended!");
185  return LLVMTy;
186  case MVT::isVoid: return Type::getVoidTy(Context);
187  case MVT::i1: return Type::getInt1Ty(Context);
188  case MVT::i8: return Type::getInt8Ty(Context);
189  case MVT::i16: return Type::getInt16Ty(Context);
190  case MVT::i32: return Type::getInt32Ty(Context);
191  case MVT::i64: return Type::getInt64Ty(Context);
192  case MVT::i128: return IntegerType::get(Context, 128);
193  case MVT::f16: return Type::getHalfTy(Context);
194  case MVT::bf16: return Type::getBFloatTy(Context);
195  case MVT::f32: return Type::getFloatTy(Context);
196  case MVT::f64: return Type::getDoubleTy(Context);
197  case MVT::f80: return Type::getX86_FP80Ty(Context);
198  case MVT::f128: return Type::getFP128Ty(Context);
200  case MVT::x86mmx: return Type::getX86_MMXTy(Context);
201  case MVT::x86amx: return Type::getX86_AMXTy(Context);
202  case MVT::i64x8: return IntegerType::get(Context, 512);
203  case MVT::externref:
205  case MVT::funcref:
207  case MVT::v1i1:
209  case MVT::v2i1:
211  case MVT::v4i1:
213  case MVT::v8i1:
215  case MVT::v16i1:
217  case MVT::v32i1:
219  case MVT::v64i1:
221  case MVT::v128i1:
223  case MVT::v256i1:
225  case MVT::v512i1:
227  case MVT::v1024i1:
229  case MVT::v1i8:
231  case MVT::v2i8:
233  case MVT::v4i8:
235  case MVT::v8i8:
237  case MVT::v16i8:
239  case MVT::v32i8:
241  case MVT::v64i8:
243  case MVT::v128i8:
245  case MVT::v256i8:
247  case MVT::v512i8:
249  case MVT::v1024i8:
251  case MVT::v1i16:
253  case MVT::v2i16:
255  case MVT::v3i16:
257  case MVT::v4i16:
259  case MVT::v8i16:
261  case MVT::v16i16:
263  case MVT::v32i16:
265  case MVT::v64i16:
267  case MVT::v128i16:
269  case MVT::v256i16:
271  case MVT::v512i16:
273  case MVT::v1i32:
275  case MVT::v2i32:
277  case MVT::v3i32:
279  case MVT::v4i32:
281  case MVT::v5i32:
283  case MVT::v6i32:
285  case MVT::v7i32:
287  case MVT::v8i32:
289  case MVT::v16i32:
291  case MVT::v32i32:
293  case MVT::v64i32:
295  case MVT::v128i32:
297  case MVT::v256i32:
299  case MVT::v512i32:
301  case MVT::v1024i32:
303  case MVT::v2048i32:
305  case MVT::v1i64:
307  case MVT::v2i64:
309  case MVT::v3i64:
311  case MVT::v4i64:
313  case MVT::v8i64:
315  case MVT::v16i64:
317  case MVT::v32i64:
319  case MVT::v64i64:
321  case MVT::v128i64:
323  case MVT::v256i64:
325  case MVT::v1i128:
327  case MVT::v1f16:
329  case MVT::v2f16:
331  case MVT::v3f16:
333  case MVT::v4f16:
335  case MVT::v8f16:
337  case MVT::v16f16:
339  case MVT::v32f16:
341  case MVT::v64f16:
343  case MVT::v128f16:
345  case MVT::v256f16:
347  case MVT::v512f16:
349  case MVT::v2bf16:
351  case MVT::v3bf16:
353  case MVT::v4bf16:
355  case MVT::v8bf16:
357  case MVT::v16bf16:
359  case MVT::v32bf16:
361  case MVT::v64bf16:
363  case MVT::v128bf16:
365  case MVT::v1f32:
367  case MVT::v2f32:
369  case MVT::v3f32:
371  case MVT::v4f32:
373  case MVT::v5f32:
375  case MVT::v6f32:
377  case MVT::v7f32:
379  case MVT::v8f32:
381  case MVT::v16f32:
383  case MVT::v32f32:
385  case MVT::v64f32:
387  case MVT::v128f32:
389  case MVT::v256f32:
391  case MVT::v512f32:
393  case MVT::v1024f32:
395  case MVT::v2048f32:
397  case MVT::v1f64:
399  case MVT::v2f64:
401  case MVT::v3f64:
403  case MVT::v4f64:
405  case MVT::v8f64:
407  case MVT::v16f64:
409  case MVT::v32f64:
411  case MVT::v64f64:
413  case MVT::v128f64:
415  case MVT::v256f64:
417  case MVT::nxv1i1:
419  case MVT::nxv2i1:
421  case MVT::nxv4i1:
423  case MVT::nxv8i1:
425  case MVT::nxv16i1:
427  case MVT::nxv32i1:
429  case MVT::nxv64i1:
431  case MVT::nxv1i8:
433  case MVT::nxv2i8:
435  case MVT::nxv4i8:
437  case MVT::nxv8i8:
439  case MVT::nxv16i8:
441  case MVT::nxv32i8:
443  case MVT::nxv64i8:
445  case MVT::nxv1i16:
447  case MVT::nxv2i16:
449  case MVT::nxv4i16:
451  case MVT::nxv8i16:
453  case MVT::nxv16i16:
455  case MVT::nxv32i16:
457  case MVT::nxv1i32:
459  case MVT::nxv2i32:
461  case MVT::nxv4i32:
463  case MVT::nxv8i32:
465  case MVT::nxv16i32:
467  case MVT::nxv32i32:
469  case MVT::nxv1i64:
471  case MVT::nxv2i64:
473  case MVT::nxv4i64:
475  case MVT::nxv8i64:
477  case MVT::nxv16i64:
479  case MVT::nxv32i64:
481  case MVT::nxv1f16:
483  case MVT::nxv2f16:
485  case MVT::nxv4f16:
487  case MVT::nxv8f16:
489  case MVT::nxv16f16:
491  case MVT::nxv32f16:
493  case MVT::nxv1bf16:
495  case MVT::nxv2bf16:
497  case MVT::nxv4bf16:
499  case MVT::nxv8bf16:
501  case MVT::nxv1f32:
503  case MVT::nxv2f32:
505  case MVT::nxv4f32:
507  case MVT::nxv8f32:
509  case MVT::nxv16f32:
511  case MVT::nxv1f64:
513  case MVT::nxv2f64:
515  case MVT::nxv4f64:
517  case MVT::nxv8f64:
520  }
521 }
522 
523 /// Return the value type corresponding to the specified type. This returns all
524 /// pointers as MVT::iPTR. If HandleUnknown is true, unknown types are returned
525 /// as Other, otherwise they are invalid.
526 MVT MVT::getVT(Type *Ty, bool HandleUnknown){
527  switch (Ty->getTypeID()) {
528  default:
529  if (HandleUnknown) return MVT(MVT::Other);
530  llvm_unreachable("Unknown type!");
531  case Type::VoidTyID:
532  return MVT::isVoid;
533  case Type::IntegerTyID:
534  return getIntegerVT(cast<IntegerType>(Ty)->getBitWidth());
535  case Type::HalfTyID: return MVT(MVT::f16);
536  case Type::BFloatTyID: return MVT(MVT::bf16);
537  case Type::FloatTyID: return MVT(MVT::f32);
538  case Type::DoubleTyID: return MVT(MVT::f64);
539  case Type::X86_FP80TyID: return MVT(MVT::f80);
540  case Type::X86_MMXTyID: return MVT(MVT::x86mmx);
541  case Type::X86_AMXTyID: return MVT(MVT::x86amx);
542  case Type::FP128TyID: return MVT(MVT::f128);
543  case Type::PPC_FP128TyID: return MVT(MVT::ppcf128);
544  case Type::PointerTyID: return MVT(MVT::iPTR);
547  VectorType *VTy = cast<VectorType>(Ty);
548  return getVectorVT(
549  getVT(VTy->getElementType(), /*HandleUnknown=*/ false),
550  VTy->getElementCount());
551  }
552  }
553 }
554 
555 /// getEVT - Return the value type corresponding to the specified type. This
556 /// returns all pointers as MVT::iPTR. If HandleUnknown is true, unknown types
557 /// are returned as Other, otherwise they are invalid.
558 EVT EVT::getEVT(Type *Ty, bool HandleUnknown){
559  switch (Ty->getTypeID()) {
560  default:
561  return MVT::getVT(Ty, HandleUnknown);
562  case Type::IntegerTyID:
563  return getIntegerVT(Ty->getContext(), cast<IntegerType>(Ty)->getBitWidth());
566  VectorType *VTy = cast<VectorType>(Ty);
567  return getVectorVT(Ty->getContext(),
568  getEVT(VTy->getElementType(), /*HandleUnknown=*/ false),
569  VTy->getElementCount());
570  }
571  }
572 }
llvm::MVT::v3i16
@ v3i16
Definition: MachineValueType.h:90
llvm::MVT::nxv4i1
@ nxv4i1
Definition: MachineValueType.h:190
llvm::MVT::v1i16
@ v1i16
Definition: MachineValueType.h:88
ValueTypes.h
llvm::MVT::nxv4i64
@ nxv4i64
Definition: MachineValueType.h:220
llvm::MVT::v16bf16
@ v16bf16
Definition: MachineValueType.h:149
llvm::MVT::v512i16
@ v512i16
Definition: MachineValueType.h:98
llvm::Type::FloatTyID
@ FloatTyID
32-bit floating point type
Definition: Type.h:58
llvm::MVT::nxv2i1
@ nxv2i1
Definition: MachineValueType.h:189
llvm::MVT::v4f16
@ v4f16
Definition: MachineValueType.h:136
llvm::MVT::v256f16
@ v256f16
Definition: MachineValueType.h:142
llvm::Type::DoubleTyID
@ DoubleTyID
64-bit floating point type
Definition: Type.h:59
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::Type::getInt1Ty
static IntegerType * getInt1Ty(LLVMContext &C)
Definition: Type.cpp:238
llvm::MVT::v128i1
@ v128i1
Definition: MachineValueType.h:71
llvm::MVT::nxv1i32
@ nxv1i32
Definition: MachineValueType.h:211
llvm::MVT::nxv2f64
@ nxv2f64
Definition: MachineValueType.h:247
llvm::MVT::v1f64
@ v1f64
Definition: MachineValueType.h:171
llvm::EVT::getVectorElementCount
ElementCount getVectorElementCount() const
Definition: ValueTypes.h:323
llvm::Type::getFP128Ty
static Type * getFP128Ty(LLVMContext &C)
Definition: Type.cpp:233
llvm::ElementCount
Definition: TypeSize.h:386
llvm::MVT::v128i32
@ v128i32
Definition: MachineValueType.h:111
llvm::MVT::ppcf128
@ ppcf128
Definition: MachineValueType.h:59
llvm::MVT::v512i8
@ v512i8
Definition: MachineValueType.h:85
llvm::MVT::nxv32f16
@ nxv32f16
Definition: MachineValueType.h:233
llvm::MVT::v3f64
@ v3f64
Definition: MachineValueType.h:173
llvm::Type::VoidTyID
@ VoidTyID
type with no size
Definition: Type.h:63
llvm::MVT::v32f64
@ v32f64
Definition: MachineValueType.h:177
llvm::MVT::i128
@ i128
Definition: MachineValueType.h:48
llvm::MVT::nxv2f32
@ nxv2f32
Definition: MachineValueType.h:241
llvm::MVT::nxv16f16
@ nxv16f16
Definition: MachineValueType.h:232
llvm::PointerType::get
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space.
Definition: Type.cpp:729
llvm::MVT::v16f64
@ v16f64
Definition: MachineValueType.h:176
TypeSize.h
llvm::MVT::nxv1f64
@ nxv1f64
Definition: MachineValueType.h:246
llvm::MVT::v64f32
@ v64f32
Definition: MachineValueType.h:164
llvm::MVT::v2i1
@ v2i1
Definition: MachineValueType.h:65
ErrorHandling.h
llvm::MVT::v64i64
@ v64i64
Definition: MachineValueType.h:124
llvm::Type::X86_AMXTyID
@ X86_AMXTyID
AMX vectors (8192 bits, X86 specific)
Definition: Type.h:67
llvm::MVT::v512i32
@ v512i32
Definition: MachineValueType.h:113
llvm::MVT::nxv2i64
@ nxv2i64
Definition: MachineValueType.h:219
llvm::Type::getTypeID
TypeID getTypeID() const
Return the type id for the type.
Definition: Type.h:135
llvm::Type::isFPOrFPVectorTy
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
Definition: Type.h:178
llvm::MVT::Glue
@ Glue
Definition: MachineValueType.h:262
llvm::MVT::v64f16
@ v64f16
Definition: MachineValueType.h:140
llvm::EVT::isScalableVector
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
Definition: ValueTypes.h:161
llvm::MVT::nxv4f16
@ nxv4f16
Definition: MachineValueType.h:230
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:74
llvm::MVT::nxv4f64
@ nxv4f64
Definition: MachineValueType.h:248
llvm::VectorType::getElementType
Type * getElementType() const
Definition: DerivedTypes.h:422
getBitWidth
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
Definition: ValueTracking.cpp:89
llvm::MVT::v256i32
@ v256i32
Definition: MachineValueType.h:112
llvm::StructType::create
static StructType * create(LLVMContext &Context, StringRef Name)
This creates an identified struct.
Definition: Type.cpp:515
llvm::MVT::v2048i32
@ v2048i32
Definition: MachineValueType.h:115
llvm::MVT::v2f64
@ v2f64
Definition: MachineValueType.h:172
llvm::MVT::v3f16
@ v3f16
Definition: MachineValueType.h:135
llvm::Type::getInt8Ty
static IntegerType * getInt8Ty(LLVMContext &C)
Definition: Type.cpp:239
llvm::MVT::nxv8i16
@ nxv8i16
Definition: MachineValueType.h:207
llvm::Type::getInt32Ty
static IntegerType * getInt32Ty(LLVMContext &C)
Definition: Type.cpp:241
llvm::MVT::nxv32i16
@ nxv32i16
Definition: MachineValueType.h:209
llvm::MVT::v128bf16
@ v128bf16
Definition: MachineValueType.h:152
llvm::MVT::nxv8bf16
@ nxv8bf16
Definition: MachineValueType.h:238
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::MVT::v4bf16
@ v4bf16
Definition: MachineValueType.h:147
llvm::MVT::funcref
@ funcref
Definition: MachineValueType.h:270
llvm::Type::getMetadataTy
static Type * getMetadataTy(LLVMContext &C)
Definition: Type.cpp:230
llvm::MVT::v256f32
@ v256f32
Definition: MachineValueType.h:166
llvm::MVT::MVT
constexpr MVT()=default
llvm::MVT::i1
@ i1
Definition: MachineValueType.h:43
llvm::MVT::nxv16f32
@ nxv16f32
Definition: MachineValueType.h:244
llvm::MVT::v8f16
@ v8f16
Definition: MachineValueType.h:137
llvm::MVT::v8f64
@ v8f64
Definition: MachineValueType.h:175
llvm::Type::getX86_AMXTy
static Type * getX86_AMXTy(LLVMContext &C)
Definition: Type.cpp:236
llvm::MVT::nxv2bf16
@ nxv2bf16
Definition: MachineValueType.h:236
llvm::MVT::v7f32
@ v7f32
Definition: MachineValueType.h:160
llvm::MVT::v32bf16
@ v32bf16
Definition: MachineValueType.h:150
llvm::Type::getPPC_FP128Ty
static Type * getPPC_FP128Ty(LLVMContext &C)
Definition: Type.cpp:234
llvm::EVT
Extended Value Type.
Definition: ValueTypes.h:35
llvm::MVT::v1f16
@ v1f16
Definition: MachineValueType.h:133
llvm::Type::getDoubleTy
static Type * getDoubleTy(LLVMContext &C)
Definition: Type.cpp:229
llvm::MVT::f64
@ f64
Definition: MachineValueType.h:56
llvm::MVT::x86amx
@ x86amx
Definition: MachineValueType.h:272
llvm::MVT::x86mmx
@ x86mmx
Definition: MachineValueType.h:260
llvm::MVT::SimpleTy
SimpleValueType SimpleTy
Definition: MachineValueType.h:321
llvm::MVT::v64i1
@ v64i1
Definition: MachineValueType.h:70
llvm::MVT::v64i32
@ v64i32
Definition: MachineValueType.h:110
llvm::MVT::nxv32i8
@ nxv32i8
Definition: MachineValueType.h:201
llvm::Type::isVectorTy
bool isVectorTy() const
True if this is an instance of VectorType.
Definition: Type.h:226
llvm::MVT::v16i1
@ v16i1
Definition: MachineValueType.h:68
llvm::MVT::nxv2f16
@ nxv2f16
Definition: MachineValueType.h:229
llvm::MVT::v256i16
@ v256i16
Definition: MachineValueType.h:97
llvm::VectorType::getElementCount
ElementCount getElementCount() const
Return an ElementCount instance to represent the (possibly scalable) number of elements in the vector...
Definition: DerivedTypes.h:627
llvm::TypeSize::Fixed
static TypeSize Fixed(ScalarTy MinVal)
Definition: TypeSize.h:423
llvm::MVT::v256f64
@ v256f64
Definition: MachineValueType.h:180
llvm::MVT::isVoid
@ isVoid
Definition: MachineValueType.h:264
llvm::IntegerType
Class to represent integer types.
Definition: DerivedTypes.h:40
llvm::MVT::v8i1
@ v8i1
Definition: MachineValueType.h:67
llvm::MVT::v4f64
@ v4f64
Definition: MachineValueType.h:174
llvm::EVT::isInteger
bool isInteger() const
Return true if this is an integer or a vector integer type.
Definition: ValueTypes.h:145
llvm::MVT::v1i1
@ v1i1
Definition: MachineValueType.h:64
llvm::MVT::v16f16
@ v16f16
Definition: MachineValueType.h:138
llvm::MVT::nxv4i8
@ nxv4i8
Definition: MachineValueType.h:198
llvm::MVT::nxv4f32
@ nxv4f32
Definition: MachineValueType.h:242
llvm::MVT::v6i32
@ v6i32
Definition: MachineValueType.h:105
llvm::MVT::v1024i32
@ v1024i32
Definition: MachineValueType.h:114
llvm::Type::PointerTyID
@ PointerTyID
Pointers.
Definition: Type.h:73
llvm::FixedVectorType::get
static FixedVectorType * get(Type *ElementType, unsigned NumElts)
Definition: Type.cpp:686
llvm::MVT::v1i64
@ v1i64
Definition: MachineValueType.h:117
llvm::Type::BFloatTyID
@ BFloatTyID
16-bit floating point type (7-bit significand)
Definition: Type.h:57
llvm::MVT::v7i32
@ v7i32
Definition: MachineValueType.h:106
llvm::MVT::v4i16
@ v4i16
Definition: MachineValueType.h:91
llvm::EVT::getTypeForEVT
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
Definition: ValueTypes.cpp:181
llvm::MVT::v4i8
@ v4i8
Definition: MachineValueType.h:78
Type.h
llvm::MVT::nxv4i16
@ nxv4i16
Definition: MachineValueType.h:206
llvm::EVT::isExtended
bool isExtended() const
Test if the given EVT is extended (as opposed to being simple).
Definition: ValueTypes.h:135
llvm::MVT::nxv16i16
@ nxv16i16
Definition: MachineValueType.h:208
llvm::MVT::f80
@ f80
Definition: MachineValueType.h:57
llvm::Type::isIntegerTy
bool isIntegerTy() const
True if this is an instance of IntegerType.
Definition: Type.h:190
llvm::MVT::v2i8
@ v2i8
Definition: MachineValueType.h:77
llvm::MVT::v4i64
@ v4i64
Definition: MachineValueType.h:120
llvm::VectorType
Base class of all SIMD vector types.
Definition: DerivedTypes.h:389
llvm::MVT::v32i16
@ v32i16
Definition: MachineValueType.h:94
llvm::MVT::nxv16i8
@ nxv16i8
Definition: MachineValueType.h:200
llvm::WithColor::warning
static raw_ostream & warning()
Convenience method for printing "warning: " to stderr.
Definition: WithColor.cpp:77
llvm::MVT::v5f32
@ v5f32
Definition: MachineValueType.h:158
llvm::MVT::nxv1bf16
@ nxv1bf16
Definition: MachineValueType.h:235
llvm::MVT::i64x8
@ i64x8
Definition: MachineValueType.h:273
llvm::MVT::nxv8i64
@ nxv8i64
Definition: MachineValueType.h:221
llvm::MVT::v16i8
@ v16i8
Definition: MachineValueType.h:80
llvm::EVT::getSizeInBits
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
Definition: ValueTypes.h:341
llvm::MVT::v16i16
@ v16i16
Definition: MachineValueType.h:93
llvm::MVT::v2i64
@ v2i64
Definition: MachineValueType.h:118
llvm::MVT::v2f16
@ v2f16
Definition: MachineValueType.h:134
llvm::MVT::v3i64
@ v3i64
Definition: MachineValueType.h:119
llvm::Type::X86_MMXTyID
@ X86_MMXTyID
MMX vectors (64 bits, X86 specific)
Definition: Type.h:66
llvm::MVT::v32i64
@ v32i64
Definition: MachineValueType.h:123
llvm::MVT::v16f32
@ v16f32
Definition: MachineValueType.h:162
llvm::MVT::externref
@ externref
Definition: MachineValueType.h:271
llvm::MVT::v128i8
@ v128i8
Definition: MachineValueType.h:83
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::MVT::v6f32
@ v6f32
Definition: MachineValueType.h:159
llvm::MVT::v1f32
@ v1f32
Definition: MachineValueType.h:154
llvm::MVT::nxv32i64
@ nxv32i64
Definition: MachineValueType.h:223
llvm::MVT::v32i1
@ v32i1
Definition: MachineValueType.h:69
llvm::EVT::getEVT
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition: ValueTypes.cpp:558
llvm::MVT::v2048f32
@ v2048f32
Definition: MachineValueType.h:169
StringExtras.h
llvm::MVT::v2bf16
@ v2bf16
Definition: MachineValueType.h:145
llvm::MVT::v4f32
@ v4f32
Definition: MachineValueType.h:157
llvm::MVT::i8
@ i8
Definition: MachineValueType.h:44
llvm::MVT::v128i16
@ v128i16
Definition: MachineValueType.h:96
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::v5i32
@ v5i32
Definition: MachineValueType.h:104
llvm::MVT::nxv16i32
@ nxv16i32
Definition: MachineValueType.h:215
llvm::MVT::Other
@ Other
Definition: MachineValueType.h:42
llvm::MVT::nxv64i1
@ nxv64i1
Definition: MachineValueType.h:194
llvm::MVT::nxv4i32
@ nxv4i32
Definition: MachineValueType.h:213
llvm::codeview::CompileSym2Flags::EC
@ EC
llvm::MVT
Machine Value Type.
Definition: MachineValueType.h:31
llvm::MVT::nxv4bf16
@ nxv4bf16
Definition: MachineValueType.h:237
llvm::Type::getX86_FP80Ty
static Type * getX86_FP80Ty(LLVMContext &C)
Definition: Type.cpp:232
llvm::MVT::v256i1
@ v256i1
Definition: MachineValueType.h:72
llvm::MVT::nxv1i64
@ nxv1i64
Definition: MachineValueType.h:218
llvm::MVT::bf16
@ bf16
Definition: MachineValueType.h:53
llvm::MVT::v3i32
@ v3i32
Definition: MachineValueType.h:102
llvm::MVT::getVectorVT
static MVT getVectorVT(MVT VT, unsigned NumElements)
Definition: MachineValueType.h:1177
llvm::Type::FP128TyID
@ FP128TyID
128-bit floating point type (112-bit significand)
Definition: Type.h:61
llvm::MVT::nxv2i32
@ nxv2i32
Definition: MachineValueType.h:212
llvm::MVT::nxv1f32
@ nxv1f32
Definition: MachineValueType.h:240
llvm::EVT::isVector
bool isVector() const
Return true if this is a vector value type.
Definition: ValueTypes.h:155
llvm::MVT::i64
@ i64
Definition: MachineValueType.h:47
llvm::MVT::v2i32
@ v2i32
Definition: MachineValueType.h:101
llvm::Type::PPC_FP128TyID
@ PPC_FP128TyID
128-bit floating point type (two 64-bits, PowerPC)
Definition: Type.h:62
llvm::EVT::getScalarSizeInBits
uint64_t getScalarSizeInBits() const
Definition: ValueTypes.h:353
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:134
llvm::MVT::v2f32
@ v2f32
Definition: MachineValueType.h:155
llvm::MVT::v64i8
@ v64i8
Definition: MachineValueType.h:82
llvm::MVT::nxv1i8
@ nxv1i8
Definition: MachineValueType.h:196
llvm::MVT::v64i16
@ v64i16
Definition: MachineValueType.h:95
llvm::MVT::nxv32i32
@ nxv32i32
Definition: MachineValueType.h:216
llvm::MVT::v4i32
@ v4i32
Definition: MachineValueType.h:103
llvm::MVT::iPTR
@ iPTR
Definition: MachineValueType.h:312
llvm::Type::getContext
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
Definition: Type.h:127
llvm::MVT::v512i1
@ v512i1
Definition: MachineValueType.h:73
llvm::MVT::v32i32
@ v32i32
Definition: MachineValueType.h:109
llvm::MVT::v1i128
@ v1i128
Definition: MachineValueType.h:128
llvm::Type::getInt128Ty
static IntegerType * getInt128Ty(LLVMContext &C)
Definition: Type.cpp:243
llvm::MVT::v128f32
@ v128f32
Definition: MachineValueType.h:165
llvm::MVT::v8i64
@ v8i64
Definition: MachineValueType.h:121
llvm::MVT::v64bf16
@ v64bf16
Definition: MachineValueType.h:151
llvm::Type::IntegerTyID
@ IntegerTyID
Arbitrary bit width integers.
Definition: Type.h:71
llvm::MVT::v16i32
@ v16i32
Definition: MachineValueType.h:108
llvm::MVT::v256i64
@ v256i64
Definition: MachineValueType.h:126
llvm::MVT::v1i32
@ v1i32
Definition: MachineValueType.h:100
llvm::EVT::getEVTString
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
Definition: ValueTypes.cpp:151
llvm::MVT::nxv64i8
@ nxv64i8
Definition: MachineValueType.h:202
llvm::MVT::nxv16i1
@ nxv16i1
Definition: MachineValueType.h:192
llvm::MVT::v8bf16
@ v8bf16
Definition: MachineValueType.h:148
llvm::MVT::nxv2i16
@ nxv2i16
Definition: MachineValueType.h:205
llvm::Type::getInt64Ty
static IntegerType * getInt64Ty(LLVMContext &C)
Definition: Type.cpp:242
llvm::MVT::Metadata
@ Metadata
Definition: MachineValueType.h:288
llvm::MVT::v128i64
@ v128i64
Definition: MachineValueType.h:125
llvm::MVT::v32f16
@ v32f16
Definition: MachineValueType.h:139
llvm::Type::getHalfTy
static Type * getHalfTy(LLVMContext &C)
Definition: Type.cpp:226
llvm::Type::FixedVectorTyID
@ FixedVectorTyID
Fixed width SIMD vector type.
Definition: Type.h:76
llvm::MVT::v256i8
@ v256i8
Definition: MachineValueType.h:84
llvm::Type::isIntOrIntVectorTy
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
Definition: Type.h:196
llvm::MVT::v8i16
@ v8i16
Definition: MachineValueType.h:92
llvm::TypeSize
Definition: TypeSize.h:417
llvm::BitWidth
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:147
llvm::MVT::i32
@ i32
Definition: MachineValueType.h:46
llvm::MVT::v512f16
@ v512f16
Definition: MachineValueType.h:143
llvm::Type::getBFloatTy
static Type * getBFloatTy(LLVMContext &C)
Definition: Type.cpp:227
llvm::MVT::nxv8i8
@ nxv8i8
Definition: MachineValueType.h:199
llvm::MVT::v512f32
@ v512f32
Definition: MachineValueType.h:167
llvm::MVT::v8i32
@ v8i32
Definition: MachineValueType.h:107
llvm::MVT::v3f32
@ v3f32
Definition: MachineValueType.h:156
llvm::MVT::nxv8i32
@ nxv8i32
Definition: MachineValueType.h:214
llvm::MVT::nxv1i16
@ nxv1i16
Definition: MachineValueType.h:204
llvm::MVT::nxv8f16
@ nxv8f16
Definition: MachineValueType.h:231
llvm::EVT::getVectorElementType
EVT getVectorElementType() const
Given a vector type, return the type of each element.
Definition: ValueTypes.h:301
llvm::Type::getVoidTy
static Type * getVoidTy(LLVMContext &C)
Definition: Type.cpp:224
llvm::MVT::v1024i1
@ v1024i1
Definition: MachineValueType.h:74
llvm::MVT::f128
@ f128
Definition: MachineValueType.h:58
llvm::MVT::v1i8
@ v1i8
Definition: MachineValueType.h:76
llvm::MVT::nxv8i1
@ nxv8i1
Definition: MachineValueType.h:191
llvm::MVT::v64f64
@ v64f64
Definition: MachineValueType.h:178
llvm::MVT::f16
@ f16
Definition: MachineValueType.h:54
llvm::MVT::v32f32
@ v32f32
Definition: MachineValueType.h:163
llvm::MVT::nxv1i1
@ nxv1i1
Definition: MachineValueType.h:188
llvm::MVT::getVT
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition: ValueTypes.cpp:526
llvm::MVT::Untyped
@ Untyped
Definition: MachineValueType.h:266
llvm::Type::getInt16Ty
static IntegerType * getInt16Ty(LLVMContext &C)
Definition: Type.cpp:240
llvm::Type::ScalableVectorTyID
@ ScalableVectorTyID
Scalable SIMD vector type.
Definition: Type.h:77
DerivedTypes.h
llvm::MVT::v1024i8
@ v1024i8
Definition: MachineValueType.h:86
llvm::MVT::v32i8
@ v32i8
Definition: MachineValueType.h:81
llvm::MVT::i16
@ i16
Definition: MachineValueType.h:45
llvm::IntegerType::get
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
Definition: Type.cpp:313
llvm::ScalableVectorType::get
static ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
Definition: Type.cpp:707
llvm::MVT::nxv32i1
@ nxv32i1
Definition: MachineValueType.h:193
llvm::MVT::v128f64
@ v128f64
Definition: MachineValueType.h:179
llvm::Type::getX86_MMXTy
static Type * getX86_MMXTy(LLVMContext &C)
Definition: Type.cpp:235
llvm::MVT::v8i8
@ v8i8
Definition: MachineValueType.h:79
llvm::MVT::nxv2i8
@ nxv2i8
Definition: MachineValueType.h:197
llvm::MVT::nxv16i64
@ nxv16i64
Definition: MachineValueType.h:222
llvm::MVT::v8f32
@ v8f32
Definition: MachineValueType.h:161
llvm::MVT::v2i16
@ v2i16
Definition: MachineValueType.h:89
llvm::MVT::v16i64
@ v16i64
Definition: MachineValueType.h:122
llvm::MVT::v128f16
@ v128f16
Definition: MachineValueType.h:141
llvm::MVT::f32
@ f32
Definition: MachineValueType.h:55
llvm::MVT::nxv1f16
@ nxv1f16
Definition: MachineValueType.h:228
llvm::MVT::v3bf16
@ v3bf16
Definition: MachineValueType.h:146
llvm::EVT::isFloatingPoint
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
Definition: ValueTypes.h:140
llvm::VectorType::get
static VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
Definition: Type.cpp:670
llvm::Type::HalfTyID
@ HalfTyID
16-bit floating point type
Definition: Type.h:56
llvm::Type::X86_FP80TyID
@ X86_FP80TyID
80-bit floating point type (X87)
Definition: Type.h:60
llvm::Type::getFloatTy
static Type * getFloatTy(LLVMContext &C)
Definition: Type.cpp:228
llvm::MVT::nxv8f64
@ nxv8f64
Definition: MachineValueType.h:249
llvm::MVT::v1024f32
@ v1024f32
Definition: MachineValueType.h:168
llvm::MVT::v4i1
@ v4i1
Definition: MachineValueType.h:66
llvm::MVT::getIntegerVT
static MVT getIntegerVT(unsigned BitWidth)
Definition: MachineValueType.h:1158
llvm::MVT::nxv8f32
@ nxv8f32
Definition: MachineValueType.h:243