/freebsd/contrib/llvm-project/llvm/lib/CodeGen/ |
H A D | MachineFrameInfo.cpp | 31 void MachineFrameInfo::ensureMaxAlignment(Align Alignment) { in ensureMaxAlignment() argument 33 assert(Alignment <= StackAlignment && in ensureMaxAlignment() 34 "For targets without stack realignment, Alignment is out of limit!"); in ensureMaxAlignment() 35 if (MaxAlignment < Alignment) in ensureMaxAlignment() 36 MaxAlignment = Alignment; in ensureMaxAlignment() 39 /// Clamp the alignment if requested and emit a warning. 40 static inline Align clampStackAlignment(bool ShouldClamp, Align Alignment, in clampStackAlignment() argument 42 if (!ShouldClamp || Alignment <= StackAlignment) in clampStackAlignment() 43 return Alignment; in clampStackAlignment() 44 LLVM_DEBUG(dbgs() << "Warning: requested alignment " << DebugStr(Alignment) in clampStackAlignment() [all …]
|
/freebsd/sys/dev/drm2/ |
H A D | drm_mm.h | 105 unsigned alignment, 111 unsigned alignment, 118 unsigned alignment) in drm_mm_get_block() argument 120 return drm_mm_get_block_generic(parent, size, alignment, 0, 0); in drm_mm_get_block() 124 unsigned alignment) in drm_mm_get_block_atomic() argument 126 return drm_mm_get_block_generic(parent, size, alignment, 0, 1); in drm_mm_get_block_atomic() 131 unsigned alignment, in drm_mm_get_block_range() argument 135 return drm_mm_get_block_range_generic(parent, size, alignment, 0, in drm_mm_get_block_range() 141 unsigned alignment, in drm_mm_get_color_block_range() argument 146 return drm_mm_get_block_range_generic(parent, size, alignment, color, in drm_mm_get_color_block_range() [all …]
|
H A D | drm_mm.c | 116 unsigned long size, unsigned alignment, in drm_mm_insert_helper() argument 130 if (alignment) { in drm_mm_insert_helper() 131 unsigned tmp = adj_start % alignment; in drm_mm_insert_helper() 133 adj_start += alignment - tmp; in drm_mm_insert_helper() 161 unsigned alignment, in drm_mm_get_block_generic() argument 171 drm_mm_insert_helper(hole_node, node, size, alignment, color); in drm_mm_get_block_generic() 183 unsigned long size, unsigned alignment, in drm_mm_insert_node_generic() argument 188 hole_node = drm_mm_search_free_generic(mm, size, alignment, in drm_mm_insert_node_generic() 193 drm_mm_insert_helper(hole_node, node, size, alignment, color); in drm_mm_insert_node_generic() 199 unsigned long size, unsigned alignment) in drm_mm_insert_node() argument [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/sanitizer_common/ |
H A D | sanitizer_allocator_report.cpp | 76 void NORETURN ReportInvalidAllocationAlignment(uptr alignment, in ReportInvalidAllocationAlignment() argument 79 ScopedAllocatorErrorReport report("invalid-allocation-alignment", stack); in ReportInvalidAllocationAlignment() 80 Report("ERROR: %s: invalid allocation alignment: %zd, alignment must be a " in ReportInvalidAllocationAlignment() 81 "power of two\n", SanitizerToolName, alignment); in ReportInvalidAllocationAlignment() 86 void NORETURN ReportInvalidAlignedAllocAlignment(uptr size, uptr alignment, in ReportInvalidAlignedAllocAlignment() argument 89 ScopedAllocatorErrorReport report("invalid-aligned-alloc-alignment", stack); in ReportInvalidAlignedAllocAlignment() 91 Report("ERROR: %s: invalid alignment requested in " in ReportInvalidAlignedAllocAlignment() 92 "aligned_alloc: %zd, alignment must be a power of two and the " in ReportInvalidAlignedAllocAlignment() 93 "requested size 0x%zx must be a multiple of alignment\n", in ReportInvalidAlignedAllocAlignment() 94 SanitizerToolName, alignment, size); in ReportInvalidAlignedAllocAlignment() [all …]
|
H A D | sanitizer_allocator_checks.h | 40 // Checks aligned_alloc() parameters, verifies that the alignment is a power of 41 // two and that the size is a multiple of alignment for POSIX implementation, 43 // of alignment. 44 inline bool CheckAlignedAllocAlignmentAndSize(uptr alignment, uptr size) { in CheckAlignedAllocAlignmentAndSize() argument 46 return alignment != 0 && IsPowerOfTwo(alignment) && in CheckAlignedAllocAlignmentAndSize() 47 (size & (alignment - 1)) == 0; in CheckAlignedAllocAlignmentAndSize() 49 return alignment != 0 && size % alignment == 0; in CheckAlignedAllocAlignmentAndSize() 53 // Checks posix_memalign() parameters, verifies that alignment is a power of two 55 inline bool CheckPosixMemalignAlignment(uptr alignment) { in CheckPosixMemalignAlignment() argument 56 return alignment != 0 && IsPowerOfTwo(alignment) && in CheckPosixMemalignAlignment() [all …]
|
H A D | sanitizer_allocator_combined.h | 44 void *Allocate(AllocatorCache *cache, uptr size, uptr alignment) { in Allocate() argument 48 if (size + alignment < size) { in Allocate() 50 "0x%zx bytes with 0x%zx alignment requested\n", in Allocate() 51 SanitizerToolName, size, alignment); in Allocate() 55 // If alignment requirements are to be fulfilled by the frontend allocator in Allocate() 56 // rather than by the primary or secondary, passing an alignment lower than in Allocate() 58 // alignment check. in Allocate() 59 if (alignment > 8) in Allocate() 60 size = RoundUpTo(size, alignment); in Allocate() 65 // alignment without such requirement, and allocating 'size' would use in Allocate() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
H A D | ASanStackFrameLayout.cpp | 21 // We sort the stack variables by alignment (largest first) to minimize 22 // unnecessary large gaps due to alignment. 30 return a.Alignment > b.Alignment; in CompareVars() 33 // We also force minimal alignment for all vars to kMinAlignment so that vars 34 // with e.g. alignment 1 and alignment 16 do not get reordered by CompareVars. 39 // The resulting frame size is a multiple of Alignment. 41 uint64_t Alignment) { in VarAndRedzoneSize() argument 49 return alignTo(std::max(Res, 2 * Granularity), Alignment); in VarAndRedzoneSize() 62 Vars[i].Alignment = std::max(Vars[i].Alignment, kMinAlignment); in ComputeASanStackFrameLayout() 68 Layout.FrameAlignment = std::max(Granularity, Vars[0].Alignment); in ComputeASanStackFrameLayout() [all …]
|
/freebsd/contrib/jemalloc/include/jemalloc/internal/ |
H A D | jemalloc_internal_inlines_c.h | 67 ipallocztm(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero, in ipallocztm() argument 72 assert(usize == sz_sa2u(usize, alignment)); in ipallocztm() 78 ret = arena_palloc(tsdn, arena, usize, alignment, zero, tcache); in ipallocztm() 79 assert(ALIGNMENT_ADDR2BASE(ret, alignment) == ret); in ipallocztm() 87 ipalloct(tsdn_t *tsdn, size_t usize, size_t alignment, bool zero, in ipalloct() argument 89 return ipallocztm(tsdn, usize, alignment, zero, tcache, false, arena); in ipalloct() 93 ipalloc(tsd_t *tsd, size_t usize, size_t alignment, bool zero) { in ipalloc() argument 94 return ipallocztm(tsd_tsdn(tsd), usize, alignment, zero, in ipalloc() 136 size_t alignment, bool zero, tcache_t *tcache, arena_t *arena, in iralloct_realign() argument 143 usize = sz_sa2u(size, alignment); in iralloct_realign() [all …]
|
/freebsd/sys/contrib/edk2/Include/Library/ |
H A D | MemoryAllocationLib.h | 99 Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment. 102 alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is 103 returned. If there is not enough memory at the specified alignment remaining to satisfy the 106 If Alignment is not a power of two and Alignment is not zero, then ASSERT(). 107 If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). 110 @param Alignment The requested alignment of the allocation. Must be a power of two. 111 If Alignment is zero, then byte alignment is used. 120 IN UINTN Alignment 124 Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment. 127 alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is [all …]
|
/freebsd/contrib/llvm-project/clang/lib/AST/ |
H A D | RecordLayoutBuilder.cpp | 59 /// as alignment attributes on fields and pragmas in effect. 66 /// Overall record alignment in bits. 589 /// Alignment - The current alignment of the record layout. 590 CharUnits Alignment; member in __anonbcc347f50111::ItaniumRecordLayoutBuilder 592 /// PreferredAlignment - The preferred alignment of the record layout. 595 /// The alignment if attribute packed is not used. 608 /// Whether we need to infer alignment, even when we have an 639 /// MaxFieldAlignment - The maximum allowed field alignment. This is set by 701 Alignment(CharUnits::One()), PreferredAlignment(CharUnits::One()), in ItaniumRecordLayoutBuilder() 787 /// alignment. [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/IR/ |
H A D | DataLayout.cpp | 1 //===- DataLayout.cpp - Data size & alignment routines ---------------------==// 9 // This file defines layout properties related to datatype size/offset/alignment 65 // the same data type so no alignment issue will happen. The condition here in StructLayout() 74 // Keep track of maximum alignment constraint. in StructLayout() 127 assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!"); in get() 148 assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!"); in getInBits() 342 // ABI alignment. in parseSpecifier() 345 "Missing alignment specification for pointer in datalayout string"); in parseSpecifier() 352 return reportError("Pointer ABI alignment must be a power of 2"); in parseSpecifier() 358 // Preferred alignment. in parseSpecifier() [all …]
|
/freebsd/sys/contrib/ncsw/etc/ |
H A D | ncsw_mem.c | 48 #define ALIGN_BLOCK(p_Block, prefixSize, alignment) \ 51 p_Block += PAD_ALIGNMENT((alignment), (uintptr_t)(p_Block)); \ 182 ALIGN_BLOCK(p_Temp, p_Mem->prefixSize, p_Mem->alignment); 185 p_Temp += p_Mem->alignment; 213 uint16_t alignment) 217 /* Make sure that the alignment is at least 4 */ 218 if (alignment < 4) 220 alignment = 4; 226 pad2 = PAD_ALIGNMENT(alignment, blockSize); 230 return ((num * blockSize) + alignment); [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/ |
H A D | AlignmentFromAssumptions.cpp | 13 // complex alignment assumptions that apply to vector loads and stores that 34 #define DEBUG_TYPE "alignment-from-assumptions" 38 "Number of loads changed by alignment assumptions"); 40 "Number of stores changed by alignment assumptions"); 42 "Number of memory intrinsics changed by alignment assumptions"); 44 // Given an expression for the (constant) alignment, AlignSCEV, and an 46 // DiffSCEV, compute the alignment of the displaced pointer if it can be reduced 47 // to a constant. Using SCEV to compute alignment handles the case where 53 // DiffUnits = Diff % int64_t(Alignment) in getNewAlignmentDiff() 63 // If the displacement is an exact multiple of the alignment, the in getNewAlignmentDiff() [all...] |
/freebsd/contrib/llvm-project/libcxx/src/ |
H A D | new.cpp | 119 static void* operator_new_aligned_impl(std::size_t size, std::align_val_t alignment) { in operator_new_aligned_impl() argument 122 if (static_cast<size_t>(alignment) < sizeof(void*)) in operator_new_aligned_impl() 123 alignment = std::align_val_t(sizeof(void*)); in operator_new_aligned_impl() 129 while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr) { in operator_new_aligned_impl() 140 operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC { in operator new() argument 141 void* p = operator_new_aligned_impl(size, alignment); in operator new() 147 _LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noe… in operator new() argument 160 return operator_new_aligned_impl(size, alignment); in operator new() 164 p = ::operator new(size, alignment); in operator new() 172 operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC { in operator new[]() argument [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/IR/ |
H A D | DataLayout.h | 1 //===- llvm/DataLayout.h - Data size & alignment info -----------*- C++ -*-===// 9 // This file defines layout properties related to datatype size/offset/alignment 29 #include "llvm/Support/Alignment.h" 53 /// Enum used to categorize the alignment types stored by LayoutAlignElem 61 // FIXME: Currently the DataLayout string carries a "preferred alignment" 66 /// Layout alignment element. 68 /// Stores the alignment data associated with a given type bit width. 83 /// Layout pointer alignment element. 85 /// Stores the alignment data associated with a given pointer and address space. 113 /// The function pointer alignment is independent of the function alignment. [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Support/ |
H A D | OptimizedStructLayout.cpp | 28 assert(isAligned(Field.Alignment, Field.Offset) && in checkValidLayout() 33 assert(Field.Alignment <= MaxAlign && in checkValidLayout() 35 ComputedMaxAlign = std::max(Field.Alignment, MaxAlign); in checkValidLayout() 72 MaxAlign = std::max(MaxAlign, FirstFlexible->Alignment); in performOptimizedStructLayout() 97 MaxAlign = std::max(MaxAlign, I->Alignment); in performOptimizedStructLayout() 101 // Sort the flexible elements in order of decreasing alignment, in performOptimizedStructLayout() 108 // Decreasing alignment. in performOptimizedStructLayout() 109 if (lhs->Alignment != rhs->Alignment) in performOptimizedStructLayout() 110 return (lhs->Alignment < rhs->Alignment ? 1 : -1); in performOptimizedStructLayout() 130 // of their alignment, then this will reliably trigger. in performOptimizedStructLayout() [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Support/ |
H A D | Endian.h | 33 /// ::value is either alignment, or alignof(T) if alignment is 0. 34 template<class T, int alignment> 36 enum { value = alignment == 0 ? alignof(T) : alignment }; 57 template <typename value_type, std::size_t alignment = unaligned> 63 memory, (detail::PickAlignment<value_type, alignment>::value)), in read() 68 template <typename value_type, endianness endian, std::size_t alignment> 70 return read<value_type, alignment>(memory, endian); in read() 75 template <typename value_type, std::size_t alignment = unaligned, 79 value_type ret = read<value_type, alignment>(memory, endian); in readNext() 85 std::size_t alignment = unaligned, typename CharT> [all …]
|
H A D | Alignment.h | 1 //===-- llvm/Support/Alignment.h - Useful alignment functions ---*- C++ -*-===// 13 // - Align represents an alignment in bytes, it is always set and always a valid 14 // power of two, its minimum value is 1 which means no alignment requirements. 37 /// alignment. 41 uint8_t ShiftValue = 0; /// The log2 of the required alignment. 78 assert(llvm::isPowerOf2_64(Value) && "Alignment is not a power of 2"); in Align() 87 // Returns the previous alignment. 116 /// undefined (0) alignment. 135 "Alignment is neither 0 nor a power of 2"); in MaybeAlign() 140 /// For convenience, returns a valid alignment or 1 if undefined. [all …]
|
/freebsd/contrib/llvm-project/clang/lib/CodeGen/ |
H A D | Address.h | 10 // alignment. 45 CharUnits Alignment; variable 51 RawAddress(llvm::Value *Pointer, llvm::Type *ElementType, CharUnits Alignment, 54 ElementType(ElementType), Alignment(Alignment) { in PointerAndKnownNonNull() 92 /// Return the alignment of this pointer. 95 return Alignment; in getAlignment() 99 /// alignment. 139 CharUnits Alignment; variable 154 Address(llvm::Value *pointer, llvm::Type *elementType, CharUnits alignment, 157 Alignment(alignment) { in Pointer() [all …]
|
/freebsd/contrib/jemalloc/src/ |
H A D | base.c | 37 /* Use huge page sizes and alignment regardless of opt_metadata_thp. */ in base_map() 39 size_t alignment = HUGEPAGE; in base_map() local 41 addr = extent_alloc_mmap(NULL, size, alignment, &zero, &commit); in base_map() 46 addr = extent_hooks->alloc(extent_hooks, NULL, size, alignment, in base_map() 181 size_t alignment) { in base_extent_bump_alloc_helper() argument 184 assert(alignment == ALIGNMENT_CEILING(alignment, QUANTUM)); in base_extent_bump_alloc_helper() 185 assert(size == ALIGNMENT_CEILING(size, alignment)); in base_extent_bump_alloc_helper() 188 alignment) - (uintptr_t)extent_addr_get(extent); in base_extent_bump_alloc_helper() 233 size_t alignment) { in base_extent_bump_alloc() argument 237 ret = base_extent_bump_alloc_helper(extent, &gap_size, size, alignment); in base_extent_bump_alloc() [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/gwp_asan/ |
H A D | guarded_pool_allocator.cpp | 169 // alignment, we don't need to allocate extra padding to ensure the alignment 172 size_t Alignment, in getRequiredBackingSize() argument 174 assert(isPowerOfTwo(Alignment) && "Alignment must be a power of two!"); in getRequiredBackingSize() 175 assert(Alignment != 0 && "Alignment should be non-zero"); in getRequiredBackingSize() 178 if (Alignment <= PageSize) in getRequiredBackingSize() 181 return Size + Alignment - PageSize; in getRequiredBackingSize() 184 uintptr_t GuardedPoolAllocator::alignUp(uintptr_t Ptr, size_t Alignment) { in alignUp() argument 185 assert(isPowerOfTwo(Alignment) && "Alignment must be a power of two!"); in alignUp() 186 assert(Alignment != 0 && "Alignment should be non-zero"); in alignUp() 187 if ((Ptr & (Alignment - 1)) == 0) in alignUp() [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/scudo/standalone/ |
H A D | report.cpp | 80 // We enforce a maximum alignment, to keep fields smaller and generally prevent in reportHeaderCorruption() 82 void NORETURN reportAlignmentTooBig(uptr Alignment, uptr MaxAlignment) { 84 Report.append("invalid allocation alignment: %zu exceeds maximum supported " 85 "alignment of %zu\n", in reportHeaderRace() 86 Alignment, MaxAlignment); in reportHeaderRace() 155 void NORETURN reportAlignmentNotPowerOfTwo(uptr Alignment) { in reportDeallocTypeMismatch() 158 "invalid allocation alignment: %zu, alignment must be a power of two\n", in reportDeallocTypeMismatch() 159 Alignment); in reportDeallocTypeMismatch() 169 void NORETURN reportInvalidPosixMemalignAlignment(uptr Alignment) { in reportDeleteSizeMismatch() 99 reportAlignmentTooBig(uptr Alignment,uptr MaxAlignment) reportAlignmentTooBig() argument 172 reportAlignmentNotPowerOfTwo(uptr Alignment) reportAlignmentNotPowerOfTwo() argument 186 reportInvalidPosixMemalignAlignment(uptr Alignment) reportInvalidPosixMemalignAlignment() argument 201 reportInvalidAlignedAllocAlignment(uptr Alignment,uptr Size) reportInvalidAlignedAllocAlignment() argument [all...] |
/freebsd/contrib/llvm-project/llvm/lib/Target/RISCV/ |
H A D | RISCVTargetTransformInfo.h | 83 /// in hardware, for the given opcode and type/alignment. (see LLVM Language 92 /// \param Alignment the alignment for memory access operation checked for 95 Align Alignment) const; 125 Align Alignment, unsigned AddressSpace, 157 Align Alignment, unsigned AddressSpace, TTI::TargetCostKind CostKind, 162 Align Alignment, 168 Align Alignment, 191 getMemoryOpCost(unsigned Opcode, Type *Src, MaybeAlign Alignment, 220 bool isLegalMaskedLoadStore(Type *DataType, Align Alignment) { in isLegalMaskedLoadStore() argument 231 if (!ST->enableUnalignedVectorMem() && Alignment < ElemType.getStoreSize()) in isLegalMaskedLoadStore() [all …]
|
/freebsd/contrib/llvm-project/clang/include/clang/AST/ |
H A D | RecordLayout.h | 70 // Alignment - Alignment of record in characters. 71 CharUnits Alignment; variable 73 // PreferredAlignment - Preferred alignment of record in characters. This 74 // can be different than Alignment in cases where it is beneficial for 82 /// RequiredAlignment - The required alignment of the object. In the MS-ABI 95 /// NonVirtualAlignment - The non-virtual alignment (in chars) of an object, 96 /// which is the alignment of the object without virtual bases. 99 /// PreferredNVAlignment - The preferred non-virtual alignment (in chars) of 100 /// an object, which is the preferred alignment of the object without 151 ASTRecordLayout(const ASTContext &Ctx, CharUnits size, CharUnits alignment, [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/ExecutionEngine/ |
H A D | SectionMemoryManager.cpp | 22 unsigned Alignment, in allocateDataSection() argument 28 Size, Alignment); in allocateDataSection() 30 Alignment); in allocateDataSection() 34 unsigned Alignment, in allocateCodeSection() argument 38 Alignment); in allocateCodeSection() 43 unsigned Alignment) { in allocateSection() argument 44 if (!Alignment) in allocateSection() 45 Alignment = 16; in allocateSection() 47 assert(!(Alignment & (Alignment - 1)) && "Alignment must be a power of two."); in allocateSection() 49 uintptr_t RequiredSize = Alignment * ((Size + Alignment - 1) / Alignment + 1); in allocateSection() [all …]
|