LLVM 19.0.0git
LowLevelType.h
Go to the documentation of this file.
1//== llvm/CodeGenTypes/LowLevelType.h -------------------------- -*- 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/// \file
9/// Implement a low-level type suitable for MachineInstr level instruction
10/// selection.
11///
12/// For a type attached to a MachineInstr, we only care about 2 details: total
13/// size and the number of vector lanes (if any). Accordingly, there are 4
14/// possible valid type-kinds:
15///
16/// * `sN` for scalars and aggregates
17/// * `<N x sM>` for vectors, which must have at least 2 elements.
18/// * `pN` for pointers
19///
20/// Other information required for correct selection is expected to be carried
21/// by the opcode, or non-type flags. For example the distinction between G_ADD
22/// and G_FADD for int/float or fast-math flags.
23///
24//===----------------------------------------------------------------------===//
25
26#ifndef LLVM_CODEGEN_LOWLEVELTYPE_H
27#define LLVM_CODEGEN_LOWLEVELTYPE_H
28
31#include "llvm/Support/Debug.h"
32#include <cassert>
33
34namespace llvm {
35
36class Type;
37class raw_ostream;
38
39class LLT {
40public:
41 /// Get a low-level scalar or aggregate "bag of bits".
42 static constexpr LLT scalar(unsigned SizeInBits) {
43 return LLT{/*isPointer=*/false, /*isVector=*/false, /*isScalar=*/true,
44 ElementCount::getFixed(0), SizeInBits,
45 /*AddressSpace=*/0};
46 }
47
48 /// Get a low-level pointer in the given address space.
49 static constexpr LLT pointer(unsigned AddressSpace, unsigned SizeInBits) {
50 assert(SizeInBits > 0 && "invalid pointer size");
51 return LLT{/*isPointer=*/true, /*isVector=*/false, /*isScalar=*/false,
52 ElementCount::getFixed(0), SizeInBits, AddressSpace};
53 }
54
55 /// Get a low-level vector of some number of elements and element width.
56 static constexpr LLT vector(ElementCount EC, unsigned ScalarSizeInBits) {
57 assert(!EC.isScalar() && "invalid number of vector elements");
58 return LLT{/*isPointer=*/false, /*isVector=*/true, /*isScalar=*/false,
59 EC, ScalarSizeInBits, /*AddressSpace=*/0};
60 }
61
62 /// Get a low-level vector of some number of elements and element type.
63 static constexpr LLT vector(ElementCount EC, LLT ScalarTy) {
64 assert(!EC.isScalar() && "invalid number of vector elements");
65 assert(!ScalarTy.isVector() && "invalid vector element type");
66 return LLT{ScalarTy.isPointer(),
67 /*isVector=*/true,
68 /*isScalar=*/false,
69 EC,
70 ScalarTy.getSizeInBits().getFixedValue(),
71 ScalarTy.isPointer() ? ScalarTy.getAddressSpace() : 0};
72 }
73
74 /// Get a 16-bit IEEE half value.
75 /// TODO: Add IEEE semantics to type - This currently returns a simple `scalar(16)`.
76 static constexpr LLT float16() {
77 return scalar(16);
78 }
79
80 /// Get a 32-bit IEEE float value.
81 static constexpr LLT float32() {
82 return scalar(32);
83 }
84
85 /// Get a 64-bit IEEE double value.
86 static constexpr LLT float64() {
87 return scalar(64);
88 }
89
90 /// Get a low-level fixed-width vector of some number of elements and element
91 /// width.
92 static constexpr LLT fixed_vector(unsigned NumElements,
93 unsigned ScalarSizeInBits) {
94 return vector(ElementCount::getFixed(NumElements), ScalarSizeInBits);
95 }
96
97 /// Get a low-level fixed-width vector of some number of elements and element
98 /// type.
99 static constexpr LLT fixed_vector(unsigned NumElements, LLT ScalarTy) {
100 return vector(ElementCount::getFixed(NumElements), ScalarTy);
101 }
102
103 /// Get a low-level scalable vector of some number of elements and element
104 /// width.
105 static constexpr LLT scalable_vector(unsigned MinNumElements,
106 unsigned ScalarSizeInBits) {
107 return vector(ElementCount::getScalable(MinNumElements), ScalarSizeInBits);
108 }
109
110 /// Get a low-level scalable vector of some number of elements and element
111 /// type.
112 static constexpr LLT scalable_vector(unsigned MinNumElements, LLT ScalarTy) {
113 return vector(ElementCount::getScalable(MinNumElements), ScalarTy);
114 }
115
116 static constexpr LLT scalarOrVector(ElementCount EC, LLT ScalarTy) {
117 return EC.isScalar() ? ScalarTy : LLT::vector(EC, ScalarTy);
118 }
119
120 static constexpr LLT scalarOrVector(ElementCount EC, uint64_t ScalarSize) {
121 assert(ScalarSize <= std::numeric_limits<unsigned>::max() &&
122 "Not enough bits in LLT to represent size");
123 return scalarOrVector(EC, LLT::scalar(static_cast<unsigned>(ScalarSize)));
124 }
125
126 explicit constexpr LLT(bool isPointer, bool isVector, bool isScalar,
127 ElementCount EC, uint64_t SizeInBits,
128 unsigned AddressSpace)
129 : LLT() {
130 init(isPointer, isVector, isScalar, EC, SizeInBits, AddressSpace);
131 }
132 explicit constexpr LLT()
133 : IsScalar(false), IsPointer(false), IsVector(false), RawData(0) {}
134
135 explicit LLT(MVT VT);
136
137 constexpr bool isValid() const { return IsScalar || IsPointer || IsVector; }
138
139 constexpr bool isScalar() const { return IsScalar; }
140
141 constexpr bool isPointer() const { return IsPointer && !IsVector; }
142
143 constexpr bool isPointerVector() const { return IsPointer && IsVector; }
144
145 constexpr bool isPointerOrPointerVector() const { return IsPointer; }
146
147 constexpr bool isVector() const { return IsVector; }
148
149 /// Returns the number of elements in a vector LLT. Must only be called on
150 /// vector types.
151 constexpr uint16_t getNumElements() const {
152 if (isScalable())
154 "Possible incorrect use of LLT::getNumElements() for "
155 "scalable vector. Scalable flag may be dropped, use "
156 "LLT::getElementCount() instead");
158 }
159
160 /// Returns true if the LLT is a scalable vector. Must only be called on
161 /// vector types.
162 constexpr bool isScalable() const {
163 assert(isVector() && "Expected a vector type");
164 return IsPointer ? getFieldValue(PointerVectorScalableFieldInfo)
165 : getFieldValue(VectorScalableFieldInfo);
166 }
167
168 /// Returns true if the LLT is a fixed vector. Returns false otherwise, even
169 /// if the LLT is not a vector type.
170 constexpr bool isFixedVector() const { return isVector() && !isScalable(); }
171
172 /// Returns true if the LLT is a scalable vector. Returns false otherwise,
173 /// even if the LLT is not a vector type.
174 constexpr bool isScalableVector() const { return isVector() && isScalable(); }
175
176 constexpr ElementCount getElementCount() const {
177 assert(IsVector && "cannot get number of elements on scalar/aggregate");
178 return ElementCount::get(IsPointer
179 ? getFieldValue(PointerVectorElementsFieldInfo)
180 : getFieldValue(VectorElementsFieldInfo),
181 isScalable());
182 }
183
184 /// Returns the total size of the type. Must only be called on sized types.
185 constexpr TypeSize getSizeInBits() const {
186 if (isPointer() || isScalar())
188 auto EC = getElementCount();
189 return TypeSize(getScalarSizeInBits() * EC.getKnownMinValue(),
190 EC.isScalable());
191 }
192
193 /// Returns the total size of the type in bytes, i.e. number of whole bytes
194 /// needed to represent the size in bits. Must only be called on sized types.
195 constexpr TypeSize getSizeInBytes() const {
196 TypeSize BaseSize = getSizeInBits();
197 return {(BaseSize.getKnownMinValue() + 7) / 8, BaseSize.isScalable()};
198 }
199
200 constexpr LLT getScalarType() const {
201 return isVector() ? getElementType() : *this;
202 }
203
204 /// If this type is a vector, return a vector with the same number of elements
205 /// but the new element type. Otherwise, return the new element type.
206 constexpr LLT changeElementType(LLT NewEltTy) const {
207 return isVector() ? LLT::vector(getElementCount(), NewEltTy) : NewEltTy;
208 }
209
210 /// If this type is a vector, return a vector with the same number of elements
211 /// but the new element size. Otherwise, return the new element type. Invalid
212 /// for pointer types. For pointer types, use changeElementType.
213 constexpr LLT changeElementSize(unsigned NewEltSize) const {
215 "invalid to directly change element size for pointers");
216 return isVector() ? LLT::vector(getElementCount(), NewEltSize)
217 : LLT::scalar(NewEltSize);
218 }
219
220 /// Return a vector or scalar with the same element type and the new element
221 /// count.
222 constexpr LLT changeElementCount(ElementCount EC) const {
224 }
225
226 /// Return a type that is \p Factor times smaller. Reduces the number of
227 /// elements if this is a vector, or the bitwidth for scalar/pointers. Does
228 /// not attempt to handle cases that aren't evenly divisible.
229 constexpr LLT divide(int Factor) const {
230 assert(Factor != 1);
231 assert((!isScalar() || getScalarSizeInBits() != 0) &&
232 "cannot divide scalar of size zero");
233 if (isVector()) {
234 assert(getElementCount().isKnownMultipleOf(Factor));
235 return scalarOrVector(getElementCount().divideCoefficientBy(Factor),
237 }
238
239 assert(getScalarSizeInBits() % Factor == 0);
240 return scalar(getScalarSizeInBits() / Factor);
241 }
242
243 /// Produce a vector type that is \p Factor times bigger, preserving the
244 /// element type. For a scalar or pointer, this will produce a new vector with
245 /// \p Factor elements.
246 constexpr LLT multiplyElements(int Factor) const {
247 if (isVector()) {
248 return scalarOrVector(getElementCount().multiplyCoefficientBy(Factor),
250 }
251
252 return fixed_vector(Factor, *this);
253 }
254
255 constexpr bool isByteSized() const {
257 }
258
259 constexpr unsigned getScalarSizeInBits() const {
260 if (IsScalar)
261 return getFieldValue(ScalarSizeFieldInfo);
262 if (IsVector) {
263 if (!IsPointer)
264 return getFieldValue(VectorSizeFieldInfo);
265 else
266 return getFieldValue(PointerVectorSizeFieldInfo);
267 }
268 assert(IsPointer && "unexpected LLT");
269 return getFieldValue(PointerSizeFieldInfo);
270 }
271
272 constexpr unsigned getAddressSpace() const {
273 assert(RawData != 0 && "Invalid Type");
274 assert(IsPointer && "cannot get address space of non-pointer type");
275 if (!IsVector)
276 return getFieldValue(PointerAddressSpaceFieldInfo);
277 else
278 return getFieldValue(PointerVectorAddressSpaceFieldInfo);
279 }
280
281 /// Returns the vector's element type. Only valid for vector types.
282 constexpr LLT getElementType() const {
283 assert(isVector() && "cannot get element type of scalar/aggregate");
284 if (IsPointer)
286 else
287 return scalar(getScalarSizeInBits());
288 }
289
290 void print(raw_ostream &OS) const;
291
292#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
293 LLVM_DUMP_METHOD void dump() const;
294#endif
295
296 constexpr bool operator==(const LLT &RHS) const {
297 return IsPointer == RHS.IsPointer && IsVector == RHS.IsVector &&
298 IsScalar == RHS.IsScalar && RHS.RawData == RawData;
299 }
300
301 constexpr bool operator!=(const LLT &RHS) const { return !(*this == RHS); }
302
303 friend struct DenseMapInfo<LLT>;
305
306private:
307 /// LLT is packed into 64 bits as follows:
308 /// isScalar : 1
309 /// isPointer : 1
310 /// isVector : 1
311 /// with 61 bits remaining for Kind-specific data, packed in bitfields
312 /// as described below. As there isn't a simple portable way to pack bits
313 /// into bitfields, here the different fields in the packed structure is
314 /// described in static const *Field variables. Each of these variables
315 /// is a 2-element array, with the first element describing the bitfield size
316 /// and the second element describing the bitfield offset.
317 typedef int BitFieldInfo[2];
318 ///
319 /// This is how the bitfields are packed per Kind:
320 /// * Invalid:
321 /// gets encoded as RawData == 0, as that is an invalid encoding, since for
322 /// valid encodings, SizeInBits/SizeOfElement must be larger than 0.
323 /// * Non-pointer scalar (isPointer == 0 && isVector == 0):
324 /// SizeInBits: 32;
325 static const constexpr BitFieldInfo ScalarSizeFieldInfo{32, 0};
326 /// * Pointer (isPointer == 1 && isVector == 0):
327 /// SizeInBits: 16;
328 /// AddressSpace: 24;
329 static const constexpr BitFieldInfo PointerSizeFieldInfo{16, 0};
330 static const constexpr BitFieldInfo PointerAddressSpaceFieldInfo{
331 24, PointerSizeFieldInfo[0] + PointerSizeFieldInfo[1]};
332 static_assert((PointerAddressSpaceFieldInfo[0] +
333 PointerAddressSpaceFieldInfo[1]) <= 61,
334 "Insufficient bits to encode all data");
335 /// * Vector-of-non-pointer (isPointer == 0 && isVector == 1):
336 /// NumElements: 16;
337 /// SizeOfElement: 32;
338 /// Scalable: 1;
339 static const constexpr BitFieldInfo VectorElementsFieldInfo{16, 0};
340 static const constexpr BitFieldInfo VectorSizeFieldInfo{
341 32, VectorElementsFieldInfo[0] + VectorElementsFieldInfo[1]};
342 static const constexpr BitFieldInfo VectorScalableFieldInfo{
343 1, VectorSizeFieldInfo[0] + VectorSizeFieldInfo[1]};
344 static_assert((VectorSizeFieldInfo[0] + VectorSizeFieldInfo[1]) <= 61,
345 "Insufficient bits to encode all data");
346 /// * Vector-of-pointer (isPointer == 1 && isVector == 1):
347 /// NumElements: 16;
348 /// SizeOfElement: 16;
349 /// AddressSpace: 24;
350 /// Scalable: 1;
351 static const constexpr BitFieldInfo PointerVectorElementsFieldInfo{16, 0};
352 static const constexpr BitFieldInfo PointerVectorSizeFieldInfo{
353 16,
354 PointerVectorElementsFieldInfo[1] + PointerVectorElementsFieldInfo[0]};
355 static const constexpr BitFieldInfo PointerVectorAddressSpaceFieldInfo{
356 24, PointerVectorSizeFieldInfo[1] + PointerVectorSizeFieldInfo[0]};
357 static const constexpr BitFieldInfo PointerVectorScalableFieldInfo{
358 1, PointerVectorAddressSpaceFieldInfo[0] +
359 PointerVectorAddressSpaceFieldInfo[1]};
360 static_assert((PointerVectorAddressSpaceFieldInfo[0] +
361 PointerVectorAddressSpaceFieldInfo[1]) <= 61,
362 "Insufficient bits to encode all data");
363
364 uint64_t IsScalar : 1;
365 uint64_t IsPointer : 1;
366 uint64_t IsVector : 1;
367 uint64_t RawData : 61;
368
369 static constexpr uint64_t getMask(const BitFieldInfo FieldInfo) {
370 const int FieldSizeInBits = FieldInfo[0];
371 return (((uint64_t)1) << FieldSizeInBits) - 1;
372 }
373 static constexpr uint64_t maskAndShift(uint64_t Val, uint64_t Mask,
374 uint8_t Shift) {
375 assert(Val <= Mask && "Value too large for field");
376 return (Val & Mask) << Shift;
377 }
378 static constexpr uint64_t maskAndShift(uint64_t Val,
379 const BitFieldInfo FieldInfo) {
380 return maskAndShift(Val, getMask(FieldInfo), FieldInfo[1]);
381 }
382
383 constexpr uint64_t getFieldValue(const BitFieldInfo FieldInfo) const {
384 return getMask(FieldInfo) & (RawData >> FieldInfo[1]);
385 }
386
387 constexpr void init(bool IsPointer, bool IsVector, bool IsScalar,
388 ElementCount EC, uint64_t SizeInBits,
389 unsigned AddressSpace) {
390 assert(SizeInBits <= std::numeric_limits<unsigned>::max() &&
391 "Not enough bits in LLT to represent size");
392 this->IsPointer = IsPointer;
393 this->IsVector = IsVector;
394 this->IsScalar = IsScalar;
395 if (IsScalar)
396 RawData = maskAndShift(SizeInBits, ScalarSizeFieldInfo);
397 else if (IsVector) {
398 assert(EC.isVector() && "invalid number of vector elements");
399 if (!IsPointer)
400 RawData =
401 maskAndShift(EC.getKnownMinValue(), VectorElementsFieldInfo) |
402 maskAndShift(SizeInBits, VectorSizeFieldInfo) |
403 maskAndShift(EC.isScalable() ? 1 : 0, VectorScalableFieldInfo);
404 else
405 RawData =
406 maskAndShift(EC.getKnownMinValue(),
407 PointerVectorElementsFieldInfo) |
408 maskAndShift(SizeInBits, PointerVectorSizeFieldInfo) |
409 maskAndShift(AddressSpace, PointerVectorAddressSpaceFieldInfo) |
410 maskAndShift(EC.isScalable() ? 1 : 0,
411 PointerVectorScalableFieldInfo);
412 } else if (IsPointer)
413 RawData = maskAndShift(SizeInBits, PointerSizeFieldInfo) |
414 maskAndShift(AddressSpace, PointerAddressSpaceFieldInfo);
415 else
416 llvm_unreachable("unexpected LLT configuration");
417 }
418
419public:
420 constexpr uint64_t getUniqueRAWLLTData() const {
421 return ((uint64_t)RawData) << 3 | ((uint64_t)IsScalar) << 2 |
422 ((uint64_t)IsPointer) << 1 | ((uint64_t)IsVector);
423 }
424};
425
427 Ty.print(OS);
428 return OS;
429}
430
431template<> struct DenseMapInfo<LLT> {
432 static inline LLT getEmptyKey() {
433 LLT Invalid;
434 Invalid.IsPointer = true;
435 return Invalid;
436 }
437 static inline LLT getTombstoneKey() {
438 LLT Invalid;
439 Invalid.IsVector = true;
440 return Invalid;
441 }
442 static inline unsigned getHashValue(const LLT &Ty) {
443 uint64_t Val = Ty.getUniqueRAWLLTData();
445 }
446 static bool isEqual(const LLT &LHS, const LLT &RHS) {
447 return LHS == RHS;
448 }
449};
450
451}
452
453#endif // LLVM_CODEGEN_LOWLEVELTYPE_H
RelocType Type
Definition: COFFYAML.cpp:391
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition: Compiler.h:529
This file defines DenseMapInfo traits for DenseMap.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_pwrite_stream & OS
Value * RHS
Value * LHS
static constexpr ElementCount getScalable(ScalarTy MinVal)
Definition: TypeSize.h:299
static constexpr ElementCount getFixed(ScalarTy MinVal)
Definition: TypeSize.h:296
static constexpr ElementCount get(ScalarTy MinVal, bool Scalable)
Definition: TypeSize.h:302
static constexpr LLT float64()
Get a 64-bit IEEE double value.
Definition: LowLevelType.h:86
void print(raw_ostream &OS) const
constexpr bool isScalableVector() const
Returns true if the LLT is a scalable vector.
Definition: LowLevelType.h:174
static constexpr LLT scalarOrVector(ElementCount EC, uint64_t ScalarSize)
Definition: LowLevelType.h:120
constexpr unsigned getScalarSizeInBits() const
Definition: LowLevelType.h:259
constexpr LLT(bool isPointer, bool isVector, bool isScalar, ElementCount EC, uint64_t SizeInBits, unsigned AddressSpace)
Definition: LowLevelType.h:126
constexpr bool isScalar() const
Definition: LowLevelType.h:139
static constexpr LLT scalable_vector(unsigned MinNumElements, unsigned ScalarSizeInBits)
Get a low-level scalable vector of some number of elements and element width.
Definition: LowLevelType.h:105
constexpr bool operator==(const LLT &RHS) const
Definition: LowLevelType.h:296
constexpr LLT changeElementType(LLT NewEltTy) const
If this type is a vector, return a vector with the same number of elements but the new element type.
Definition: LowLevelType.h:206
constexpr LLT multiplyElements(int Factor) const
Produce a vector type that is Factor times bigger, preserving the element type.
Definition: LowLevelType.h:246
static constexpr LLT vector(ElementCount EC, unsigned ScalarSizeInBits)
Get a low-level vector of some number of elements and element width.
Definition: LowLevelType.h:56
constexpr bool isPointerVector() const
Definition: LowLevelType.h:143
static constexpr LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
Definition: LowLevelType.h:42
constexpr bool isValid() const
Definition: LowLevelType.h:137
constexpr uint16_t getNumElements() const
Returns the number of elements in a vector LLT.
Definition: LowLevelType.h:151
constexpr bool operator!=(const LLT &RHS) const
Definition: LowLevelType.h:301
constexpr bool isVector() const
Definition: LowLevelType.h:147
static constexpr LLT pointer(unsigned AddressSpace, unsigned SizeInBits)
Get a low-level pointer in the given address space.
Definition: LowLevelType.h:49
constexpr bool isScalable() const
Returns true if the LLT is a scalable vector.
Definition: LowLevelType.h:162
constexpr uint64_t getUniqueRAWLLTData() const
Definition: LowLevelType.h:420
constexpr bool isByteSized() const
Definition: LowLevelType.h:255
constexpr TypeSize getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.
Definition: LowLevelType.h:185
constexpr bool isPointer() const
Definition: LowLevelType.h:141
constexpr LLT()
Definition: LowLevelType.h:132
constexpr LLT getElementType() const
Returns the vector's element type. Only valid for vector types.
Definition: LowLevelType.h:282
static constexpr LLT vector(ElementCount EC, LLT ScalarTy)
Get a low-level vector of some number of elements and element type.
Definition: LowLevelType.h:63
constexpr ElementCount getElementCount() const
Definition: LowLevelType.h:176
constexpr LLT changeElementSize(unsigned NewEltSize) const
If this type is a vector, return a vector with the same number of elements but the new element size.
Definition: LowLevelType.h:213
static constexpr LLT fixed_vector(unsigned NumElements, LLT ScalarTy)
Get a low-level fixed-width vector of some number of elements and element type.
Definition: LowLevelType.h:99
static constexpr LLT float16()
Get a 16-bit IEEE half value.
Definition: LowLevelType.h:76
constexpr unsigned getAddressSpace() const
Definition: LowLevelType.h:272
static constexpr LLT fixed_vector(unsigned NumElements, unsigned ScalarSizeInBits)
Get a low-level fixed-width vector of some number of elements and element width.
Definition: LowLevelType.h:92
constexpr bool isPointerOrPointerVector() const
Definition: LowLevelType.h:145
constexpr bool isFixedVector() const
Returns true if the LLT is a fixed vector.
Definition: LowLevelType.h:170
constexpr LLT changeElementCount(ElementCount EC) const
Return a vector or scalar with the same element type and the new element count.
Definition: LowLevelType.h:222
LLVM_DUMP_METHOD void dump() const
constexpr LLT getScalarType() const
Definition: LowLevelType.h:200
constexpr TypeSize getSizeInBytes() const
Returns the total size of the type in bytes, i.e.
Definition: LowLevelType.h:195
static constexpr LLT scalable_vector(unsigned MinNumElements, LLT ScalarTy)
Get a low-level scalable vector of some number of elements and element type.
Definition: LowLevelType.h:112
static constexpr LLT scalarOrVector(ElementCount EC, LLT ScalarTy)
Definition: LowLevelType.h:116
static constexpr LLT float32()
Get a 32-bit IEEE float value.
Definition: LowLevelType.h:81
constexpr LLT divide(int Factor) const
Return a type that is Factor times smaller.
Definition: LowLevelType.h:229
Machine Value Type.
static constexpr TypeSize getFixed(ScalarTy ExactSize)
Definition: TypeSize.h:330
constexpr 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:180
constexpr ScalarTy getFixedValue() const
Definition: TypeSize.h:187
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
Definition: TypeSize.h:171
constexpr ScalarTy getKnownMinValue() const
Returns the minimum value this quantity can represent.
Definition: TypeSize.h:168
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
AddressSpace
Definition: NVPTXBaseInfo.h:21
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:38
@ Invalid
Denotes invalid value.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:293
static LLT getTombstoneKey()
Definition: LowLevelType.h:437
static bool isEqual(const LLT &LHS, const LLT &RHS)
Definition: LowLevelType.h:446
static unsigned getHashValue(const LLT &Ty)
Definition: LowLevelType.h:442
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition: DenseMapInfo.h:50