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