LLVM  14.0.0git
LowLevelTypeImpl.h
Go to the documentation of this file.
1 //== llvm/Support/LowLevelTypeImpl.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_SUPPORT_LOWLEVELTYPEIMPL_H
27 #define LLVM_SUPPORT_LOWLEVELTYPEIMPL_H
28 
29 #include "llvm/ADT/DenseMapInfo.h"
30 #include "llvm/Support/Debug.h"
32 #include <cassert>
33 
34 namespace llvm {
35 
36 class Type;
37 class raw_ostream;
38 
39 class LLT {
40 public:
41  /// Get a low-level scalar or aggregate "bag of bits".
42  static 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 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 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 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(), /*isVector=*/true, /*isScalar=*/false,
67  EC,
68  ScalarTy.getSizeInBits().getFixedSize(),
69  ScalarTy.isPointer() ? ScalarTy.getAddressSpace() : 0};
70  }
71 
72  /// Get a low-level fixed-width vector of some number of elements and element
73  /// width.
74  static LLT fixed_vector(unsigned NumElements, unsigned ScalarSizeInBits) {
75  return vector(ElementCount::getFixed(NumElements), ScalarSizeInBits);
76  }
77 
78  /// Get a low-level fixed-width vector of some number of elements and element
79  /// type.
80  static LLT fixed_vector(unsigned NumElements, LLT ScalarTy) {
81  return vector(ElementCount::getFixed(NumElements), ScalarTy);
82  }
83 
84  /// Get a low-level scalable vector of some number of elements and element
85  /// width.
86  static LLT scalable_vector(unsigned MinNumElements,
87  unsigned ScalarSizeInBits) {
88  return vector(ElementCount::getScalable(MinNumElements), ScalarSizeInBits);
89  }
90 
91  /// Get a low-level scalable vector of some number of elements and element
92  /// type.
93  static LLT scalable_vector(unsigned MinNumElements, LLT ScalarTy) {
94  return vector(ElementCount::getScalable(MinNumElements), ScalarTy);
95  }
96 
97  static LLT scalarOrVector(ElementCount EC, LLT ScalarTy) {
98  return EC.isScalar() ? ScalarTy : LLT::vector(EC, ScalarTy);
99  }
100 
101  static LLT scalarOrVector(ElementCount EC, uint64_t ScalarSize) {
102  assert(ScalarSize <= std::numeric_limits<unsigned>::max() &&
103  "Not enough bits in LLT to represent size");
104  return scalarOrVector(EC, LLT::scalar(static_cast<unsigned>(ScalarSize)));
105  }
106 
107  explicit LLT(bool isPointer, bool isVector, bool isScalar, ElementCount EC,
108  uint64_t SizeInBits, unsigned AddressSpace) {
109  init(isPointer, isVector, isScalar, EC, SizeInBits, AddressSpace);
110  }
111  explicit LLT()
112  : IsScalar(false), IsPointer(false), IsVector(false), RawData(0) {}
113 
114  explicit LLT(MVT VT);
115 
116  bool isValid() const { return IsScalar || RawData != 0; }
117 
118  bool isScalar() const { return IsScalar; }
119 
120  bool isPointer() const { return isValid() && IsPointer && !IsVector; }
121 
122  bool isVector() const { return isValid() && IsVector; }
123 
124  /// Returns the number of elements in a vector LLT. Must only be called on
125  /// vector types.
127  if (isScalable())
129  "Possible incorrect use of LLT::getNumElements() for "
130  "scalable vector. Scalable flag may be dropped, use "
131  "LLT::getElementCount() instead");
133  }
134 
135  /// Returns true if the LLT is a scalable vector. Must only be called on
136  /// vector types.
137  bool isScalable() const {
138  assert(isVector() && "Expected a vector type");
139  return IsPointer ? getFieldValue(PointerVectorScalableFieldInfo)
140  : getFieldValue(VectorScalableFieldInfo);
141  }
142 
144  assert(IsVector && "cannot get number of elements on scalar/aggregate");
145  return ElementCount::get(IsPointer
146  ? getFieldValue(PointerVectorElementsFieldInfo)
147  : getFieldValue(VectorElementsFieldInfo),
148  isScalable());
149  }
150 
151  /// Returns the total size of the type. Must only be called on sized types.
153  if (isPointer() || isScalar())
155  auto EC = getElementCount();
156  return TypeSize(getScalarSizeInBits() * EC.getKnownMinValue(),
157  EC.isScalable());
158  }
159 
160  /// Returns the total size of the type in bytes, i.e. number of whole bytes
161  /// needed to represent the size in bits. Must only be called on sized types.
163  TypeSize BaseSize = getSizeInBits();
164  return {(BaseSize.getKnownMinSize() + 7) / 8, BaseSize.isScalable()};
165  }
166 
167  LLT getScalarType() const {
168  return isVector() ? getElementType() : *this;
169  }
170 
171  /// If this type is a vector, return a vector with the same number of elements
172  /// but the new element type. Otherwise, return the new element type.
173  LLT changeElementType(LLT NewEltTy) const {
174  return isVector() ? LLT::vector(getElementCount(), NewEltTy) : NewEltTy;
175  }
176 
177  /// If this type is a vector, return a vector with the same number of elements
178  /// but the new element size. Otherwise, return the new element type. Invalid
179  /// for pointer types. For pointer types, use changeElementType.
180  LLT changeElementSize(unsigned NewEltSize) const {
182  "invalid to directly change element size for pointers");
183  return isVector() ? LLT::vector(getElementCount(), NewEltSize)
184  : LLT::scalar(NewEltSize);
185  }
186 
187  /// Return a vector or scalar with the same element type and the new element
188  /// count.
190  return LLT::scalarOrVector(EC, getScalarType());
191  }
192 
193  /// Return a type that is \p Factor times smaller. Reduces the number of
194  /// elements if this is a vector, or the bitwidth for scalar/pointers. Does
195  /// not attempt to handle cases that aren't evenly divisible.
196  LLT divide(int Factor) const {
197  assert(Factor != 1);
198  assert((!isScalar() || getScalarSizeInBits() != 0) &&
199  "cannot divide scalar of size zero");
200  if (isVector()) {
201  assert(getElementCount().isKnownMultipleOf(Factor));
202  return scalarOrVector(getElementCount().divideCoefficientBy(Factor),
203  getElementType());
204  }
205 
206  assert(getScalarSizeInBits() % Factor == 0);
207  return scalar(getScalarSizeInBits() / Factor);
208  }
209 
210  bool isByteSized() const { return getSizeInBits().isKnownMultipleOf(8); }
211 
212  unsigned getScalarSizeInBits() const {
213  if (IsScalar)
214  return getFieldValue(ScalarSizeFieldInfo);
215  if (IsVector) {
216  if (!IsPointer)
217  return getFieldValue(VectorSizeFieldInfo);
218  else
219  return getFieldValue(PointerVectorSizeFieldInfo);
220  } else if (IsPointer)
221  return getFieldValue(PointerSizeFieldInfo);
222  else
223  llvm_unreachable("unexpected LLT");
224  }
225 
226  unsigned getAddressSpace() const {
227  assert(RawData != 0 && "Invalid Type");
228  assert(IsPointer && "cannot get address space of non-pointer type");
229  if (!IsVector)
230  return getFieldValue(PointerAddressSpaceFieldInfo);
231  else
232  return getFieldValue(PointerVectorAddressSpaceFieldInfo);
233  }
234 
235  /// Returns the vector's element type. Only valid for vector types.
236  LLT getElementType() const {
237  assert(isVector() && "cannot get element type of scalar/aggregate");
238  if (IsPointer)
240  else
241  return scalar(getScalarSizeInBits());
242  }
243 
244  void print(raw_ostream &OS) const;
245 
246 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
247  LLVM_DUMP_METHOD void dump() const {
248  print(dbgs());
249  dbgs() << '\n';
250  }
251 #endif
252 
253  bool operator==(const LLT &RHS) const {
254  return IsPointer == RHS.IsPointer && IsVector == RHS.IsVector &&
255  IsScalar == RHS.IsScalar && RHS.RawData == RawData;
256  }
257 
258  bool operator!=(const LLT &RHS) const { return !(*this == RHS); }
259 
260  friend struct DenseMapInfo<LLT>;
262 
263 private:
264  /// LLT is packed into 64 bits as follows:
265  /// isScalar : 1
266  /// isPointer : 1
267  /// isVector : 1
268  /// with 61 bits remaining for Kind-specific data, packed in bitfields
269  /// as described below. As there isn't a simple portable way to pack bits
270  /// into bitfields, here the different fields in the packed structure is
271  /// described in static const *Field variables. Each of these variables
272  /// is a 2-element array, with the first element describing the bitfield size
273  /// and the second element describing the bitfield offset.
274  typedef int BitFieldInfo[2];
275  ///
276  /// This is how the bitfields are packed per Kind:
277  /// * Invalid:
278  /// gets encoded as RawData == 0, as that is an invalid encoding, since for
279  /// valid encodings, SizeInBits/SizeOfElement must be larger than 0.
280  /// * Non-pointer scalar (isPointer == 0 && isVector == 0):
281  /// SizeInBits: 32;
282  static const constexpr BitFieldInfo ScalarSizeFieldInfo{32, 0};
283  /// * Pointer (isPointer == 1 && isVector == 0):
284  /// SizeInBits: 16;
285  /// AddressSpace: 24;
286  static const constexpr BitFieldInfo PointerSizeFieldInfo{16, 0};
287  static const constexpr BitFieldInfo PointerAddressSpaceFieldInfo{
288  24, PointerSizeFieldInfo[0] + PointerSizeFieldInfo[1]};
289  static_assert((PointerAddressSpaceFieldInfo[0] +
290  PointerAddressSpaceFieldInfo[1]) <= 61,
291  "Insufficient bits to encode all data");
292  /// * Vector-of-non-pointer (isPointer == 0 && isVector == 1):
293  /// NumElements: 16;
294  /// SizeOfElement: 32;
295  /// Scalable: 1;
296  static const constexpr BitFieldInfo VectorElementsFieldInfo{16, 0};
297  static const constexpr BitFieldInfo VectorSizeFieldInfo{
298  32, VectorElementsFieldInfo[0] + VectorElementsFieldInfo[1]};
299  static const constexpr BitFieldInfo VectorScalableFieldInfo{
300  1, VectorSizeFieldInfo[0] + VectorSizeFieldInfo[1]};
301  static_assert((VectorSizeFieldInfo[0] + VectorSizeFieldInfo[1]) <= 61,
302  "Insufficient bits to encode all data");
303  /// * Vector-of-pointer (isPointer == 1 && isVector == 1):
304  /// NumElements: 16;
305  /// SizeOfElement: 16;
306  /// AddressSpace: 24;
307  /// Scalable: 1;
308  static const constexpr BitFieldInfo PointerVectorElementsFieldInfo{16, 0};
309  static const constexpr BitFieldInfo PointerVectorSizeFieldInfo{
310  16,
311  PointerVectorElementsFieldInfo[1] + PointerVectorElementsFieldInfo[0]};
312  static const constexpr BitFieldInfo PointerVectorAddressSpaceFieldInfo{
313  24, PointerVectorSizeFieldInfo[1] + PointerVectorSizeFieldInfo[0]};
314  static const constexpr BitFieldInfo PointerVectorScalableFieldInfo{
315  1, PointerVectorAddressSpaceFieldInfo[0] +
316  PointerVectorAddressSpaceFieldInfo[1]};
317  static_assert((PointerVectorAddressSpaceFieldInfo[0] +
318  PointerVectorAddressSpaceFieldInfo[1]) <= 61,
319  "Insufficient bits to encode all data");
320 
321  uint64_t IsScalar : 1;
322  uint64_t IsPointer : 1;
323  uint64_t IsVector : 1;
324  uint64_t RawData : 61;
325 
326  static uint64_t getMask(const BitFieldInfo FieldInfo) {
327  const int FieldSizeInBits = FieldInfo[0];
328  return (((uint64_t)1) << FieldSizeInBits) - 1;
329  }
330  static uint64_t maskAndShift(uint64_t Val, uint64_t Mask, uint8_t Shift) {
331  assert(Val <= Mask && "Value too large for field");
332  return (Val & Mask) << Shift;
333  }
334  static uint64_t maskAndShift(uint64_t Val, const BitFieldInfo FieldInfo) {
335  return maskAndShift(Val, getMask(FieldInfo), FieldInfo[1]);
336  }
337  uint64_t getFieldValue(const BitFieldInfo FieldInfo) const {
338  return getMask(FieldInfo) & (RawData >> FieldInfo[1]);
339  }
340 
341  void init(bool IsPointer, bool IsVector, bool IsScalar, ElementCount EC,
342  uint64_t SizeInBits, unsigned AddressSpace) {
343  assert(SizeInBits <= std::numeric_limits<unsigned>::max() &&
344  "Not enough bits in LLT to represent size");
345  this->IsPointer = IsPointer;
346  this->IsVector = IsVector;
347  this->IsScalar = IsScalar;
348  if (IsScalar)
349  RawData = maskAndShift(SizeInBits, ScalarSizeFieldInfo);
350  else if (IsVector) {
351  assert(EC.isVector() && "invalid number of vector elements");
352  if (!IsPointer)
353  RawData =
354  maskAndShift(EC.getKnownMinValue(), VectorElementsFieldInfo) |
355  maskAndShift(SizeInBits, VectorSizeFieldInfo) |
356  maskAndShift(EC.isScalable() ? 1 : 0, VectorScalableFieldInfo);
357  else
358  RawData =
359  maskAndShift(EC.getKnownMinValue(),
360  PointerVectorElementsFieldInfo) |
361  maskAndShift(SizeInBits, PointerVectorSizeFieldInfo) |
362  maskAndShift(AddressSpace, PointerVectorAddressSpaceFieldInfo) |
363  maskAndShift(EC.isScalable() ? 1 : 0,
364  PointerVectorScalableFieldInfo);
365  } else if (IsPointer)
366  RawData = maskAndShift(SizeInBits, PointerSizeFieldInfo) |
367  maskAndShift(AddressSpace, PointerAddressSpaceFieldInfo);
368  else
369  llvm_unreachable("unexpected LLT configuration");
370  }
371 
372 public:
374  return ((uint64_t)RawData) << 3 | ((uint64_t)IsScalar) << 2 |
375  ((uint64_t)IsPointer) << 1 | ((uint64_t)IsVector);
376  }
377 };
378 
379 inline raw_ostream& operator<<(raw_ostream &OS, const LLT &Ty) {
380  Ty.print(OS);
381  return OS;
382 }
383 
384 template<> struct DenseMapInfo<LLT> {
385  static inline LLT getEmptyKey() {
386  LLT Invalid;
387  Invalid.IsPointer = true;
388  return Invalid;
389  }
390  static inline LLT getTombstoneKey() {
391  LLT Invalid;
392  Invalid.IsVector = true;
393  return Invalid;
394  }
395  static inline unsigned getHashValue(const LLT &Ty) {
396  uint64_t Val = Ty.getUniqueRAWLLTData();
398  }
399  static bool isEqual(const LLT &LHS, const LLT &RHS) {
400  return LHS == RHS;
401  }
402 };
403 
404 }
405 
406 #endif // LLVM_SUPPORT_LOWLEVELTYPEIMPL_H
LLVM_DUMP_METHOD
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition: Compiler.h:510
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::LLT::operator==
bool operator==(const LLT &RHS) const
Definition: LowLevelTypeImpl.h:253
llvm::LLT::dump
LLVM_DUMP_METHOD void dump() const
Definition: LowLevelTypeImpl.h:247
llvm::LLT::getScalarSizeInBits
unsigned getScalarSizeInBits() const
Definition: LowLevelTypeImpl.h:212
llvm::ElementCount
Definition: TypeSize.h:385
llvm::TypeSize::getFixedSize
ScalarTy getFixedSize() const
Definition: TypeSize.h:425
llvm::DenseMapInfo< LLT >::getHashValue
static unsigned getHashValue(const LLT &Ty)
Definition: LowLevelTypeImpl.h:395
llvm::LLT::getScalarType
LLT getScalarType() const
Definition: LowLevelTypeImpl.h:167
Shift
bool Shift
Definition: README.txt:468
llvm::LLT::scalarOrVector
static LLT scalarOrVector(ElementCount EC, uint64_t ScalarSize)
Definition: LowLevelTypeImpl.h:101
llvm::LLT::isValid
bool isValid() const
Definition: LowLevelTypeImpl.h:116
llvm::LLT::changeElementCount
LLT changeElementCount(ElementCount EC) const
Return a vector or scalar with the same element type and the new element count.
Definition: LowLevelTypeImpl.h:189
llvm::LLT::print
void print(raw_ostream &OS) const
Definition: LowLevelType.cpp:37
llvm::LLT::vector
static LLT vector(ElementCount EC, unsigned ScalarSizeInBits)
Get a low-level vector of some number of elements and element width.
Definition: LowLevelTypeImpl.h:56
llvm::LLT::isByteSized
bool isByteSized() const
Definition: LowLevelTypeImpl.h:210
RHS
Value * RHS
Definition: X86PartialReduction.cpp:74
llvm::BitmaskEnumDetail::Mask
std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Definition: BitmaskEnum.h:80
llvm::LinearPolySize::isScalable
bool isScalable() const
Returns whether the size is scaled by a runtime quantity (vscale).
Definition: TypeSize.h:298
MachineValueType.h
llvm::dbgs
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:163
llvm::LLT::fixed_vector
static LLT fixed_vector(unsigned NumElements, unsigned ScalarSizeInBits)
Get a low-level fixed-width vector of some number of elements and element width.
Definition: LowLevelTypeImpl.h:74
LHS
Value * LHS
Definition: X86PartialReduction.cpp:73
llvm::DenseMapInfo
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition: APInt.h:34
llvm::LinearPolySize< ElementCount >::get
static ElementCount get(ScalarTy MinVal, bool Scalable)
Definition: TypeSize.h:289
llvm::LLT::fixed_vector
static LLT fixed_vector(unsigned NumElements, LLT ScalarTy)
Get a low-level fixed-width vector of some number of elements and element type.
Definition: LowLevelTypeImpl.h:80
llvm::LLT::LLT
LLT()
Definition: LowLevelTypeImpl.h:111
llvm::LLT::scalable_vector
static LLT scalable_vector(unsigned MinNumElements, LLT ScalarTy)
Get a low-level scalable vector of some number of elements and element type.
Definition: LowLevelTypeImpl.h:93
llvm::LLT::getSizeInBits
TypeSize getSizeInBits() const
Returns the total size of the type. Must only be called on sized types.
Definition: LowLevelTypeImpl.h:152
false
Definition: StackSlotColoring.cpp:142
llvm::TypeSize::Fixed
static TypeSize Fixed(ScalarTy MinVal)
Definition: TypeSize.h:422
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:230
llvm::LLT::scalable_vector
static LLT scalable_vector(unsigned MinNumElements, unsigned ScalarSizeInBits)
Get a low-level scalable vector of some number of elements and element width.
Definition: LowLevelTypeImpl.h:86
llvm::LLT::isScalable
bool isScalable() const
Returns true if the LLT is a scalable vector.
Definition: LowLevelTypeImpl.h:137
llvm::AddressSpace
AddressSpace
Definition: NVPTXBaseInfo.h:21
llvm::LinearPolySize< ElementCount >::getFixed
static ElementCount getFixed(ScalarTy MinVal)
Definition: TypeSize.h:283
llvm::LLT::pointer
static LLT pointer(unsigned AddressSpace, unsigned SizeInBits)
Get a low-level pointer in the given address space.
Definition: LowLevelTypeImpl.h:49
llvm::LLT::getAddressSpace
unsigned getAddressSpace() const
Definition: LowLevelTypeImpl.h:226
llvm::LLT::divide
LLT divide(int Factor) const
Return a type that is Factor times smaller.
Definition: LowLevelTypeImpl.h:196
uint64_t
llvm::cl::init
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:441
llvm::LLT::isVector
bool isVector() const
Definition: LowLevelTypeImpl.h:122
llvm::LLT::getNumElements
uint16_t getNumElements() const
Returns the number of elements in a vector LLT.
Definition: LowLevelTypeImpl.h:126
TemplateParamKind::Type
@ Type
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::LLT::isPointer
bool isPointer() const
Definition: LowLevelTypeImpl.h:120
llvm::LLT::getUniqueRAWLLTData
uint64_t getUniqueRAWLLTData() const
Definition: LowLevelTypeImpl.h:373
llvm::DenseMapInfo< LLT >::getEmptyKey
static LLT getEmptyKey()
Definition: LowLevelTypeImpl.h:385
llvm::codeview::CompileSym2Flags::EC
@ EC
llvm::MVT
Machine Value Type.
Definition: MachineValueType.h:31
llvm::LinearPolySize::getKnownMinValue
ScalarTy getKnownMinValue() const
Returns the minimum value this size can represent.
Definition: TypeSize.h:296
llvm::LLT::isScalar
bool isScalar() const
Definition: LowLevelTypeImpl.h:118
llvm::LinearPolySize::isKnownMultipleOf
bool isKnownMultipleOf(ScalarTy RHS) const
This function tells the caller whether the element count is known at compile time to be a multiple of...
Definition: TypeSize.h:305
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:134
llvm::LLT::changeElementType
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: LowLevelTypeImpl.h:173
uint16_t
llvm::GISelInstProfileBuilder
Definition: CSEInfo.h:167
llvm::LLT::operator!=
bool operator!=(const LLT &RHS) const
Definition: LowLevelTypeImpl.h:258
llvm::LLT::getSizeInBytes
TypeSize getSizeInBytes() const
Returns the total size of the type in bytes, i.e.
Definition: LowLevelTypeImpl.h:162
llvm::TypeSize
Definition: TypeSize.h:416
llvm::LinearPolySize< ElementCount >::getScalable
static ElementCount getScalable(ScalarTy MinVal)
Definition: TypeSize.h:286
llvm::LLT::vector
static LLT vector(ElementCount EC, LLT ScalarTy)
Get a low-level vector of some number of elements and element type.
Definition: LowLevelTypeImpl.h:63
llvm::LLT::LLT
LLT(bool isPointer, bool isVector, bool isScalar, ElementCount EC, uint64_t SizeInBits, unsigned AddressSpace)
Definition: LowLevelTypeImpl.h:107
llvm::LLT::getElementCount
ElementCount getElementCount() const
Definition: LowLevelTypeImpl.h:143
llvm::max
Align max(MaybeAlign Lhs, Align Rhs)
Definition: Alignment.h:340
llvm::LLT::scalarOrVector
static LLT scalarOrVector(ElementCount EC, LLT ScalarTy)
Definition: LowLevelTypeImpl.h:97
llvm::TypeSize::getKnownMinSize
ScalarTy getKnownMinSize() const
Definition: TypeSize.h:426
DenseMapInfo.h
llvm::DenseMapInfo< LLT >::isEqual
static bool isEqual(const LLT &LHS, const LLT &RHS)
Definition: LowLevelTypeImpl.h:399
llvm::LLT::getElementType
LLT getElementType() const
Returns the vector's element type. Only valid for vector types.
Definition: LowLevelTypeImpl.h:236
llvm::DenseMapInfo< LLT >::getTombstoneKey
static LLT getTombstoneKey()
Definition: LowLevelTypeImpl.h:390
llvm::LLT::scalar
static LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
Definition: LowLevelTypeImpl.h:42
llvm::LLT::changeElementSize
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: LowLevelTypeImpl.h:180
Debug.h
llvm::reportInvalidSizeRequest
void reportInvalidSizeRequest(const char *Msg)
Reports a diagnostic message to indicate an invalid size request has been done on a scalable vector.
Definition: TypeSize.cpp:38
llvm::LLT
Definition: LowLevelTypeImpl.h:39