LLVM  13.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, getVectorNumElements(),
29 }
30 
31 EVT EVT::changeExtendedVectorElementType(EVT EltVT) const {
32  assert(isExtended() && "Type is not extended!");
33  LLVMContext &Context = LLVMTy->getContext();
34  return getVectorVT(Context, EltVT, getVectorElementCount());
35 }
36 
37 EVT EVT::getExtendedIntegerVT(LLVMContext &Context, unsigned BitWidth) {
38  EVT VT;
39  VT.LLVMTy = IntegerType::get(Context, BitWidth);
40  assert(VT.isExtended() && "Type is not extended!");
41  return VT;
42 }
43 
44 EVT EVT::getExtendedVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements,
45  bool IsScalable) {
46  EVT ResultVT;
47  ResultVT.LLVMTy =
48  VectorType::get(VT.getTypeForEVT(Context), NumElements, IsScalable);
49  assert(ResultVT.isExtended() && "Type is not extended!");
50  return ResultVT;
51 }
52 
53 EVT EVT::getExtendedVectorVT(LLVMContext &Context, EVT VT, ElementCount EC) {
54  EVT ResultVT;
55  ResultVT.LLVMTy = VectorType::get(VT.getTypeForEVT(Context), EC);
56  assert(ResultVT.isExtended() && "Type is not extended!");
57  return ResultVT;
58 }
59 
60 bool EVT::isExtendedFloatingPoint() const {
61  assert(isExtended() && "Type is not extended!");
62  return LLVMTy->isFPOrFPVectorTy();
63 }
64 
65 bool EVT::isExtendedInteger() const {
66  assert(isExtended() && "Type is not extended!");
67  return LLVMTy->isIntOrIntVectorTy();
68 }
69 
70 bool EVT::isExtendedScalarInteger() const {
71  assert(isExtended() && "Type is not extended!");
72  return LLVMTy->isIntegerTy();
73 }
74 
75 bool EVT::isExtendedVector() const {
76  assert(isExtended() && "Type is not extended!");
77  return LLVMTy->isVectorTy();
78 }
79 
80 bool EVT::isExtended16BitVector() const {
81  return isExtendedVector() && getExtendedSizeInBits() == 16;
82 }
83 
84 bool EVT::isExtended32BitVector() const {
85  return isExtendedVector() && getExtendedSizeInBits() == 32;
86 }
87 
88 bool EVT::isExtended64BitVector() const {
89  return isExtendedVector() && getExtendedSizeInBits() == 64;
90 }
91 
92 bool EVT::isExtended128BitVector() const {
93  return isExtendedVector() && getExtendedSizeInBits() == 128;
94 }
95 
96 bool EVT::isExtended256BitVector() const {
97  return isExtendedVector() && getExtendedSizeInBits() == 256;
98 }
99 
100 bool EVT::isExtended512BitVector() const {
101  return isExtendedVector() && getExtendedSizeInBits() == 512;
102 }
103 
104 bool EVT::isExtended1024BitVector() const {
105  return isExtendedVector() && getExtendedSizeInBits() == 1024;
106 }
107 
108 bool EVT::isExtended2048BitVector() const {
109  return isExtendedVector() && getExtendedSizeInBits() == 2048;
110 }
111 
112 bool EVT::isExtendedFixedLengthVector() const {
113  return isExtendedVector() && isa<FixedVectorType>(LLVMTy);
114 }
115 
116 bool EVT::isExtendedScalableVector() const {
117  return isExtendedVector() && isa<ScalableVectorType>(LLVMTy);
118 }
119 
120 EVT EVT::getExtendedVectorElementType() const {
121  assert(isExtended() && "Type is not extended!");
122  return EVT::getEVT(cast<VectorType>(LLVMTy)->getElementType());
123 }
124 
125 unsigned EVT::getExtendedVectorNumElements() const {
126  assert(isExtended() && "Type is not extended!");
127  ElementCount EC = cast<VectorType>(LLVMTy)->getElementCount();
128  if (EC.isScalable()) {
130  << "The code that requested the fixed number of elements has made the "
131  "assumption that this vector is not scalable. This assumption was "
132  "not correct, and this may lead to broken code\n";
133  }
134  return EC.getKnownMinValue();
135 }
136 
137 ElementCount EVT::getExtendedVectorElementCount() const {
138  assert(isExtended() && "Type is not extended!");
139  return cast<VectorType>(LLVMTy)->getElementCount();
140 }
141 
142 TypeSize EVT::getExtendedSizeInBits() const {
143  assert(isExtended() && "Type is not extended!");
144  if (IntegerType *ITy = dyn_cast<IntegerType>(LLVMTy))
145  return TypeSize::Fixed(ITy->getBitWidth());
146  if (VectorType *VTy = dyn_cast<VectorType>(LLVMTy))
147  return VTy->getPrimitiveSizeInBits();
148  llvm_unreachable("Unrecognized extended type!");
149 }
150 
151 /// getEVTString - This function returns value type as a string, e.g. "i32".
152 std::string EVT::getEVTString() const {
153  switch (V.SimpleTy) {
154  default:
155  if (isVector())
156  return (isScalableVector() ? "nxv" : "v") +
157  utostr(getVectorElementCount().getKnownMinValue()) +
159  if (isInteger())
160  return "i" + utostr(getSizeInBits());
161  if (isFloatingPoint())
162  return "f" + utostr(getSizeInBits());
163  llvm_unreachable("Invalid EVT!");
164  case MVT::bf16: return "bf16";
165  case MVT::ppcf128: return "ppcf128";
166  case MVT::isVoid: return "isVoid";
167  case MVT::Other: return "ch";
168  case MVT::Glue: return "glue";
169  case MVT::x86mmx: return "x86mmx";
170  case MVT::x86amx: return "x86amx";
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::v1i1:
204  case MVT::v2i1:
206  case MVT::v4i1:
208  case MVT::v8i1:
210  case MVT::v16i1:
212  case MVT::v32i1:
214  case MVT::v64i1:
216  case MVT::v128i1:
218  case MVT::v256i1:
220  case MVT::v512i1:
222  case MVT::v1024i1:
224  case MVT::v1i8:
226  case MVT::v2i8:
228  case MVT::v4i8:
230  case MVT::v8i8:
232  case MVT::v16i8:
234  case MVT::v32i8:
236  case MVT::v64i8:
238  case MVT::v128i8:
240  case MVT::v256i8:
242  case MVT::v1i16:
244  case MVT::v2i16:
246  case MVT::v3i16:
248  case MVT::v4i16:
250  case MVT::v8i16:
252  case MVT::v16i16:
254  case MVT::v32i16:
256  case MVT::v64i16:
258  case MVT::v128i16:
260  case MVT::v1i32:
262  case MVT::v2i32:
264  case MVT::v3i32:
266  case MVT::v4i32:
268  case MVT::v5i32:
270  case MVT::v8i32:
272  case MVT::v16i32:
274  case MVT::v32i32:
276  case MVT::v64i32:
278  case MVT::v128i32:
280  case MVT::v256i32:
282  case MVT::v512i32:
284  case MVT::v1024i32:
286  case MVT::v2048i32:
288  case MVT::v1i64:
290  case MVT::v2i64:
292  case MVT::v4i64:
294  case MVT::v8i64:
296  case MVT::v16i64:
298  case MVT::v32i64:
300  case MVT::v64i64:
302  case MVT::v128i64:
304  case MVT::v256i64:
306  case MVT::v1i128:
308  case MVT::v1f16:
310  case MVT::v2f16:
312  case MVT::v3f16:
314  case MVT::v4f16:
316  case MVT::v8f16:
318  case MVT::v16f16:
320  case MVT::v32f16:
322  case MVT::v64f16:
324  case MVT::v128f16:
326  case MVT::v2bf16:
328  case MVT::v3bf16:
330  case MVT::v4bf16:
332  case MVT::v8bf16:
334  case MVT::v16bf16:
336  case MVT::v32bf16:
338  case MVT::v64bf16:
340  case MVT::v128bf16:
342  case MVT::v1f32:
344  case MVT::v2f32:
346  case MVT::v3f32:
348  case MVT::v4f32:
350  case MVT::v5f32:
352  case MVT::v8f32:
354  case MVT::v16f32:
356  case MVT::v32f32:
358  case MVT::v64f32:
360  case MVT::v128f32:
362  case MVT::v256f32:
364  case MVT::v512f32:
366  case MVT::v1024f32:
368  case MVT::v2048f32:
370  case MVT::v1f64:
372  case MVT::v2f64:
374  case MVT::v4f64:
376  case MVT::v8f64:
378  case MVT::v16f64:
380  case MVT::v32f64:
382  case MVT::v64f64:
384  case MVT::v128f64:
386  case MVT::v256f64:
388  case MVT::nxv1i1:
390  case MVT::nxv2i1:
392  case MVT::nxv4i1:
394  case MVT::nxv8i1:
396  case MVT::nxv16i1:
398  case MVT::nxv32i1:
400  case MVT::nxv64i1:
402  case MVT::nxv1i8:
404  case MVT::nxv2i8:
406  case MVT::nxv4i8:
408  case MVT::nxv8i8:
410  case MVT::nxv16i8:
412  case MVT::nxv32i8:
414  case MVT::nxv64i8:
416  case MVT::nxv1i16:
418  case MVT::nxv2i16:
420  case MVT::nxv4i16:
422  case MVT::nxv8i16:
424  case MVT::nxv16i16:
426  case MVT::nxv32i16:
428  case MVT::nxv1i32:
430  case MVT::nxv2i32:
432  case MVT::nxv4i32:
434  case MVT::nxv8i32:
436  case MVT::nxv16i32:
438  case MVT::nxv32i32:
440  case MVT::nxv1i64:
442  case MVT::nxv2i64:
444  case MVT::nxv4i64:
446  case MVT::nxv8i64:
448  case MVT::nxv16i64:
450  case MVT::nxv32i64:
452  case MVT::nxv1f16:
454  case MVT::nxv2f16:
456  case MVT::nxv4f16:
458  case MVT::nxv8f16:
460  case MVT::nxv16f16:
462  case MVT::nxv32f16:
464  case MVT::nxv1bf16:
466  case MVT::nxv2bf16:
468  case MVT::nxv4bf16:
470  case MVT::nxv8bf16:
472  case MVT::nxv1f32:
474  case MVT::nxv2f32:
476  case MVT::nxv4f32:
478  case MVT::nxv8f32:
480  case MVT::nxv16f32:
482  case MVT::nxv1f64:
484  case MVT::nxv2f64:
486  case MVT::nxv4f64:
488  case MVT::nxv8f64:
491  }
492 }
493 
494 /// Return the value type corresponding to the specified type. This returns all
495 /// pointers as MVT::iPTR. If HandleUnknown is true, unknown types are returned
496 /// as Other, otherwise they are invalid.
497 MVT MVT::getVT(Type *Ty, bool HandleUnknown){
498  switch (Ty->getTypeID()) {
499  default:
500  if (HandleUnknown) return MVT(MVT::Other);
501  llvm_unreachable("Unknown type!");
502  case Type::VoidTyID:
503  return MVT::isVoid;
504  case Type::IntegerTyID:
505  return getIntegerVT(cast<IntegerType>(Ty)->getBitWidth());
506  case Type::HalfTyID: return MVT(MVT::f16);
507  case Type::BFloatTyID: return MVT(MVT::bf16);
508  case Type::FloatTyID: return MVT(MVT::f32);
509  case Type::DoubleTyID: return MVT(MVT::f64);
510  case Type::X86_FP80TyID: return MVT(MVT::f80);
511  case Type::X86_MMXTyID: return MVT(MVT::x86mmx);
512  case Type::X86_AMXTyID: return MVT(MVT::x86amx);
513  case Type::FP128TyID: return MVT(MVT::f128);
514  case Type::PPC_FP128TyID: return MVT(MVT::ppcf128);
515  case Type::PointerTyID: return MVT(MVT::iPTR);
518  VectorType *VTy = cast<VectorType>(Ty);
519  return getVectorVT(
520  getVT(VTy->getElementType(), /*HandleUnknown=*/ false),
521  VTy->getElementCount());
522  }
523  }
524 }
525 
526 /// getEVT - Return the value type corresponding to the specified type. This
527 /// returns all pointers as MVT::iPTR. If HandleUnknown is true, unknown types
528 /// are returned as Other, otherwise they are invalid.
529 EVT EVT::getEVT(Type *Ty, bool HandleUnknown){
530  switch (Ty->getTypeID()) {
531  default:
532  return MVT::getVT(Ty, HandleUnknown);
533  case Type::IntegerTyID:
534  return getIntegerVT(Ty->getContext(), cast<IntegerType>(Ty)->getBitWidth());
537  VectorType *VTy = cast<VectorType>(Ty);
538  return getVectorVT(Ty->getContext(),
539  getEVT(VTy->getElementType(), /*HandleUnknown=*/ false),
540  VTy->getElementCount());
541  }
542  }
543 }
llvm::MVT::v3i16
@ v3i16
Definition: MachineValueType.h:85
llvm::MVT::nxv4i1
@ nxv4i1
Definition: MachineValueType.h:175
llvm::MVT::v1i16
@ v1i16
Definition: MachineValueType.h:83
ValueTypes.h
llvm::MVT::nxv4i64
@ nxv4i64
Definition: MachineValueType.h:205
llvm::MVT::v16bf16
@ v16bf16
Definition: MachineValueType.h:137
llvm::Type::FloatTyID
@ FloatTyID
32-bit floating point type
Definition: Type.h:59
llvm::MVT::nxv2i1
@ nxv2i1
Definition: MachineValueType.h:174
llvm::MVT::v4f16
@ v4f16
Definition: MachineValueType.h:126
llvm::Type::DoubleTyID
@ DoubleTyID
64-bit floating point type
Definition: Type.h:60
llvm
Definition: AllocatorList.h:23
llvm::Type::getInt1Ty
static IntegerType * getInt1Ty(LLVMContext &C)
Definition: Type.cpp:201
llvm::MVT::v128i1
@ v128i1
Definition: MachineValueType.h:68
llvm::MVT::nxv1i32
@ nxv1i32
Definition: MachineValueType.h:196
llvm::MVT::nxv2f64
@ nxv2f64
Definition: MachineValueType.h:232
llvm::MVT::v1f64
@ v1f64
Definition: MachineValueType.h:157
llvm::EVT::getVectorElementCount
ElementCount getVectorElementCount() const
Definition: ValueTypes.h:315
llvm::Type::getFP128Ty
static Type * getFP128Ty(LLVMContext &C)
Definition: Type.cpp:196
llvm::ElementCount
Definition: TypeSize.h:386
llvm::MVT::v128i32
@ v128i32
Definition: MachineValueType.h:102
llvm::MVT::ppcf128
@ ppcf128
Definition: MachineValueType.h:56
llvm::MVT::nxv32f16
@ nxv32f16
Definition: MachineValueType.h:218
llvm::Type::VoidTyID
@ VoidTyID
type with no size
Definition: Type.h:64
llvm::MVT::v32f64
@ v32f64
Definition: MachineValueType.h:162
llvm::MVT::i128
@ i128
Definition: MachineValueType.h:45
llvm::MVT::nxv2f32
@ nxv2f32
Definition: MachineValueType.h:226
llvm::MVT::nxv16f16
@ nxv16f16
Definition: MachineValueType.h:217
llvm::MVT::v16f64
@ v16f64
Definition: MachineValueType.h:161
TypeSize.h
llvm::MVT::nxv1f64
@ nxv1f64
Definition: MachineValueType.h:231
llvm::MVT::v64f32
@ v64f32
Definition: MachineValueType.h:150
llvm::MVT::v2i1
@ v2i1
Definition: MachineValueType.h:62
ErrorHandling.h
llvm::MVT::v64i64
@ v64i64
Definition: MachineValueType.h:114
llvm::Type::X86_AMXTyID
@ X86_AMXTyID
AMX vectors (8192 bits, X86 specific)
Definition: Type.h:68
llvm::MVT::v512i32
@ v512i32
Definition: MachineValueType.h:104
llvm::MVT::nxv2i64
@ nxv2i64
Definition: MachineValueType.h:204
llvm::Type::getTypeID
TypeID getTypeID() const
Return the type id for the type.
Definition: Type.h:136
llvm::Type::isFPOrFPVectorTy
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
Definition: Type.h:190
llvm::MVT::Glue
@ Glue
Definition: MachineValueType.h:247
llvm::MVT::v64f16
@ v64f16
Definition: MachineValueType.h:130
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::MVT::nxv4f16
@ nxv4f16
Definition: MachineValueType.h:215
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::MVT::nxv4f64
@ nxv4f64
Definition: MachineValueType.h:233
llvm::VectorType::getElementType
Type * getElementType() const
Definition: DerivedTypes.h:424
getBitWidth
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
Definition: ValueTracking.cpp:87
llvm::MVT::v256i32
@ v256i32
Definition: MachineValueType.h:103
llvm::MVT::v2048i32
@ v2048i32
Definition: MachineValueType.h:106
llvm::MVT::v2f64
@ v2f64
Definition: MachineValueType.h:158
llvm::MVT::v3f16
@ v3f16
Definition: MachineValueType.h:125
llvm::Type::getInt8Ty
static IntegerType * getInt8Ty(LLVMContext &C)
Definition: Type.cpp:202
llvm::MVT::nxv8i16
@ nxv8i16
Definition: MachineValueType.h:192
llvm::Type::getInt32Ty
static IntegerType * getInt32Ty(LLVMContext &C)
Definition: Type.cpp:204
llvm::MVT::nxv32i16
@ nxv32i16
Definition: MachineValueType.h:194
llvm::MVT::v128bf16
@ v128bf16
Definition: MachineValueType.h:140
llvm::MVT::nxv8bf16
@ nxv8bf16
Definition: MachineValueType.h:223
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::MVT::v4bf16
@ v4bf16
Definition: MachineValueType.h:135
llvm::MVT::funcref
@ funcref
Definition: MachineValueType.h:255
llvm::Type::getMetadataTy
static Type * getMetadataTy(LLVMContext &C)
Definition: Type.cpp:193
llvm::MVT::v256f32
@ v256f32
Definition: MachineValueType.h:152
llvm::MVT::MVT
constexpr MVT()=default
llvm::MVT::i1
@ i1
Definition: MachineValueType.h:40
llvm::MVT::nxv16f32
@ nxv16f32
Definition: MachineValueType.h:229
llvm::MVT::v8f16
@ v8f16
Definition: MachineValueType.h:127
llvm::MVT::v8f64
@ v8f64
Definition: MachineValueType.h:160
llvm::Type::getX86_AMXTy
static Type * getX86_AMXTy(LLVMContext &C)
Definition: Type.cpp:199
llvm::MVT::nxv2bf16
@ nxv2bf16
Definition: MachineValueType.h:221
llvm::MVT::v32bf16
@ v32bf16
Definition: MachineValueType.h:138
llvm::Type::getPPC_FP128Ty
static Type * getPPC_FP128Ty(LLVMContext &C)
Definition: Type.cpp:197
llvm::EVT
Extended Value Type.
Definition: ValueTypes.h:35
llvm::MVT::v1f16
@ v1f16
Definition: MachineValueType.h:123
llvm::Type::getDoubleTy
static Type * getDoubleTy(LLVMContext &C)
Definition: Type.cpp:192
llvm::MVT::f64
@ f64
Definition: MachineValueType.h:53
llvm::EVT::getVectorNumElements
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
Definition: ValueTypes.h:301
llvm::MVT::x86amx
@ x86amx
Definition: MachineValueType.h:257
llvm::MVT::x86mmx
@ x86mmx
Definition: MachineValueType.h:245
llvm::MVT::SimpleTy
SimpleValueType SimpleTy
Definition: MachineValueType.h:302
llvm::MVT::v64i1
@ v64i1
Definition: MachineValueType.h:67
llvm::MVT::v64i32
@ v64i32
Definition: MachineValueType.h:101
llvm::MVT::nxv32i8
@ nxv32i8
Definition: MachineValueType.h:186
llvm::Type::isVectorTy
bool isVectorTy() const
True if this is an instance of VectorType.
Definition: Type.h:235
llvm::MVT::v16i1
@ v16i1
Definition: MachineValueType.h:65
llvm::MVT::nxv2f16
@ nxv2f16
Definition: MachineValueType.h:214
llvm::VectorType::getElementCount
ElementCount getElementCount() const
Return an ElementCount instance to represent the (possibly scalable) number of elements in the vector...
Definition: DerivedTypes.h:629
llvm::TypeSize::Fixed
static TypeSize Fixed(ScalarTy MinVal)
Definition: TypeSize.h:423
llvm::MVT::v256f64
@ v256f64
Definition: MachineValueType.h:165
llvm::MVT::isVoid
@ isVoid
Definition: MachineValueType.h:249
llvm::IntegerType
Class to represent integer types.
Definition: DerivedTypes.h:40
llvm::MVT::v8i1
@ v8i1
Definition: MachineValueType.h:64
llvm::MVT::v4f64
@ v4f64
Definition: MachineValueType.h:159
llvm::EVT::isInteger
bool isInteger() const
Return true if this is an integer or a vector integer type.
Definition: ValueTypes.h:139
llvm::MVT::v1i1
@ v1i1
Definition: MachineValueType.h:61
llvm::MVT::v16f16
@ v16f16
Definition: MachineValueType.h:128
llvm::MVT::nxv4i8
@ nxv4i8
Definition: MachineValueType.h:183
llvm::MVT::nxv4f32
@ nxv4f32
Definition: MachineValueType.h:227
llvm::MVT::v1024i32
@ v1024i32
Definition: MachineValueType.h:105
llvm::Type::PointerTyID
@ PointerTyID
Pointers.
Definition: Type.h:74
llvm::FixedVectorType::get
static FixedVectorType * get(Type *ElementType, unsigned NumElts)
Definition: Type.cpp:650
llvm::MVT::v1i64
@ v1i64
Definition: MachineValueType.h:108
llvm::Type::BFloatTyID
@ BFloatTyID
16-bit floating point type (7-bit significand)
Definition: Type.h:58
llvm::MVT::v4i16
@ v4i16
Definition: MachineValueType.h:86
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:75
Type.h
llvm::MVT::nxv4i16
@ nxv4i16
Definition: MachineValueType.h:191
llvm::EVT::isExtended
bool isExtended() const
Test if the given EVT is extended (as opposed to being simple).
Definition: ValueTypes.h:129
llvm::MVT::nxv16i16
@ nxv16i16
Definition: MachineValueType.h:193
llvm::MVT::f80
@ f80
Definition: MachineValueType.h:54
llvm::Type::isIntegerTy
bool isIntegerTy() const
True if this is an instance of IntegerType.
Definition: Type.h:202
llvm::MVT::v2i8
@ v2i8
Definition: MachineValueType.h:74
llvm::MVT::v4i64
@ v4i64
Definition: MachineValueType.h:110
llvm::VectorType
Base class of all SIMD vector types.
Definition: DerivedTypes.h:391
llvm::MVT::v32i16
@ v32i16
Definition: MachineValueType.h:89
llvm::MVT::nxv16i8
@ nxv16i8
Definition: MachineValueType.h:185
llvm::WithColor::warning
static raw_ostream & warning()
Convenience method for printing "warning: " to stderr.
Definition: WithColor.cpp:62
llvm::MVT::v5f32
@ v5f32
Definition: MachineValueType.h:146
llvm::MVT::nxv1bf16
@ nxv1bf16
Definition: MachineValueType.h:220
llvm::MVT::nxv8i64
@ nxv8i64
Definition: MachineValueType.h:206
llvm::MVT::v16i8
@ v16i8
Definition: MachineValueType.h:77
llvm::EVT::getSizeInBits
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
Definition: ValueTypes.h:333
llvm::MVT::v16i16
@ v16i16
Definition: MachineValueType.h:88
llvm::MVT::v2i64
@ v2i64
Definition: MachineValueType.h:109
llvm::MVT::v2f16
@ v2f16
Definition: MachineValueType.h:124
llvm::Type::X86_MMXTyID
@ X86_MMXTyID
MMX vectors (64 bits, X86 specific)
Definition: Type.h:67
llvm::MVT::v32i64
@ v32i64
Definition: MachineValueType.h:113
llvm::MVT::v16f32
@ v16f32
Definition: MachineValueType.h:148
llvm::MVT::externref
@ externref
Definition: MachineValueType.h:256
llvm::MVT::v128i8
@ v128i8
Definition: MachineValueType.h:80
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::MVT::v1f32
@ v1f32
Definition: MachineValueType.h:142
llvm::MVT::nxv32i64
@ nxv32i64
Definition: MachineValueType.h:208
llvm::MVT::v32i1
@ v32i1
Definition: MachineValueType.h:66
llvm::EVT::getEVT
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition: ValueTypes.cpp:529
llvm::MVT::v2048f32
@ v2048f32
Definition: MachineValueType.h:155
StringExtras.h
llvm::MVT::v2bf16
@ v2bf16
Definition: MachineValueType.h:133
llvm::MVT::v4f32
@ v4f32
Definition: MachineValueType.h:145
llvm::MVT::i8
@ i8
Definition: MachineValueType.h:41
llvm::MVT::v128i16
@ v128i16
Definition: MachineValueType.h:91
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:97
llvm::MVT::nxv16i32
@ nxv16i32
Definition: MachineValueType.h:200
llvm::MVT::Other
@ Other
Definition: MachineValueType.h:39
llvm::MVT::nxv64i1
@ nxv64i1
Definition: MachineValueType.h:179
llvm::MVT::nxv4i32
@ nxv4i32
Definition: MachineValueType.h:198
llvm::codeview::CompileSym2Flags::EC
@ EC
llvm::MVT
Machine Value Type.
Definition: MachineValueType.h:30
llvm::MVT::nxv4bf16
@ nxv4bf16
Definition: MachineValueType.h:222
llvm::Type::getX86_FP80Ty
static Type * getX86_FP80Ty(LLVMContext &C)
Definition: Type.cpp:195
llvm::MVT::v256i1
@ v256i1
Definition: MachineValueType.h:69
llvm::MVT::nxv1i64
@ nxv1i64
Definition: MachineValueType.h:203
llvm::MVT::bf16
@ bf16
Definition: MachineValueType.h:50
llvm::MVT::v3i32
@ v3i32
Definition: MachineValueType.h:95
llvm::MVT::getVectorVT
static MVT getVectorVT(MVT VT, unsigned NumElements)
Definition: MachineValueType.h:1119
llvm::Type::FP128TyID
@ FP128TyID
128-bit floating point type (112-bit significand)
Definition: Type.h:62
llvm::MVT::nxv2i32
@ nxv2i32
Definition: MachineValueType.h:197
llvm::MVT::nxv1f32
@ nxv1f32
Definition: MachineValueType.h:225
llvm::EVT::isVector
bool isVector() const
Return true if this is a vector value type.
Definition: ValueTypes.h:149
llvm::MVT::i64
@ i64
Definition: MachineValueType.h:44
llvm::MVT::v2i32
@ v2i32
Definition: MachineValueType.h:94
llvm::Type::PPC_FP128TyID
@ PPC_FP128TyID
128-bit floating point type (two 64-bits, PowerPC)
Definition: Type.h:63
llvm::EVT::getScalarSizeInBits
uint64_t getScalarSizeInBits() const
Definition: ValueTypes.h:345
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::MVT::v2f32
@ v2f32
Definition: MachineValueType.h:143
llvm::MVT::v64i8
@ v64i8
Definition: MachineValueType.h:79
llvm::MVT::nxv1i8
@ nxv1i8
Definition: MachineValueType.h:181
llvm::MVT::v64i16
@ v64i16
Definition: MachineValueType.h:90
llvm::MVT::nxv32i32
@ nxv32i32
Definition: MachineValueType.h:201
llvm::MVT::v4i32
@ v4i32
Definition: MachineValueType.h:96
llvm::MVT::iPTR
@ iPTR
Definition: MachineValueType.h:295
llvm::Type::getContext
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
Definition: Type.h:128
llvm::MVT::v512i1
@ v512i1
Definition: MachineValueType.h:70
llvm::MVT::v32i32
@ v32i32
Definition: MachineValueType.h:100
llvm::MVT::v1i128
@ v1i128
Definition: MachineValueType.h:118
llvm::Type::getInt128Ty
static IntegerType * getInt128Ty(LLVMContext &C)
Definition: Type.cpp:206
llvm::MVT::v128f32
@ v128f32
Definition: MachineValueType.h:151
llvm::MVT::v8i64
@ v8i64
Definition: MachineValueType.h:111
llvm::MVT::v64bf16
@ v64bf16
Definition: MachineValueType.h:139
llvm::Type::IntegerTyID
@ IntegerTyID
Arbitrary bit width integers.
Definition: Type.h:72
llvm::MVT::v16i32
@ v16i32
Definition: MachineValueType.h:99
llvm::MVT::v256i64
@ v256i64
Definition: MachineValueType.h:116
llvm::MVT::v1i32
@ v1i32
Definition: MachineValueType.h:93
llvm::EVT::getEVTString
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
Definition: ValueTypes.cpp:152
llvm::MVT::nxv64i8
@ nxv64i8
Definition: MachineValueType.h:187
llvm::MVT::nxv16i1
@ nxv16i1
Definition: MachineValueType.h:177
llvm::MVT::v8bf16
@ v8bf16
Definition: MachineValueType.h:136
llvm::MVT::nxv2i16
@ nxv2i16
Definition: MachineValueType.h:190
llvm::Type::getInt64Ty
static IntegerType * getInt64Ty(LLVMContext &C)
Definition: Type.cpp:205
llvm::MVT::Metadata
@ Metadata
Definition: MachineValueType.h:271
llvm::MVT::v128i64
@ v128i64
Definition: MachineValueType.h:115
llvm::MVT::v32f16
@ v32f16
Definition: MachineValueType.h:129
llvm::Type::getHalfTy
static Type * getHalfTy(LLVMContext &C)
Definition: Type.cpp:189
llvm::Type::FixedVectorTyID
@ FixedVectorTyID
Fixed width SIMD vector type.
Definition: Type.h:77
llvm::MVT::v256i8
@ v256i8
Definition: MachineValueType.h:81
llvm::Type::isIntOrIntVectorTy
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
Definition: Type.h:208
llvm::MVT::v8i16
@ v8i16
Definition: MachineValueType.h:87
llvm::TypeSize
Definition: TypeSize.h:417
llvm::BitWidth
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:147
llvm::MVT::i32
@ i32
Definition: MachineValueType.h:43
llvm::Type::getBFloatTy
static Type * getBFloatTy(LLVMContext &C)
Definition: Type.cpp:190
llvm::MVT::nxv8i8
@ nxv8i8
Definition: MachineValueType.h:184
llvm::MVT::v512f32
@ v512f32
Definition: MachineValueType.h:153
llvm::MVT::v8i32
@ v8i32
Definition: MachineValueType.h:98
llvm::MVT::v3f32
@ v3f32
Definition: MachineValueType.h:144
llvm::MVT::nxv8i32
@ nxv8i32
Definition: MachineValueType.h:199
llvm::MVT::nxv1i16
@ nxv1i16
Definition: MachineValueType.h:189
llvm::MVT::nxv8f16
@ nxv8f16
Definition: MachineValueType.h:216
llvm::EVT::getVectorElementType
EVT getVectorElementType() const
Given a vector type, return the type of each element.
Definition: ValueTypes.h:293
llvm::Type::getVoidTy
static Type * getVoidTy(LLVMContext &C)
Definition: Type.cpp:187
llvm::MVT::v1024i1
@ v1024i1
Definition: MachineValueType.h:71
llvm::MVT::f128
@ f128
Definition: MachineValueType.h:55
llvm::MVT::v1i8
@ v1i8
Definition: MachineValueType.h:73
llvm::MVT::nxv8i1
@ nxv8i1
Definition: MachineValueType.h:176
llvm::MVT::v64f64
@ v64f64
Definition: MachineValueType.h:163
llvm::MVT::f16
@ f16
Definition: MachineValueType.h:51
llvm::MVT::v32f32
@ v32f32
Definition: MachineValueType.h:149
llvm::MVT::nxv1i1
@ nxv1i1
Definition: MachineValueType.h:173
llvm::MVT::getVT
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition: ValueTypes.cpp:497
llvm::MVT::Untyped
@ Untyped
Definition: MachineValueType.h:251
llvm::Type::getInt16Ty
static IntegerType * getInt16Ty(LLVMContext &C)
Definition: Type.cpp:203
llvm::Type::ScalableVectorTyID
@ ScalableVectorTyID
Scalable SIMD vector type.
Definition: Type.h:78
DerivedTypes.h
llvm::MVT::v32i8
@ v32i8
Definition: MachineValueType.h:78
llvm::MVT::i16
@ i16
Definition: MachineValueType.h:42
llvm::IntegerType::get
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
Definition: Type.cpp:276
llvm::ScalableVectorType::get
static ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
Definition: Type.cpp:671
llvm::MVT::nxv32i1
@ nxv32i1
Definition: MachineValueType.h:178
llvm::MVT::v128f64
@ v128f64
Definition: MachineValueType.h:164
llvm::Type::getX86_MMXTy
static Type * getX86_MMXTy(LLVMContext &C)
Definition: Type.cpp:198
llvm::MVT::v8i8
@ v8i8
Definition: MachineValueType.h:76
llvm::MVT::nxv2i8
@ nxv2i8
Definition: MachineValueType.h:182
llvm::MVT::nxv16i64
@ nxv16i64
Definition: MachineValueType.h:207
llvm::MVT::v8f32
@ v8f32
Definition: MachineValueType.h:147
llvm::MVT::v2i16
@ v2i16
Definition: MachineValueType.h:84
llvm::MVT::v16i64
@ v16i64
Definition: MachineValueType.h:112
llvm::MVT::v128f16
@ v128f16
Definition: MachineValueType.h:131
llvm::MVT::f32
@ f32
Definition: MachineValueType.h:52
llvm::MVT::nxv1f16
@ nxv1f16
Definition: MachineValueType.h:213
llvm::MVT::v3bf16
@ v3bf16
Definition: MachineValueType.h:134
llvm::EVT::isFloatingPoint
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
Definition: ValueTypes.h:134
llvm::VectorType::get
static VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
Definition: Type.cpp:634
llvm::Type::HalfTyID
@ HalfTyID
16-bit floating point type
Definition: Type.h:57
llvm::Type::X86_FP80TyID
@ X86_FP80TyID
80-bit floating point type (X87)
Definition: Type.h:61
llvm::Type::getFloatTy
static Type * getFloatTy(LLVMContext &C)
Definition: Type.cpp:191
llvm::MVT::nxv8f64
@ nxv8f64
Definition: MachineValueType.h:234
llvm::MVT::v1024f32
@ v1024f32
Definition: MachineValueType.h:154
llvm::MVT::v4i1
@ v4i1
Definition: MachineValueType.h:63
llvm::MVT::getIntegerVT
static MVT getIntegerVT(unsigned BitWidth)
Definition: MachineValueType.h:1100
llvm::MVT::nxv8f32
@ nxv8f32
Definition: MachineValueType.h:228