LLVM 19.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
12#include "llvm/IR/Type.h"
13#include "llvm/Support/Debug.h"
17using namespace llvm;
18
19EVT EVT::changeExtendedTypeToInteger() const {
20 assert(isExtended() && "Type is not extended!");
21 LLVMContext &Context = LLVMTy->getContext();
22 return getIntegerVT(Context, getSizeInBits());
23}
24
25EVT EVT::changeExtendedVectorElementTypeToInteger() const {
26 assert(isExtended() && "Type is not extended!");
27 LLVMContext &Context = LLVMTy->getContext();
28 EVT IntTy = getIntegerVT(Context, getScalarSizeInBits());
29 return getVectorVT(Context, IntTy, getVectorElementCount());
30}
31
32EVT EVT::changeExtendedVectorElementType(EVT EltVT) const {
33 assert(isExtended() && "Type is not extended!");
34 LLVMContext &Context = LLVMTy->getContext();
35 return getVectorVT(Context, EltVT, getVectorElementCount());
36}
37
38EVT EVT::getExtendedIntegerVT(LLVMContext &Context, unsigned BitWidth) {
39 EVT VT;
40 VT.LLVMTy = IntegerType::get(Context, BitWidth);
41 assert(VT.isExtended() && "Type is not extended!");
42 return VT;
43}
44
45EVT EVT::getExtendedVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements,
46 bool IsScalable) {
47 EVT ResultVT;
48 ResultVT.LLVMTy =
49 VectorType::get(VT.getTypeForEVT(Context), NumElements, IsScalable);
50 assert(ResultVT.isExtended() && "Type is not extended!");
51 return ResultVT;
52}
53
54EVT EVT::getExtendedVectorVT(LLVMContext &Context, EVT VT, ElementCount EC) {
55 EVT ResultVT;
56 ResultVT.LLVMTy = VectorType::get(VT.getTypeForEVT(Context), EC);
57 assert(ResultVT.isExtended() && "Type is not extended!");
58 return ResultVT;
59}
60
61bool EVT::isExtendedFloatingPoint() const {
62 assert(isExtended() && "Type is not extended!");
63 return LLVMTy->isFPOrFPVectorTy();
64}
65
66bool EVT::isExtendedInteger() const {
67 assert(isExtended() && "Type is not extended!");
68 return LLVMTy->isIntOrIntVectorTy();
69}
70
71bool EVT::isExtendedScalarInteger() const {
72 assert(isExtended() && "Type is not extended!");
73 return LLVMTy->isIntegerTy();
74}
75
76bool EVT::isExtendedVector() const {
77 assert(isExtended() && "Type is not extended!");
78 return LLVMTy->isVectorTy();
79}
80
81bool EVT::isExtended16BitVector() const {
82 return isExtendedVector() &&
83 getExtendedSizeInBits() == TypeSize::getFixed(16);
84}
85
86bool EVT::isExtended32BitVector() const {
87 return isExtendedVector() &&
88 getExtendedSizeInBits() == TypeSize::getFixed(32);
89}
90
91bool EVT::isExtended64BitVector() const {
92 return isExtendedVector() &&
93 getExtendedSizeInBits() == TypeSize::getFixed(64);
94}
95
96bool EVT::isExtended128BitVector() const {
97 return isExtendedVector() &&
98 getExtendedSizeInBits() == TypeSize::getFixed(128);
99}
100
101bool EVT::isExtended256BitVector() const {
102 return isExtendedVector() &&
103 getExtendedSizeInBits() == TypeSize::getFixed(256);
104}
105
106bool EVT::isExtended512BitVector() const {
107 return isExtendedVector() &&
108 getExtendedSizeInBits() == TypeSize::getFixed(512);
109}
110
111bool EVT::isExtended1024BitVector() const {
112 return isExtendedVector() &&
113 getExtendedSizeInBits() == TypeSize::getFixed(1024);
114}
115
116bool EVT::isExtended2048BitVector() const {
117 return isExtendedVector() &&
118 getExtendedSizeInBits() == TypeSize::getFixed(2048);
119}
120
121bool EVT::isExtendedFixedLengthVector() const {
122 return isExtendedVector() && isa<FixedVectorType>(LLVMTy);
123}
124
125bool EVT::isExtendedScalableVector() const {
126 return isExtendedVector() && isa<ScalableVectorType>(LLVMTy);
127}
128
129EVT EVT::getExtendedVectorElementType() const {
130 assert(isExtended() && "Type is not extended!");
131 return EVT::getEVT(cast<VectorType>(LLVMTy)->getElementType());
132}
133
134unsigned EVT::getExtendedVectorNumElements() const {
135 assert(isExtended() && "Type is not extended!");
136 ElementCount EC = cast<VectorType>(LLVMTy)->getElementCount();
137 if (EC.isScalable()) {
139 << "The code that requested the fixed number of elements has made the "
140 "assumption that this vector is not scalable. This assumption was "
141 "not correct, and this may lead to broken code\n";
142 }
143 return EC.getKnownMinValue();
144}
145
146ElementCount EVT::getExtendedVectorElementCount() const {
147 assert(isExtended() && "Type is not extended!");
148 return cast<VectorType>(LLVMTy)->getElementCount();
149}
150
151TypeSize EVT::getExtendedSizeInBits() const {
152 assert(isExtended() && "Type is not extended!");
153 if (IntegerType *ITy = dyn_cast<IntegerType>(LLVMTy))
154 return TypeSize::getFixed(ITy->getBitWidth());
155 if (VectorType *VTy = dyn_cast<VectorType>(LLVMTy))
156 return VTy->getPrimitiveSizeInBits();
157 llvm_unreachable("Unrecognized extended type!");
158}
159
160/// getEVTString - This function returns value type as a string, e.g. "i32".
161std::string EVT::getEVTString() const {
162 switch (V.SimpleTy) {
163 default:
164 if (isVector())
165 return (isScalableVector() ? "nxv" : "v") +
166 utostr(getVectorElementCount().getKnownMinValue()) +
168 if (isInteger())
169 return "i" + utostr(getSizeInBits());
170 if (isFloatingPoint())
171 return "f" + utostr(getSizeInBits());
172 llvm_unreachable("Invalid EVT!");
173 case MVT::bf16: return "bf16";
174 case MVT::ppcf128: return "ppcf128";
175 case MVT::isVoid: return "isVoid";
176 case MVT::Other: return "ch";
177 case MVT::Glue: return "glue";
178 case MVT::x86mmx: return "x86mmx";
179 case MVT::x86amx: return "x86amx";
180 case MVT::i64x8: return "i64x8";
181 case MVT::Metadata: return "Metadata";
182 case MVT::Untyped: return "Untyped";
183 case MVT::funcref: return "funcref";
184 case MVT::externref: return "externref";
185 case MVT::aarch64svcount:
186 return "aarch64svcount";
187 case MVT::spirvbuiltin:
188 return "spirvbuiltin";
189 }
190}
191
192#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
193void EVT::dump() const {
194 print(dbgs());
195 dbgs() << "\n";
196}
197#endif
198
199/// getTypeForEVT - This method returns an LLVM type corresponding to the
200/// specified EVT. For integer types, this returns an unsigned type. Note
201/// that this will abort for types that cannot be represented.
203 // clang-format off
204 switch (V.SimpleTy) {
205 default:
206 assert(isExtended() && "Type is not extended!");
207 return LLVMTy;
208 case MVT::isVoid: return Type::getVoidTy(Context);
209 case MVT::i1: return Type::getInt1Ty(Context);
210 case MVT::i2: return Type::getIntNTy(Context, 2);
211 case MVT::i4: return Type::getIntNTy(Context, 4);
212 case MVT::i8: return Type::getInt8Ty(Context);
213 case MVT::i16: return Type::getInt16Ty(Context);
214 case MVT::i32: return Type::getInt32Ty(Context);
215 case MVT::i64: return Type::getInt64Ty(Context);
216 case MVT::i128: return IntegerType::get(Context, 128);
217 case MVT::f16: return Type::getHalfTy(Context);
218 case MVT::bf16: return Type::getBFloatTy(Context);
219 case MVT::f32: return Type::getFloatTy(Context);
220 case MVT::f64: return Type::getDoubleTy(Context);
221 case MVT::f80: return Type::getX86_FP80Ty(Context);
222 case MVT::f128: return Type::getFP128Ty(Context);
223 case MVT::ppcf128: return Type::getPPC_FP128Ty(Context);
224 case MVT::x86mmx: return Type::getX86_MMXTy(Context);
225 case MVT::aarch64svcount:
226 return TargetExtType::get(Context, "aarch64.svcount");
227 case MVT::x86amx: return Type::getX86_AMXTy(Context);
228 case MVT::i64x8: return IntegerType::get(Context, 512);
229 case MVT::externref: return Type::getWasm_ExternrefTy(Context);
230 case MVT::funcref: return Type::getWasm_FuncrefTy(Context);
231 case MVT::v1i1:
233 case MVT::v2i1:
235 case MVT::v4i1:
237 case MVT::v8i1:
239 case MVT::v16i1:
241 case MVT::v32i1:
243 case MVT::v64i1:
245 case MVT::v128i1:
247 case MVT::v256i1:
249 case MVT::v512i1:
251 case MVT::v1024i1:
253 case MVT::v2048i1:
255 case MVT::v128i2:
257 case MVT::v256i2:
259 case MVT::v64i4:
261 case MVT::v128i4:
263 case MVT::v1i8:
265 case MVT::v2i8:
267 case MVT::v3i8:
269 case MVT::v4i8:
271 case MVT::v8i8:
273 case MVT::v16i8:
275 case MVT::v32i8:
277 case MVT::v64i8:
279 case MVT::v128i8:
281 case MVT::v256i8:
283 case MVT::v512i8:
285 case MVT::v1024i8:
287 case MVT::v1i16:
289 case MVT::v2i16:
291 case MVT::v3i16:
293 case MVT::v4i16:
295 case MVT::v8i16:
297 case MVT::v16i16:
299 case MVT::v32i16:
301 case MVT::v64i16:
303 case MVT::v128i16:
305 case MVT::v256i16:
307 case MVT::v512i16:
309 case MVT::v1i32:
311 case MVT::v2i32:
313 case MVT::v3i32:
315 case MVT::v4i32:
317 case MVT::v5i32:
319 case MVT::v6i32:
321 case MVT::v7i32:
323 case MVT::v8i32:
325 case MVT::v9i32:
327 case MVT::v10i32:
329 case MVT::v11i32:
331 case MVT::v12i32:
333 case MVT::v16i32:
335 case MVT::v32i32:
337 case MVT::v64i32:
339 case MVT::v128i32:
341 case MVT::v256i32:
343 case MVT::v512i32:
345 case MVT::v1024i32:
347 case MVT::v2048i32:
349 case MVT::v1i64:
351 case MVT::v2i64:
353 case MVT::v3i64:
355 case MVT::v4i64:
357 case MVT::v8i64:
359 case MVT::v16i64:
361 case MVT::v32i64:
363 case MVT::v64i64:
365 case MVT::v128i64:
367 case MVT::v256i64:
369 case MVT::v1i128:
371 case MVT::v1f16:
373 case MVT::v2f16:
375 case MVT::v3f16:
377 case MVT::v4f16:
379 case MVT::v8f16:
381 case MVT::v16f16:
383 case MVT::v32f16:
385 case MVT::v64f16:
387 case MVT::v128f16:
389 case MVT::v256f16:
391 case MVT::v512f16:
393 case MVT::v2bf16:
395 case MVT::v3bf16:
397 case MVT::v4bf16:
399 case MVT::v8bf16:
401 case MVT::v16bf16:
403 case MVT::v32bf16:
405 case MVT::v64bf16:
407 case MVT::v128bf16:
409 case MVT::v1f32:
411 case MVT::v2f32:
413 case MVT::v3f32:
415 case MVT::v4f32:
417 case MVT::v5f32:
419 case MVT::v6f32:
421 case MVT::v7f32:
423 case MVT::v8f32:
425 case MVT::v9f32:
427 case MVT::v10f32:
429 case MVT::v11f32:
431 case MVT::v12f32:
433 case MVT::v16f32:
435 case MVT::v32f32:
437 case MVT::v64f32:
439 case MVT::v128f32:
441 case MVT::v256f32:
443 case MVT::v512f32:
445 case MVT::v1024f32:
447 case MVT::v2048f32:
449 case MVT::v1f64:
451 case MVT::v2f64:
453 case MVT::v3f64:
455 case MVT::v4f64:
457 case MVT::v8f64:
459 case MVT::v16f64:
461 case MVT::v32f64:
463 case MVT::v64f64:
465 case MVT::v128f64:
467 case MVT::v256f64:
469 case MVT::nxv1i1:
471 case MVT::nxv2i1:
473 case MVT::nxv4i1:
475 case MVT::nxv8i1:
477 case MVT::nxv16i1:
479 case MVT::nxv32i1:
481 case MVT::nxv64i1:
483 case MVT::nxv1i8:
485 case MVT::nxv2i8:
487 case MVT::nxv4i8:
489 case MVT::nxv8i8:
491 case MVT::nxv16i8:
493 case MVT::nxv32i8:
495 case MVT::nxv64i8:
497 case MVT::nxv1i16:
499 case MVT::nxv2i16:
501 case MVT::nxv4i16:
503 case MVT::nxv8i16:
505 case MVT::nxv16i16:
507 case MVT::nxv32i16:
509 case MVT::nxv1i32:
511 case MVT::nxv2i32:
513 case MVT::nxv4i32:
515 case MVT::nxv8i32:
517 case MVT::nxv16i32:
519 case MVT::nxv32i32:
521 case MVT::nxv1i64:
523 case MVT::nxv2i64:
525 case MVT::nxv4i64:
527 case MVT::nxv8i64:
529 case MVT::nxv16i64:
531 case MVT::nxv32i64:
533 case MVT::nxv1f16:
535 case MVT::nxv2f16:
537 case MVT::nxv4f16:
539 case MVT::nxv8f16:
541 case MVT::nxv16f16:
543 case MVT::nxv32f16:
545 case MVT::nxv1bf16:
547 case MVT::nxv2bf16:
549 case MVT::nxv4bf16:
551 case MVT::nxv8bf16:
553 case MVT::nxv16bf16:
555 case MVT::nxv32bf16:
557 case MVT::nxv1f32:
559 case MVT::nxv2f32:
561 case MVT::nxv4f32:
563 case MVT::nxv8f32:
565 case MVT::nxv16f32:
567 case MVT::nxv1f64:
569 case MVT::nxv2f64:
571 case MVT::nxv4f64:
573 case MVT::nxv8f64:
575 case MVT::Metadata: return Type::getMetadataTy(Context);
576 }
577 // clang-format on
578}
579
580/// Return the value type corresponding to the specified type. This returns all
581/// pointers as MVT::iPTR. If HandleUnknown is true, unknown types are returned
582/// as Other, otherwise they are invalid.
583MVT MVT::getVT(Type *Ty, bool HandleUnknown){
584 assert(Ty != nullptr && "Invalid type");
585 switch (Ty->getTypeID()) {
586 default:
587 if (HandleUnknown) return MVT(MVT::Other);
588 llvm_unreachable("Unknown type!");
589 case Type::VoidTyID:
590 return MVT::isVoid;
592 return getIntegerVT(cast<IntegerType>(Ty)->getBitWidth());
593 case Type::HalfTyID: return MVT(MVT::f16);
594 case Type::BFloatTyID: return MVT(MVT::bf16);
595 case Type::FloatTyID: return MVT(MVT::f32);
596 case Type::DoubleTyID: return MVT(MVT::f64);
597 case Type::X86_FP80TyID: return MVT(MVT::f80);
598 case Type::X86_MMXTyID: return MVT(MVT::x86mmx);
599 case Type::TargetExtTyID: {
600 TargetExtType *TargetExtTy = cast<TargetExtType>(Ty);
601 if (TargetExtTy->getName() == "aarch64.svcount")
602 return MVT(MVT::aarch64svcount);
603 else if (TargetExtTy->getName().starts_with("spirv."))
604 return MVT(MVT::spirvbuiltin);
605 if (HandleUnknown)
606 return MVT(MVT::Other);
607 llvm_unreachable("Unknown target ext type!");
608 }
609 case Type::X86_AMXTyID: return MVT(MVT::x86amx);
610 case Type::FP128TyID: return MVT(MVT::f128);
611 case Type::PPC_FP128TyID: return MVT(MVT::ppcf128);
612 case Type::PointerTyID: return MVT(MVT::iPTR);
615 VectorType *VTy = cast<VectorType>(Ty);
616 return getVectorVT(
617 getVT(VTy->getElementType(), /*HandleUnknown=*/ false),
618 VTy->getElementCount());
619 }
620 }
621}
622
623/// getEVT - Return the value type corresponding to the specified type. This
624/// returns all pointers as MVT::iPTR. If HandleUnknown is true, unknown types
625/// are returned as Other, otherwise they are invalid.
626EVT EVT::getEVT(Type *Ty, bool HandleUnknown){
627 switch (Ty->getTypeID()) {
628 default:
629 return MVT::getVT(Ty, HandleUnknown);
631 return getIntegerVT(Ty->getContext(), cast<IntegerType>(Ty)->getBitWidth());
634 VectorType *VTy = cast<VectorType>(Ty);
635 return getVectorVT(Ty->getContext(),
636 getEVT(VTy->getElementType(), /*HandleUnknown=*/ false),
637 VTy->getElementCount());
638 }
639 }
640}
641
642#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
643void MVT::dump() const {
644 print(dbgs());
645 dbgs() << "\n";
646}
647#endif
648
651 OS << "invalid";
652 else
653 OS << EVT(*this).getEVTString();
654}
655
LLVMContext & Context
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_pwrite_stream & OS
This file contains some functions that are useful when dealing with strings.
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
static FixedVectorType * get(Type *ElementType, unsigned NumElts)
Definition: Type.cpp:692
Class to represent integer types.
Definition: DerivedTypes.h:40
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
Definition: Type.cpp:278
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:67
Machine Value Type.
void dump() const
Support for debugging, callable in GDB: VT.dump()
Definition: ValueTypes.cpp:643
SimpleValueType SimpleTy
@ INVALID_SIMPLE_VALUE_TYPE
constexpr MVT()=default
static MVT getVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition: ValueTypes.cpp:583
static MVT getVectorVT(MVT VT, unsigned NumElements)
static MVT getIntegerVT(unsigned BitWidth)
void print(raw_ostream &OS) const
Implement operator<<.
Definition: ValueTypes.cpp:649
static ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
Definition: Type.cpp:713
bool starts_with(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:257
Class to represent target extensions types, which are generally unintrospectable from target-independ...
Definition: DerivedTypes.h:720
static TargetExtType * get(LLVMContext &Context, StringRef Name, ArrayRef< Type * > Types=std::nullopt, ArrayRef< unsigned > Ints=std::nullopt)
Return a target extension type having the specified name and optional type and integer parameters.
Definition: Type.cpp:796
StringRef getName() const
Return the name for this target extension type.
Definition: DerivedTypes.h:741
static constexpr TypeSize getFixed(ScalarTy ExactSize)
Definition: TypeSize.h:332
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
static Type * getHalfTy(LLVMContext &C)
static Type * getDoubleTy(LLVMContext &C)
bool isVectorTy() const
True if this is an instance of VectorType.
Definition: Type.h:265
static Type * getX86_FP80Ty(LLVMContext &C)
static Type * getBFloatTy(LLVMContext &C)
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
Definition: Type.h:234
static IntegerType * getInt1Ty(LLVMContext &C)
static Type * getX86_AMXTy(LLVMContext &C)
static Type * getMetadataTy(LLVMContext &C)
@ X86_MMXTyID
MMX vectors (64 bits, X86 specific)
Definition: Type.h:66
@ X86_AMXTyID
AMX vectors (8192 bits, X86 specific)
Definition: Type.h:67
@ HalfTyID
16-bit floating point type
Definition: Type.h:56
@ TargetExtTyID
Target extension type.
Definition: Type.h:79
@ VoidTyID
type with no size
Definition: Type.h:63
@ ScalableVectorTyID
Scalable SIMD vector type.
Definition: Type.h:77
@ FloatTyID
32-bit floating point type
Definition: Type.h:58
@ IntegerTyID
Arbitrary bit width integers.
Definition: Type.h:71
@ FixedVectorTyID
Fixed width SIMD vector type.
Definition: Type.h:76
@ BFloatTyID
16-bit floating point type (7-bit significand)
Definition: Type.h:57
@ DoubleTyID
64-bit floating point type
Definition: Type.h:59
@ X86_FP80TyID
80-bit floating point type (X87)
Definition: Type.h:60
@ PPC_FP128TyID
128-bit floating point type (two 64-bits, PowerPC)
Definition: Type.h:62
@ PointerTyID
Pointers.
Definition: Type.h:73
@ FP128TyID
128-bit floating point type (112-bit significand)
Definition: Type.h:61
static Type * getX86_MMXTy(LLVMContext &C)
static IntegerType * getIntNTy(LLVMContext &C, unsigned N)
static Type * getVoidTy(LLVMContext &C)
static Type * getFP128Ty(LLVMContext &C)
static IntegerType * getInt16Ty(LLVMContext &C)
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
Definition: Type.h:129
static IntegerType * getInt8Ty(LLVMContext &C)
static IntegerType * getInt128Ty(LLVMContext &C)
static IntegerType * getInt32Ty(LLVMContext &C)
static IntegerType * getInt64Ty(LLVMContext &C)
static Type * getFloatTy(LLVMContext &C)
bool isIntegerTy() const
True if this is an instance of IntegerType.
Definition: Type.h:228
TypeID getTypeID() const
Return the type id for the type.
Definition: Type.h:137
static Type * getWasm_FuncrefTy(LLVMContext &C)
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
Definition: Type.h:216
static Type * getPPC_FP128Ty(LLVMContext &C)
static Type * getWasm_ExternrefTy(LLVMContext &C)
Base class of all SIMD vector types.
Definition: DerivedTypes.h:403
ElementCount getElementCount() const
Return an ElementCount instance to represent the (possibly scalable) number of elements in the vector...
Definition: DerivedTypes.h:641
static VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
Definition: Type.cpp:676
Type * getElementType() const
Definition: DerivedTypes.h:436
static raw_ostream & warning()
Convenience method for printing "warning: " to stderr.
Definition: WithColor.cpp:85
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:163
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:191
Extended Value Type.
Definition: ValueTypes.h:34
static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements, bool IsScalable=false)
Returns the EVT that represents a vector NumElements in length, where each element is of type VT.
Definition: ValueTypes.h:73
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
Definition: ValueTypes.h:139
ElementCount getVectorElementCount() const
Definition: ValueTypes.h:333
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
Definition: ValueTypes.h:351
uint64_t getScalarSizeInBits() const
Definition: ValueTypes.h:363
static EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
Definition: ValueTypes.cpp:626
void dump() const
Support for debugging, callable in GDB: VT.dump()
Definition: ValueTypes.cpp:193
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
Returns the EVT that represents an integer with the given number of bits.
Definition: ValueTypes.h:64
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
Definition: ValueTypes.cpp:161
bool isVector() const
Return true if this is a vector value type.
Definition: ValueTypes.h:160
Type * getTypeForEVT(LLVMContext &Context) const
This method returns an LLVM type corresponding to the specified EVT.
Definition: ValueTypes.cpp:202
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
Definition: ValueTypes.h:166
EVT getVectorElementType() const
Given a vector type, return the type of each element.
Definition: ValueTypes.h:311
bool isExtended() const
Test if the given EVT is extended (as opposed to being simple).
Definition: ValueTypes.h:134
void print(raw_ostream &OS) const
Implement operator<<.
Definition: ValueTypes.h:474
bool isInteger() const
Return true if this is an integer or a vector integer type.
Definition: ValueTypes.h:144