LLVM  17.0.0git
DataLayout.h
Go to the documentation of this file.
1 //===- llvm/DataLayout.h - Data size & alignment info -----------*- 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 //
9 // This file defines layout properties related to datatype size/offset/alignment
10 // information. It uses lazy annotations to cache information about how
11 // structure types are laid out and used.
12 //
13 // This structure should be created once, filled in if the defaults are not
14 // correct and then passed around by const&. None of the members functions
15 // require modification to the object.
16 //
17 //===----------------------------------------------------------------------===//
18 
19 #ifndef LLVM_IR_DATALAYOUT_H
20 #define LLVM_IR_DATALAYOUT_H
21 
22 #include "llvm/ADT/APInt.h"
23 #include "llvm/ADT/ArrayRef.h"
24 #include "llvm/ADT/STLExtras.h"
25 #include "llvm/ADT/SmallVector.h"
26 #include "llvm/ADT/StringRef.h"
27 #include "llvm/IR/DerivedTypes.h"
28 #include "llvm/IR/Type.h"
29 #include "llvm/Support/Alignment.h"
30 #include "llvm/Support/Casting.h"
31 #include "llvm/Support/Compiler.h"
35 #include "llvm/Support/TypeSize.h"
36 #include <cassert>
37 #include <cstdint>
38 #include <string>
39 
40 // This needs to be outside of the namespace, to avoid conflict with llvm-c
41 // decl.
42 using LLVMTargetDataRef = struct LLVMOpaqueTargetData *;
43 
44 namespace llvm {
45 
46 class GlobalVariable;
47 class LLVMContext;
48 class Module;
49 class StructLayout;
50 class Triple;
51 class Value;
52 
53 /// Enum used to categorize the alignment types stored by LayoutAlignElem
57  VECTOR_ALIGN = 'v',
58  FLOAT_ALIGN = 'f',
60 };
61 
62 // FIXME: Currently the DataLayout string carries a "preferred alignment"
63 // for types. As the DataLayout is module/global, this should likely be
64 // sunk down to an FTTI element that is queried rather than a global
65 // preference.
66 
67 /// Layout alignment element.
68 ///
69 /// Stores the alignment data associated with a given alignment type (integer,
70 /// vector, float) and type bit width.
71 ///
72 /// \note The unusual order of elements in the structure attempts to reduce
73 /// padding and make the structure slightly more cache friendly.
75  /// Alignment type from \c AlignTypeEnum
76  unsigned AlignType : 8;
77  unsigned TypeBitWidth : 24;
80 
81  static LayoutAlignElem get(AlignTypeEnum align_type, Align abi_align,
82  Align pref_align, uint32_t bit_width);
83 
84  bool operator==(const LayoutAlignElem &rhs) const;
85 };
86 
87 /// Layout pointer alignment element.
88 ///
89 /// Stores the alignment data associated with a given pointer and address space.
90 ///
91 /// \note The unusual order of elements in the structure attempts to reduce
92 /// padding and make the structure slightly more cache friendly.
99 
100  /// Initializer
104 
105  bool operator==(const PointerAlignElem &rhs) const;
106 };
107 
108 /// A parsed version of the target data layout string in and methods for
109 /// querying it.
110 ///
111 /// The target data layout string is specified *by the target* - a frontend
112 /// generating LLVM IR is required to generate the right target data for the
113 /// target being codegen'd to.
114 class DataLayout {
115 public:
116  enum class FunctionPtrAlignType {
117  /// The function pointer alignment is independent of the function alignment.
118  Independent,
119  /// The function pointer alignment is a multiple of the function alignment.
121  };
122 private:
123  /// Defaults to false.
124  bool BigEndian;
125 
126  unsigned AllocaAddrSpace;
127  MaybeAlign StackNaturalAlign;
128  unsigned ProgramAddrSpace;
129  unsigned DefaultGlobalsAddrSpace;
130 
131  MaybeAlign FunctionPtrAlign;
132  FunctionPtrAlignType TheFunctionPtrAlignType;
133 
134  enum ManglingModeT {
135  MM_None,
136  MM_ELF,
137  MM_MachO,
138  MM_WinCOFF,
139  MM_WinCOFFX86,
140  MM_GOFF,
141  MM_Mips,
142  MM_XCOFF
143  };
144  ManglingModeT ManglingMode;
145 
146  SmallVector<unsigned char, 8> LegalIntWidths;
147 
148  /// Primitive type alignment data. This is sorted by type and bit
149  /// width during construction.
150  using AlignmentsTy = SmallVector<LayoutAlignElem, 16>;
151  AlignmentsTy Alignments;
152 
154  findAlignmentLowerBound(AlignTypeEnum AlignType, uint32_t BitWidth) const {
155  return const_cast<DataLayout *>(this)->findAlignmentLowerBound(AlignType,
156  BitWidth);
157  }
158 
160  findAlignmentLowerBound(AlignTypeEnum AlignType, uint32_t BitWidth);
161 
162  /// The string representation used to create this DataLayout
163  std::string StringRepresentation;
164 
165  using PointersTy = SmallVector<PointerAlignElem, 8>;
166  PointersTy Pointers;
167 
168  const PointerAlignElem &getPointerAlignElem(uint32_t AddressSpace) const;
169 
170  // The StructType -> StructLayout map.
171  mutable void *LayoutMap = nullptr;
172 
173  /// Pointers in these address spaces are non-integral, and don't have a
174  /// well-defined bitwise representation.
175  SmallVector<unsigned, 8> NonIntegralAddressSpaces;
176 
177  /// Attempts to set the alignment of the given type. Returns an error
178  /// description on failure.
179  Error setAlignment(AlignTypeEnum align_type, Align abi_align,
180  Align pref_align, uint32_t bit_width);
181 
182  /// Attempts to set the alignment of a pointer in the given address space.
183  /// Returns an error description on failure.
184  Error setPointerAlignmentInBits(uint32_t AddrSpace, Align ABIAlign,
185  Align PrefAlign, uint32_t TypeBitWidth,
186  uint32_t IndexBitWidth);
187 
188  /// Internal helper to get alignment for integer of given bitwidth.
189  Align getIntegerAlignment(uint32_t BitWidth, bool abi_or_pref) const;
190 
191  /// Internal helper method that returns requested alignment for type.
192  Align getAlignment(Type *Ty, bool abi_or_pref) const;
193 
194  /// Attempts to parse a target data specification string and reports an error
195  /// if the string is malformed.
196  Error parseSpecifier(StringRef Desc);
197 
198  // Free all internal data structures.
199  void clear();
200 
201 public:
202  /// Constructs a DataLayout from a specification string. See reset().
203  explicit DataLayout(StringRef LayoutDescription) {
204  reset(LayoutDescription);
205  }
206 
207  /// Initialize target data from properties stored in the module.
208  explicit DataLayout(const Module *M);
209 
210  DataLayout(const DataLayout &DL) { *this = DL; }
211 
212  ~DataLayout(); // Not virtual, do not subclass this class
213 
215  clear();
216  StringRepresentation = DL.StringRepresentation;
217  BigEndian = DL.isBigEndian();
218  AllocaAddrSpace = DL.AllocaAddrSpace;
219  StackNaturalAlign = DL.StackNaturalAlign;
220  FunctionPtrAlign = DL.FunctionPtrAlign;
221  TheFunctionPtrAlignType = DL.TheFunctionPtrAlignType;
222  ProgramAddrSpace = DL.ProgramAddrSpace;
223  DefaultGlobalsAddrSpace = DL.DefaultGlobalsAddrSpace;
224  ManglingMode = DL.ManglingMode;
225  LegalIntWidths = DL.LegalIntWidths;
226  Alignments = DL.Alignments;
227  Pointers = DL.Pointers;
228  NonIntegralAddressSpaces = DL.NonIntegralAddressSpaces;
229  return *this;
230  }
231 
232  bool operator==(const DataLayout &Other) const;
233  bool operator!=(const DataLayout &Other) const { return !(*this == Other); }
234 
235  void init(const Module *M);
236 
237  /// Parse a data layout string (with fallback to default values).
238  void reset(StringRef LayoutDescription);
239 
240  /// Parse a data layout string and return the layout. Return an error
241  /// description on failure.
242  static Expected<DataLayout> parse(StringRef LayoutDescription);
243 
244  /// Layout endianness...
245  bool isLittleEndian() const { return !BigEndian; }
246  bool isBigEndian() const { return BigEndian; }
247 
248  /// Returns the string representation of the DataLayout.
249  ///
250  /// This representation is in the same format accepted by the string
251  /// constructor above. This should not be used to compare two DataLayout as
252  /// different string can represent the same layout.
253  const std::string &getStringRepresentation() const {
254  return StringRepresentation;
255  }
256 
257  /// Test if the DataLayout was constructed from an empty string.
258  bool isDefault() const { return StringRepresentation.empty(); }
259 
260  /// Returns true if the specified type is known to be a native integer
261  /// type supported by the CPU.
262  ///
263  /// For example, i64 is not native on most 32-bit CPUs and i37 is not native
264  /// on any known one. This returns false if the integer width is not legal.
265  ///
266  /// The width is specified in bits.
268  return llvm::is_contained(LegalIntWidths, Width);
269  }
270 
272 
273  /// Returns true if the given alignment exceeds the natural stack alignment.
274  bool exceedsNaturalStackAlignment(Align Alignment) const {
275  return StackNaturalAlign && (Alignment > *StackNaturalAlign);
276  }
277 
279  assert(StackNaturalAlign && "StackNaturalAlign must be defined");
280  return *StackNaturalAlign;
281  }
282 
283  unsigned getAllocaAddrSpace() const { return AllocaAddrSpace; }
284 
285  /// Returns the alignment of function pointers, which may or may not be
286  /// related to the alignment of functions.
287  /// \see getFunctionPtrAlignType
288  MaybeAlign getFunctionPtrAlign() const { return FunctionPtrAlign; }
289 
290  /// Return the type of function pointer alignment.
291  /// \see getFunctionPtrAlign
293  return TheFunctionPtrAlignType;
294  }
295 
296  unsigned getProgramAddressSpace() const { return ProgramAddrSpace; }
297  unsigned getDefaultGlobalsAddressSpace() const {
298  return DefaultGlobalsAddrSpace;
299  }
300 
302  return ManglingMode == MM_WinCOFFX86;
303  }
304 
305  /// Returns true if symbols with leading question marks should not receive IR
306  /// mangling. True for Windows mangling modes.
308  return ManglingMode == MM_WinCOFF || ManglingMode == MM_WinCOFFX86;
309  }
310 
311  bool hasLinkerPrivateGlobalPrefix() const { return ManglingMode == MM_MachO; }
312 
314  if (ManglingMode == MM_MachO)
315  return "l";
316  return "";
317  }
318 
319  char getGlobalPrefix() const {
320  switch (ManglingMode) {
321  case MM_None:
322  case MM_ELF:
323  case MM_GOFF:
324  case MM_Mips:
325  case MM_WinCOFF:
326  case MM_XCOFF:
327  return '\0';
328  case MM_MachO:
329  case MM_WinCOFFX86:
330  return '_';
331  }
332  llvm_unreachable("invalid mangling mode");
333  }
334 
336  switch (ManglingMode) {
337  case MM_None:
338  return "";
339  case MM_ELF:
340  case MM_WinCOFF:
341  return ".L";
342  case MM_GOFF:
343  return "@";
344  case MM_Mips:
345  return "$";
346  case MM_MachO:
347  case MM_WinCOFFX86:
348  return "L";
349  case MM_XCOFF:
350  return "L..";
351  }
352  llvm_unreachable("invalid mangling mode");
353  }
354 
355  static const char *getManglingComponent(const Triple &T);
356 
357  /// Returns true if the specified type fits in a native integer type
358  /// supported by the CPU.
359  ///
360  /// For example, if the CPU only supports i32 as a native integer type, then
361  /// i27 fits in a legal integer type but i45 does not.
362  bool fitsInLegalInteger(unsigned Width) const {
363  for (unsigned LegalIntWidth : LegalIntWidths)
364  if (Width <= LegalIntWidth)
365  return true;
366  return false;
367  }
368 
369  /// Layout pointer alignment
370  Align getPointerABIAlignment(unsigned AS) const;
371 
372  /// Return target's alignment for stack-based pointers
373  /// FIXME: The defaults need to be removed once all of
374  /// the backends/clients are updated.
375  Align getPointerPrefAlignment(unsigned AS = 0) const;
376 
377  /// Layout pointer size in bytes, rounded up to a whole
378  /// number of bytes.
379  /// FIXME: The defaults need to be removed once all of
380  /// the backends/clients are updated.
381  unsigned getPointerSize(unsigned AS = 0) const;
382 
383  /// Returns the maximum index size over all address spaces.
384  unsigned getMaxIndexSize() const;
385 
386  // Index size in bytes used for address calculation,
387  /// rounded up to a whole number of bytes.
388  unsigned getIndexSize(unsigned AS) const;
389 
390  /// Return the address spaces containing non-integral pointers. Pointers in
391  /// this address space don't have a well-defined bitwise representation.
393  return NonIntegralAddressSpaces;
394  }
395 
396  bool isNonIntegralAddressSpace(unsigned AddrSpace) const {
397  ArrayRef<unsigned> NonIntegralSpaces = getNonIntegralAddressSpaces();
398  return is_contained(NonIntegralSpaces, AddrSpace);
399  }
400 
403  }
404 
405  bool isNonIntegralPointerType(Type *Ty) const {
406  auto *PTy = dyn_cast<PointerType>(Ty);
407  return PTy && isNonIntegralPointerType(PTy);
408  }
409 
410  /// Layout pointer size, in bits
411  /// FIXME: The defaults need to be removed once all of
412  /// the backends/clients are updated.
413  unsigned getPointerSizeInBits(unsigned AS = 0) const {
414  return getPointerAlignElem(AS).TypeBitWidth;
415  }
416 
417  /// Returns the maximum index size over all address spaces.
418  unsigned getMaxIndexSizeInBits() const {
419  return getMaxIndexSize() * 8;
420  }
421 
422  /// Size in bits of index used for address calculation in getelementptr.
423  unsigned getIndexSizeInBits(unsigned AS) const {
424  return getPointerAlignElem(AS).IndexBitWidth;
425  }
426 
427  /// Layout pointer size, in bits, based on the type. If this function is
428  /// called with a pointer type, then the type size of the pointer is returned.
429  /// If this function is called with a vector of pointers, then the type size
430  /// of the pointer is returned. This should only be called with a pointer or
431  /// vector of pointers.
432  unsigned getPointerTypeSizeInBits(Type *) const;
433 
434  /// Layout size of the index used in GEP calculation.
435  /// The function should be called with pointer or vector of pointers type.
436  unsigned getIndexTypeSizeInBits(Type *Ty) const;
437 
438  unsigned getPointerTypeSize(Type *Ty) const {
439  return getPointerTypeSizeInBits(Ty) / 8;
440  }
441 
442  /// Size examples:
443  ///
444  /// Type SizeInBits StoreSizeInBits AllocSizeInBits[*]
445  /// ---- ---------- --------------- ---------------
446  /// i1 1 8 8
447  /// i8 8 8 8
448  /// i19 19 24 32
449  /// i32 32 32 32
450  /// i100 100 104 128
451  /// i128 128 128 128
452  /// Float 32 32 32
453  /// Double 64 64 64
454  /// X86_FP80 80 80 96
455  ///
456  /// [*] The alloc size depends on the alignment, and thus on the target.
457  /// These values are for x86-32 linux.
458 
459  /// Returns the number of bits necessary to hold the specified type.
460  ///
461  /// If Ty is a scalable vector type, the scalable property will be set and
462  /// the runtime size will be a positive integer multiple of the base size.
463  ///
464  /// For example, returns 36 for i36 and 80 for x86_fp80. The type passed must
465  /// have a size (Type::isSized() must return true).
466  TypeSize getTypeSizeInBits(Type *Ty) const;
467 
468  /// Returns the maximum number of bytes that may be overwritten by
469  /// storing the specified type.
470  ///
471  /// If Ty is a scalable vector type, the scalable property will be set and
472  /// the runtime size will be a positive integer multiple of the base size.
473  ///
474  /// For example, returns 5 for i36 and 10 for x86_fp80.
476  TypeSize BaseSize = getTypeSizeInBits(Ty);
477  return {divideCeil(BaseSize.getKnownMinValue(), 8), BaseSize.isScalable()};
478  }
479 
480  /// Returns the maximum number of bits that may be overwritten by
481  /// storing the specified type; always a multiple of 8.
482  ///
483  /// If Ty is a scalable vector type, the scalable property will be set and
484  /// the runtime size will be a positive integer multiple of the base size.
485  ///
486  /// For example, returns 40 for i36 and 80 for x86_fp80.
488  return 8 * getTypeStoreSize(Ty);
489  }
490 
491  /// Returns true if no extra padding bits are needed when storing the
492  /// specified type.
493  ///
494  /// For example, returns false for i19 that has a 24-bit store size.
495  bool typeSizeEqualsStoreSize(Type *Ty) const {
496  return getTypeSizeInBits(Ty) == getTypeStoreSizeInBits(Ty);
497  }
498 
499  /// Returns the offset in bytes between successive objects of the
500  /// specified type, including alignment padding.
501  ///
502  /// If Ty is a scalable vector type, the scalable property will be set and
503  /// the runtime size will be a positive integer multiple of the base size.
504  ///
505  /// This is the amount that alloca reserves for this type. For example,
506  /// returns 12 or 16 for x86_fp80, depending on alignment.
508  // Round up to the next alignment boundary.
509  return alignTo(getTypeStoreSize(Ty), getABITypeAlign(Ty).value());
510  }
511 
512  /// Returns the offset in bits between successive objects of the
513  /// specified type, including alignment padding; always a multiple of 8.
514  ///
515  /// If Ty is a scalable vector type, the scalable property will be set and
516  /// the runtime size will be a positive integer multiple of the base size.
517  ///
518  /// This is the amount that alloca reserves for this type. For example,
519  /// returns 96 or 128 for x86_fp80, depending on alignment.
521  return 8 * getTypeAllocSize(Ty);
522  }
523 
524  /// Returns the minimum ABI-required alignment for the specified type.
525  /// FIXME: Deprecate this function once migration to Align is over.
526  LLVM_DEPRECATED("use getABITypeAlign instead", "getABITypeAlign")
528 
529  /// Returns the minimum ABI-required alignment for the specified type.
531 
532  /// Helper function to return `Alignment` if it's set or the result of
533  /// `getABITypeAlignment(Ty)`, in any case the result is a valid alignment.
535  Type *Ty) const {
536  return Alignment ? *Alignment : getABITypeAlign(Ty);
537  }
538 
539  /// Returns the minimum ABI-required alignment for an integer type of
540  /// the specified bitwidth.
542  return getIntegerAlignment(BitWidth, /* abi_or_pref */ true);
543  }
544 
545  /// Returns the preferred stack/global alignment for the specified
546  /// type.
547  ///
548  /// This is always at least as good as the ABI alignment.
549  /// FIXME: Deprecate this function once migration to Align is over.
550  LLVM_DEPRECATED("use getPrefTypeAlign instead", "getPrefTypeAlign")
552 
553  /// Returns the preferred stack/global alignment for the specified
554  /// type.
555  ///
556  /// This is always at least as good as the ABI alignment.
558 
559  /// Returns an integer type with size at least as big as that of a
560  /// pointer in the given address space.
562 
563  /// Returns an integer (vector of integer) type with size at least as
564  /// big as that of a pointer of the given pointer (vector of pointer) type.
566 
567  /// Returns the smallest integer type with size at least as big as
568  /// Width bits.
570 
571  /// Returns the largest legal integer type, or null if none are set.
573  unsigned LargestSize = getLargestLegalIntTypeSizeInBits();
574  return (LargestSize == 0) ? nullptr : Type::getIntNTy(C, LargestSize);
575  }
576 
577  /// Returns the size of largest legal integer type size, or 0 if none
578  /// are set.
579  unsigned getLargestLegalIntTypeSizeInBits() const;
580 
581  /// Returns the type of a GEP index.
582  /// If it was not specified explicitly, it will be the integer type of the
583  /// pointer width - IntPtrType.
584  Type *getIndexType(Type *PtrTy) const;
585 
586  /// Returns the offset from the beginning of the type for the specified
587  /// indices.
588  ///
589  /// Note that this takes the element type, not the pointer type.
590  /// This is used to implement getelementptr.
591  int64_t getIndexedOffsetInType(Type *ElemTy, ArrayRef<Value *> Indices) const;
592 
593  /// Get GEP indices to access Offset inside ElemTy. ElemTy is updated to be
594  /// the result element type and Offset to be the residual offset.
596 
597  /// Get single GEP index to access Offset inside ElemTy. Returns std::nullopt
598  /// if index cannot be computed, e.g. because the type is not an aggregate.
599  /// ElemTy is updated to be the result element type and Offset to be the
600  /// residual offset.
601  std::optional<APInt> getGEPIndexForOffset(Type *&ElemTy, APInt &Offset) const;
602 
603  /// Returns a StructLayout object, indicating the alignment of the
604  /// struct, its size, and the offsets of its fields.
605  ///
606  /// Note that this information is lazily cached.
607  const StructLayout *getStructLayout(StructType *Ty) const;
608 
609  /// Returns the preferred alignment of the specified global.
610  ///
611  /// This includes an explicitly requested alignment (if the global has one).
612  Align getPreferredAlign(const GlobalVariable *GV) const;
613 };
614 
616  return reinterpret_cast<DataLayout *>(P);
617 }
618 
620  return reinterpret_cast<LLVMTargetDataRef>(const_cast<DataLayout *>(P));
621 }
622 
623 /// Used to lazily calculate structure layout information for a target machine,
624 /// based on the DataLayout structure.
625 class StructLayout final : public TrailingObjects<StructLayout, uint64_t> {
626  uint64_t StructSize;
627  Align StructAlignment;
628  unsigned IsPadded : 1;
629  unsigned NumElements : 31;
630 
631 public:
632  uint64_t getSizeInBytes() const { return StructSize; }
633 
634  uint64_t getSizeInBits() const { return 8 * StructSize; }
635 
636  Align getAlignment() const { return StructAlignment; }
637 
638  /// Returns whether the struct has padding or not between its fields.
639  /// NB: Padding in nested element is not taken into account.
640  bool hasPadding() const { return IsPadded; }
641 
642  /// Given a valid byte offset into the structure, returns the structure
643  /// index that contains it.
645 
647  return llvm::MutableArrayRef(getTrailingObjects<uint64_t>(),
648  NumElements);
649  }
650 
652  return llvm::ArrayRef(getTrailingObjects<uint64_t>(), NumElements);
653  }
654 
655  uint64_t getElementOffset(unsigned Idx) const {
656  assert(Idx < NumElements && "Invalid element idx!");
657  return getMemberOffsets()[Idx];
658  }
659 
660  uint64_t getElementOffsetInBits(unsigned Idx) const {
661  return getElementOffset(Idx) * 8;
662  }
663 
664 private:
665  friend class DataLayout; // Only DataLayout can create this class
666 
668 
669  size_t numTrailingObjects(OverloadToken<uint64_t>) const {
670  return NumElements;
671  }
672 };
673 
674 // The implementation of this method is provided inline as it is particularly
675 // well suited to constant folding when called on a specific Type subclass.
677  assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");
678  switch (Ty->getTypeID()) {
679  case Type::LabelTyID:
681  case Type::PointerTyID:
683  case Type::ArrayTyID: {
684  ArrayType *ATy = cast<ArrayType>(Ty);
685  return ATy->getNumElements() *
687  }
688  case Type::StructTyID:
689  // Get the layout annotation... which is lazily created on demand.
690  return TypeSize::Fixed(
691  getStructLayout(cast<StructType>(Ty))->getSizeInBits());
692  case Type::IntegerTyID:
693  return TypeSize::Fixed(Ty->getIntegerBitWidth());
694  case Type::HalfTyID:
695  case Type::BFloatTyID:
696  return TypeSize::Fixed(16);
697  case Type::FloatTyID:
698  return TypeSize::Fixed(32);
699  case Type::DoubleTyID:
700  case Type::X86_MMXTyID:
701  return TypeSize::Fixed(64);
702  case Type::PPC_FP128TyID:
703  case Type::FP128TyID:
704  return TypeSize::Fixed(128);
705  case Type::X86_AMXTyID:
706  return TypeSize::Fixed(8192);
707  // In memory objects this is always aligned to a higher boundary, but
708  // only 80 bits contain information.
709  case Type::X86_FP80TyID:
710  return TypeSize::Fixed(80);
713  VectorType *VTy = cast<VectorType>(Ty);
714  auto EltCnt = VTy->getElementCount();
715  uint64_t MinBits = EltCnt.getKnownMinValue() *
717  return TypeSize(MinBits, EltCnt.isScalable());
718  }
719  case Type::TargetExtTyID: {
720  Type *LayoutTy = cast<TargetExtType>(Ty)->getLayoutType();
721  return getTypeSizeInBits(LayoutTy);
722  }
723  default:
724  llvm_unreachable("DataLayout::getTypeSizeInBits(): Unsupported type");
725  }
726 }
727 
728 } // end namespace llvm
729 
730 #endif // LLVM_IR_DATALAYOUT_H
llvm::alignTo
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition: Alignment.h:155
llvm::Type::ArrayTyID
@ ArrayTyID
Arrays.
Definition: Type.h:75
llvm::PointerAlignElem::AddressSpace
uint32_t AddressSpace
Definition: DataLayout.h:97
llvm::StructLayout::hasPadding
bool hasPadding() const
Returns whether the struct has padding or not between its fields.
Definition: DataLayout.h:640
TrailingObjects.h
llvm::Type::FloatTyID
@ FloatTyID
32-bit floating point type
Definition: Type.h:58
llvm::Type::isSized
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
Definition: Type.h:295
MathExtras.h
llvm::Type::DoubleTyID
@ DoubleTyID
64-bit floating point type
Definition: Type.h:59
llvm::bit_width
int bit_width(T Value)
Returns the number of bits needed to represent Value if Value is nonzero.
Definition: bit.h:281
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::DataLayout::exceedsNaturalStackAlignment
bool exceedsNaturalStackAlignment(Align Alignment) const
Returns true if the given alignment exceeds the natural stack alignment.
Definition: DataLayout.h:274
llvm::PointerAlignElem::IndexBitWidth
uint32_t IndexBitWidth
Definition: DataLayout.h:98
llvm::DataLayout::getTypeStoreSizeInBits
TypeSize getTypeStoreSizeInBits(Type *Ty) const
Returns the maximum number of bits that may be overwritten by storing the specified type; always a mu...
Definition: DataLayout.h:487
llvm::lltok::Error
@ Error
Definition: LLToken.h:21
llvm::DataLayout::getIndexTypeSizeInBits
unsigned getIndexTypeSizeInBits(Type *Ty) const
Layout size of the index used in GEP calculation.
Definition: DataLayout.cpp:735
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:114
llvm::DataLayout::getPreferredAlign
Align getPreferredAlign(const GlobalVariable *GV) const
Returns the preferred alignment of the specified global.
Definition: DataLayout.cpp:982
llvm::DataLayout::getProgramAddressSpace
unsigned getProgramAddressSpace() const
Definition: DataLayout.h:296
llvm::DataLayout::getDefaultGlobalsAddressSpace
unsigned getDefaultGlobalsAddressSpace() const
Definition: DataLayout.h:297
llvm::PointerAlignElem
Layout pointer alignment element.
Definition: DataLayout.h:93
StringRef.h
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::DataLayout::FunctionPtrAlignType::Independent
@ Independent
The function pointer alignment is independent of the function alignment.
llvm::details::FixedOrScalableQuantity::isScalable
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
Definition: TypeSize.h:166
llvm::DataLayout::getTypeSizeInBits
TypeSize getTypeSizeInBits(Type *Ty) const
Size examples:
Definition: DataLayout.h:676
TypeSize.h
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1199
llvm::DataLayout::getPointerTypeSizeInBits
unsigned getPointerTypeSizeInBits(Type *) const
Layout pointer size, in bits, based on the type.
Definition: DataLayout.cpp:724
llvm::DataLayout::getTypeStoreSize
TypeSize getTypeStoreSize(Type *Ty) const
Returns the maximum number of bytes that may be overwritten by storing the specified type.
Definition: DataLayout.h:475
llvm::StructLayout::getMemberOffsets
MutableArrayRef< uint64_t > getMemberOffsets()
Definition: DataLayout.h:646
llvm::DataLayout::getPointerPrefAlignment
Align getPointerPrefAlignment(unsigned AS=0) const
Return target's alignment for stack-based pointers FIXME: The defaults need to be removed once all of...
Definition: DataLayout.cpp:707
ErrorHandling.h
llvm::PointerAlignElem::TypeBitWidth
uint32_t TypeBitWidth
Definition: DataLayout.h:96
llvm::Type::getPointerAddressSpace
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
Definition: DerivedTypes.h:729
llvm::GlobalVariable
Definition: GlobalVariable.h:39
llvm::PointerType::getAddressSpace
unsigned getAddressSpace() const
Return the address space of the Pointer type.
Definition: DerivedTypes.h:682
llvm::Type::X86_AMXTyID
@ X86_AMXTyID
AMX vectors (8192 bits, X86 specific)
Definition: Type.h:67
llvm::Type::getTypeID
TypeID getTypeID() const
Return the type id for the type.
Definition: Type.h:137
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::DataLayout::getStructLayout
const StructLayout * getStructLayout(StructType *Ty) const
Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of i...
Definition: DataLayout.cpp:681
APInt.h
llvm::DataLayout::getIndexType
Type * getIndexType(Type *PtrTy) const
Returns the type of a GEP index.
Definition: DataLayout.cpp:876
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::DataLayout::fitsInLegalInteger
bool fitsInLegalInteger(unsigned Width) const
Returns true if the specified type fits in a native integer type supported by the CPU.
Definition: DataLayout.h:362
llvm::DataLayout::getManglingComponent
static const char * getManglingComponent(const Triple &T)
Definition: DataLayout.cpp:153
llvm::AlignTypeEnum
AlignTypeEnum
Enum used to categorize the alignment types stored by LayoutAlignElem.
Definition: DataLayout.h:54
llvm::VectorType::getElementType
Type * getElementType() const
Definition: DerivedTypes.h:422
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:41
STLExtras.h
llvm::ArrayType
Class to represent array types.
Definition: DerivedTypes.h:357
llvm::DataLayout::getStringRepresentation
const std::string & getStringRepresentation() const
Returns the string representation of the DataLayout.
Definition: DataLayout.h:253
llvm::DataLayout::hasLinkerPrivateGlobalPrefix
bool hasLinkerPrivateGlobalPrefix() const
Definition: DataLayout.h:311
llvm::DataLayout::FunctionPtrAlignType::MultipleOfFunctionAlign
@ MultipleOfFunctionAlign
The function pointer alignment is a multiple of the function alignment.
llvm::TypeSize::Fixed
static constexpr TypeSize Fixed(ScalarTy ExactSize)
Definition: TypeSize.h:331
llvm::DataLayout::getValueOrABITypeAlignment
Align getValueOrABITypeAlignment(MaybeAlign Alignment, Type *Ty) const
Helper function to return Alignment if it's set or the result of getABITypeAlignment(Ty),...
Definition: DataLayout.h:534
LLVMTargetDataRef
struct LLVMOpaqueTargetData * LLVMTargetDataRef
Definition: DataLayout.h:42
llvm::DataLayout::operator=
DataLayout & operator=(const DataLayout &DL)
Definition: DataLayout.h:214
llvm::DataLayout::getTypeAllocSizeInBits
TypeSize getTypeAllocSizeInBits(Type *Ty) const
Returns the offset in bits between successive objects of the specified type, including alignment padd...
Definition: DataLayout.h:520
llvm::DataLayout::getIndexSizeInBits
unsigned getIndexSizeInBits(unsigned AS) const
Size in bits of index used for address calculation in getelementptr.
Definition: DataLayout.h:423
llvm::StructLayout::getSizeInBits
uint64_t getSizeInBits() const
Definition: DataLayout.h:634
llvm::DataLayout::operator!=
bool operator!=(const DataLayout &Other) const
Definition: DataLayout.h:233
llvm::PointerAlignElem::getInBits
static PointerAlignElem getInBits(uint32_t AddressSpace, Align ABIAlign, Align PrefAlign, uint32_t TypeBitWidth, uint32_t IndexBitWidth)
Initializer.
Definition: DataLayout.cpp:128
llvm::MutableArrayRef
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Definition: ArrayRef.h:27
llvm::ArrayType::getNumElements
uint64_t getNumElements() const
Definition: DerivedTypes.h:369
llvm::LayoutAlignElem::ABIAlign
Align ABIAlign
Definition: DataLayout.h:78
llvm::DataLayout::getABITypeAlignment
uint64_t getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
Definition: DataLayout.cpp:832
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::DataLayout::doNotMangleLeadingQuestionMark
bool doNotMangleLeadingQuestionMark() const
Returns true if symbols with leading question marks should not receive IR mangling.
Definition: DataLayout.h:307
llvm::DataLayout::getABIIntegerTypeAlignment
Align getABIIntegerTypeAlignment(unsigned BitWidth) const
Returns the minimum ABI-required alignment for an integer type of the specified bitwidth.
Definition: DataLayout.h:541
llvm::StructLayout::getElementOffsetInBits
uint64_t getElementOffsetInBits(unsigned Idx) const
Definition: DataLayout.h:660
llvm::DataLayout::getPointerTypeSize
unsigned getPointerTypeSize(Type *Ty) const
Definition: DataLayout.h:438
llvm::VectorType::getElementCount
ElementCount getElementCount() const
Return an ElementCount instance to represent the (possibly scalable) number of elements in the vector...
Definition: DerivedTypes.h:627
llvm::MaybeAlign
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Definition: Alignment.h:117
llvm::IntegerType
Class to represent integer types.
Definition: DerivedTypes.h:40
LLVM_DEPRECATED
#define LLVM_DEPRECATED(MSG, FIX)
Definition: Compiler.h:145
llvm::DataLayout::getABITypeAlign
Align getABITypeAlign(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
Definition: DataLayout.cpp:836
llvm::LayoutAlignElem
Layout alignment element.
Definition: DataLayout.h:74
llvm::unwrap
Attribute unwrap(LLVMAttributeRef Attr)
Definition: Attributes.h:285
llvm::DataLayout::getLargestLegalIntTypeSizeInBits
unsigned getLargestLegalIntTypeSizeInBits() const
Returns the size of largest legal integer type size, or 0 if none are set.
Definition: DataLayout.cpp:871
llvm::DataLayout::getGEPIndexForOffset
std::optional< APInt > getGEPIndexForOffset(Type *&ElemTy, APInt &Offset) const
Get single GEP index to access Offset inside ElemTy.
Definition: DataLayout.cpp:935
llvm::MutableArrayRef
MutableArrayRef(T &OneElt) -> MutableArrayRef< T >
llvm::DataLayout::getStackAlignment
Align getStackAlignment() const
Definition: DataLayout.h:278
llvm::LayoutAlignElem::PrefAlign
Align PrefAlign
Definition: DataLayout.h:79
llvm::Type::PointerTyID
@ PointerTyID
Pointers.
Definition: Type.h:73
Align
uint64_t Align
Definition: ELFObjHandler.cpp:82
llvm::DataLayout::getIndexSize
unsigned getIndexSize(unsigned AS) const
rounded up to a whole number of bytes.
Definition: DataLayout.cpp:731
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::AddressSpace
AddressSpace
Definition: NVPTXBaseInfo.h:21
llvm::Type::BFloatTyID
@ BFloatTyID
16-bit floating point type (7-bit significand)
Definition: Type.h:57
llvm::INTEGER_ALIGN
@ INTEGER_ALIGN
Definition: DataLayout.h:56
llvm::Type::getIntegerBitWidth
unsigned getIntegerBitWidth() const
Definition: DerivedTypes.h:97
Type.h
llvm::DataLayout::init
void init(const Module *M)
Definition: DataLayout.cpp:541
llvm::DataLayout::FunctionPtrAlignType
FunctionPtrAlignType
Definition: DataLayout.h:116
llvm::DataLayout::getLinkerPrivateGlobalPrefix
StringRef getLinkerPrivateGlobalPrefix() const
Definition: DataLayout.h:313
llvm::DataLayout::getFunctionPtrAlign
MaybeAlign getFunctionPtrAlign() const
Returns the alignment of function pointers, which may or may not be related to the alignment of funct...
Definition: DataLayout.h:288
llvm::DataLayout::hasMicrosoftFastStdCallMangling
bool hasMicrosoftFastStdCallMangling() const
Definition: DataLayout.h:301
llvm::DataLayout::getPrefTypeAlign
Align getPrefTypeAlign(Type *Ty) const
Returns the preferred stack/global alignment for the specified type.
Definition: DataLayout.cpp:845
llvm::VectorType
Base class of all SIMD vector types.
Definition: DerivedTypes.h:389
llvm::DataLayout::isBigEndian
bool isBigEndian() const
Definition: DataLayout.h:246
llvm::PointerAlignElem::ABIAlign
Align ABIAlign
Definition: DataLayout.h:94
llvm::divideCeil
uint64_t divideCeil(uint64_t Numerator, uint64_t Denominator)
Returns the integer ceil(Numerator / Denominator).
Definition: MathExtras.h:508
llvm::INVALID_ALIGN
@ INVALID_ALIGN
Definition: DataLayout.h:55
llvm::DataLayout::~DataLayout
~DataLayout()
Definition: DataLayout.cpp:677
llvm::StructLayout
Used to lazily calculate structure layout information for a target machine, based on the DataLayout s...
Definition: DataLayout.h:625
uint64_t
llvm::PointerAlignElem::PrefAlign
Align PrefAlign
Definition: DataLayout.h:95
llvm::DataLayout::getIndexedOffsetInType
int64_t getIndexedOffsetInType(Type *ElemTy, ArrayRef< Value * > Indices) const
Returns the offset from the beginning of the type for the specified indices.
Definition: DataLayout.cpp:886
llvm::FLOAT_ALIGN
@ FLOAT_ALIGN
Definition: DataLayout.h:58
llvm::Type::X86_MMXTyID
@ X86_MMXTyID
MMX vectors (64 bits, X86 specific)
Definition: Type.h:66
const
aarch64 promote const
Definition: AArch64PromoteConstant.cpp:232
llvm::DataLayout::getMaxIndexSize
unsigned getMaxIndexSize() const
Returns the maximum index size over all address spaces.
Definition: DataLayout.cpp:715
llvm::ARM_MB::ST
@ ST
Definition: ARMBaseInfo.h:73
llvm::DataLayout::isLittleEndian
bool isLittleEndian() const
Layout endianness...
Definition: DataLayout.h:245
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:67
llvm::StructLayout::getElementContainingOffset
unsigned getElementContainingOffset(uint64_t Offset) const
Given a valid byte offset into the structure, returns the structure index that contains it.
Definition: DataLayout.cpp:83
llvm::DataLayout::isDefault
bool isDefault() const
Test if the DataLayout was constructed from an empty string.
Definition: DataLayout.h:258
llvm::PointerType
Class to represent pointers.
Definition: DerivedTypes.h:632
llvm::is_contained
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
Definition: STLExtras.h:1869
ArrayRef.h
llvm::DataLayout::getGlobalPrefix
char getGlobalPrefix() const
Definition: DataLayout.h:319
inline
into xmm2 addss xmm2 xmm1 xmm3 addss xmm3 movaps xmm0 unpcklps xmm0 ret seems silly when it could just be one addps Expand libm rounding functions inline
Definition: README-SSE.txt:72
llvm::details::FixedOrScalableQuantity::getFixedValue
constexpr ScalarTy getFixedValue() const
Definition: TypeSize.h:182
llvm::SmallVectorImpl< LayoutAlignElem >::const_iterator
typename SuperClass::const_iterator const_iterator
Definition: SmallVector.h:582
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::DataLayout::parse
static Expected< DataLayout > parse(StringRef LayoutDescription)
Parse a data layout string and return the layout.
Definition: DataLayout.cpp:207
llvm::DataLayout::getPrefTypeAlignment
uint64_t getPrefTypeAlignment(Type *Ty) const
Returns the preferred stack/global alignment for the specified type.
Definition: DataLayout.cpp:841
llvm::DataLayout::getPointerABIAlignment
Align getPointerABIAlignment(unsigned AS) const
Layout pointer alignment.
Definition: DataLayout.cpp:703
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::DataLayout::DataLayout
DataLayout(const DataLayout &DL)
Definition: DataLayout.h:210
llvm::APInt
Class for arbitrary precision integers.
Definition: APInt.h:75
llvm::DataLayout::getMaxIndexSizeInBits
unsigned getMaxIndexSizeInBits() const
Returns the maximum index size over all address spaces.
Definition: DataLayout.h:418
llvm::Type::FP128TyID
@ FP128TyID
128-bit floating point type (112-bit significand)
Definition: Type.h:61
llvm::wrap
LLVMAttributeRef wrap(Attribute Attr)
Definition: Attributes.h:280
llvm::ArrayRef< unsigned >
llvm::DataLayout::isNonIntegralAddressSpace
bool isNonIntegralAddressSpace(unsigned AddrSpace) const
Definition: DataLayout.h:396
llvm::DataLayout::isNonIntegralPointerType
bool isNonIntegralPointerType(Type *Ty) const
Definition: DataLayout.h:405
llvm::StructType
Class to represent struct types.
Definition: DerivedTypes.h:213
llvm::details::FixedOrScalableQuantity::getKnownMinValue
constexpr ScalarTy getKnownMinValue() const
Returns the minimum value this quantity can represent.
Definition: TypeSize.h:163
llvm::Type::PPC_FP128TyID
@ PPC_FP128TyID
128-bit floating point type (two 64-bits, PowerPC)
Definition: Type.h:62
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm::StructLayout::getSizeInBytes
uint64_t getSizeInBytes() const
Definition: DataLayout.h:632
llvm::Offset
@ Offset
Definition: DWP.cpp:406
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
llvm::DataLayout::isNonIntegralPointerType
bool isNonIntegralPointerType(PointerType *PT) const
Definition: DataLayout.h:401
uint32_t
llvm::VECTOR_ALIGN
@ VECTOR_ALIGN
Definition: DataLayout.h:57
llvm::DataLayout::getNonIntegralAddressSpaces
ArrayRef< unsigned > getNonIntegralAddressSpaces() const
Return the address spaces containing non-integral pointers.
Definition: DataLayout.h:392
Compiler.h
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::DataLayout::getFunctionPtrAlignType
FunctionPtrAlignType getFunctionPtrAlignType() const
Return the type of function pointer alignment.
Definition: DataLayout.h:292
llvm::DataLayout::getAllocaAddrSpace
unsigned getAllocaAddrSpace() const
Definition: DataLayout.h:283
llvm::DataLayout::isLegalInteger
bool isLegalInteger(uint64_t Width) const
Returns true if the specified type is known to be a native integer type supported by the CPU.
Definition: DataLayout.h:267
llvm::DataLayout::getSmallestLegalIntType
Type * getSmallestLegalIntType(LLVMContext &C, unsigned Width=0) const
Returns the smallest integer type with size at least as big as Width bits.
Definition: DataLayout.cpp:864
llvm::Type::IntegerTyID
@ IntegerTyID
Arbitrary bit width integers.
Definition: Type.h:71
llvm::DataLayout::getIntPtrType
IntegerType * getIntPtrType(LLVMContext &C, unsigned AddressSpace=0) const
Returns an integer type with size at least as big as that of a pointer in the given address space.
Definition: DataLayout.cpp:849
Alignment.h
llvm::DataLayout::typeSizeEqualsStoreSize
bool typeSizeEqualsStoreSize(Type *Ty) const
Returns true if no extra padding bits are needed when storing the specified type.
Definition: DataLayout.h:495
llvm::Type::getIntNTy
static IntegerType * getIntNTy(LLVMContext &C, unsigned N)
Definition: Type.cpp:245
llvm::LayoutAlignElem::operator==
bool operator==(const LayoutAlignElem &rhs) const
Definition: DataLayout.cpp:117
llvm::StructLayout::getElementOffset
uint64_t getElementOffset(unsigned Idx) const
Definition: DataLayout.h:655
llvm::DataLayout::getPrivateGlobalPrefix
StringRef getPrivateGlobalPrefix() const
Definition: DataLayout.h:335
llvm::AGGREGATE_ALIGN
@ AGGREGATE_ALIGN
Definition: DataLayout.h:59
llvm::Type::FixedVectorTyID
@ FixedVectorTyID
Fixed width SIMD vector type.
Definition: Type.h:76
llvm::PointerAlignElem::operator==
bool operator==(const PointerAlignElem &rhs) const
Definition: DataLayout.cpp:143
llvm::TypeSize
Definition: TypeSize.h:314
Casting.h
llvm::BitWidth
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:147
llvm::DataLayout::isIllegalInteger
bool isIllegalInteger(uint64_t Width) const
Definition: DataLayout.h:271
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::TrailingObjects
See the file comment for details on the usage of the TrailingObjects type.
Definition: TrailingObjects.h:212
llvm::AMDGPU::Hwreg::Width
Width
Definition: SIDefines.h:439
llvm::Type::LabelTyID
@ LabelTyID
Labels.
Definition: Type.h:64
llvm::DataLayout::getLargestLegalIntType
Type * getLargestLegalIntType(LLVMContext &C) const
Returns the largest legal integer type, or null if none are set.
Definition: DataLayout.h:572
llvm::Type::StructTyID
@ StructTyID
Structures.
Definition: Type.h:74
llvm::DataLayout::DataLayout
DataLayout(StringRef LayoutDescription)
Constructs a DataLayout from a specification string. See reset().
Definition: DataLayout.h:203
Other
std::optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1260
SmallVector.h
llvm::DataLayout::getGEPIndicesForOffset
SmallVector< APInt > getGEPIndicesForOffset(Type *&ElemTy, APInt &Offset) const
Get GEP indices to access Offset inside ElemTy.
Definition: DataLayout.cpp:965
llvm::SmallVectorImpl< LayoutAlignElem >::iterator
typename SuperClass::iterator iterator
Definition: SmallVector.h:581
llvm::LayoutAlignElem::get
static LayoutAlignElem get(AlignTypeEnum align_type, Align abi_align, Align pref_align, uint32_t bit_width)
Definition: DataLayout.cpp:105
llvm::DataLayout::operator==
bool operator==(const DataLayout &Other) const
Definition: DataLayout.cpp:543
llvm::LayoutAlignElem::AlignType
unsigned AlignType
Alignment type from AlignTypeEnum.
Definition: DataLayout.h:76
llvm::LayoutAlignElem::TypeBitWidth
unsigned TypeBitWidth
Definition: DataLayout.h:77
llvm::DataLayout::reset
void reset(StringRef LayoutDescription)
Parse a data layout string (with fallback to default values).
Definition: DataLayout.cpp:180
llvm::Type::ScalableVectorTyID
@ ScalableVectorTyID
Scalable SIMD vector type.
Definition: Type.h:77
llvm::ArrayRef
ArrayRef(const T &OneElt) -> ArrayRef< T >
DerivedTypes.h
llvm::DataLayout::getPointerSizeInBits
unsigned getPointerSizeInBits(unsigned AS=0) const
Layout pointer size, in bits FIXME: The defaults need to be removed once all of the backends/clients ...
Definition: DataLayout.h:413
llvm::StructLayout::getAlignment
Align getAlignment() const
Definition: DataLayout.h:636
llvm::StructLayout::getMemberOffsets
ArrayRef< uint64_t > getMemberOffsets() const
Definition: DataLayout.h:651
llvm::Type::TargetExtTyID
@ TargetExtTyID
Target extension type.
Definition: Type.h:79
llvm::Type::HalfTyID
@ HalfTyID
16-bit floating point type
Definition: Type.h:56
llvm::Type::X86_FP80TyID
@ X86_FP80TyID
80-bit floating point type (X87)
Definition: Type.h:60
llvm::ArrayType::getElementType
Type * getElementType() const
Definition: DerivedTypes.h:370
llvm::DataLayout::getPointerSize
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size in bytes, rounded up to a whole number of bytes.
Definition: DataLayout.cpp:711
llvm::DataLayout::getTypeAllocSize
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
Definition: DataLayout.h:507