Lines Matching refs:Alignment
1 //===-- DataLayout.cpp - Data size & alignment routines --------------------==//
10 // This file defines layout properties related to datatype size/offset/alignment
58 // Keep track of maximum alignment constraint.
65 // Empty structures have alignment of 1 byte.
104 assert(abi_align <= pref_align && "Preferred alignment worse than ABI!");
131 assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!");
266 // ABI alignment.
269 "Missing alignment specification for pointer in datalayout string");
274 "Pointer ABI alignment must be a power of 2");
276 // Preferred alignment.
283 "Pointer preferred alignment must be a power of 2");
310 // ABI alignment.
313 "Missing alignment specification in datalayout string");
318 "ABI alignment specification must be >0 for non-aggregate types");
320 // Preferred alignment.
343 case 'S': { // Stack natural alignment.
403 report_fatal_error("Invalid ABI alignment, must be a 16bit integer");
405 report_fatal_error("Invalid preferred alignment, must be a 16bit integer");
407 report_fatal_error("Invalid ABI alignment, must be a power of 2");
409 report_fatal_error("Invalid preferred alignment, must be a power of 2");
413 "Preferred alignment cannot be less than the ABI alignment");
442 "Preferred alignment cannot be less than the ABI alignment");
455 /// getAlignmentInfo - Return the alignment (either ABI if ABIInfo = true or
487 // If we didn't find an integer alignment, fall back on most conservative.
491 // By default, use natural alignment for vector types. This is consistent
495 // If the alignment is not a power of 2, round up to the next power of 2.
503 // If we still couldn't find a reasonable default alignment, fall back
504 // to a simple heuristic that the alignment is the first power of two
618 \param abi_or_pref Flag that determines which alignment is returned. true
619 returns the ABI alignment, false returns the preferred alignment.
620 \param Ty The underlying type for which alignment is determined.
622 Get the ABI (\a abi_or_pref == true) or preferred alignment (\a abi_or_pref
645 // Packed structure types always have an ABI alignment of one.
661 // same size and alignment, so they look the same here.
683 /// getABIIntegerTypeAlignment - Return the minimum ABI-required alignment for
695 assert(!(Align & (Align-1)) && "Alignment is not a power of two!");
757 /// getPreferredAlignment - Return the preferred alignment of the specified
758 /// global. This includes an explicitly requested alignment (if the global
762 unsigned Alignment = getPrefTypeAlignment(ElemType);
764 if (GVAlignment >= Alignment) {
765 Alignment = GVAlignment;
767 Alignment = std::max(GVAlignment, getABITypeAlignment(ElemType));
771 if (Alignment < 16) {
773 // larger alignment.
775 Alignment = 16; // 16-byte alignment.
778 return Alignment;
781 /// getPreferredAlignmentLog - Return the preferred alignment of the
783 /// requested alignment (if the global has one).