Home
last modified time | relevance | path

Searched refs:alignment (Results 1 – 25 of 2489) sorted by relevance

12345678910>>...100

/llvm-project/libcxx/src/
H A Dnew.cpp119 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&) noexcept { 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_ALLO argument
176 operator new[](size_t size,std::align_val_t alignment,const std::nothrow_t &) operator new[]() argument
203 operator delete(void * ptr,std::align_val_t alignment,const std::nothrow_t &) operator delete() argument
207 operator delete(void * ptr,size_t,std::align_val_t alignment) operator delete() argument
211 operator delete[](void * ptr,std::align_val_t alignment) operator delete[]() argument
215 operator delete[](void * ptr,std::align_val_t alignment,const std::nothrow_t &) operator delete[]() argument
219 operator delete[](void * ptr,size_t,std::align_val_t alignment) operator delete[]() argument
[all...]
/llvm-project/llvm/test/CodeGen/SystemZ/
H A Dframe-26.mir37 alignment: 16
46 - { id: 0, size: 96, alignment: 8 }
47 - { id: 1, size: 1960, alignment: 8 }
48 - { id: 2, size: 8, alignment: 8 }
49 - { id: 3, size: 320, alignment: 8 }
50 - { id: 4, size: 4, alignment: 4 }
51 - { id: 5, size: 8, alignment: 8 }
52 - { id: 6, size: 8, alignment: 8 }
53 - { id: 7, size: 4, alignment: 4 }
54 - { id: 8, size: 8, alignment: 8 }
[all …]
/llvm-project/libcxxabi/src/
H A Dstdlib_new_delete.cpp139 static void* operator_new_aligned_impl(std::size_t size, std::align_val_t alignment) { in operator_new_aligned_impl() argument
142 if (static_cast<size_t>(alignment) < sizeof(void*)) in operator_new_aligned_impl()
143 alignment = std::align_val_t(sizeof(void*)); in operator_new_aligned_impl()
149 while ((p = std::__libcpp_aligned_alloc(static_cast<std::size_t>(alignment), size)) == nullptr) { in operator_new_aligned_impl()
160 operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC { in operator new() argument
161 void* p = operator_new_aligned_impl(size, alignment); in operator new()
167 _LIBCPP_WEAK void* operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept { in operator new() argument
180 return operator_new_aligned_impl(size, alignment); in operator new()
184 p = ::operator new(size, alignment); in operator new()
192 operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLO argument
196 operator new[](size_t size,std::align_val_t alignment,const std::nothrow_t &) operator new[]() argument
223 operator delete(void * ptr,std::align_val_t alignment,const std::nothrow_t &) operator delete() argument
227 operator delete(void * ptr,size_t,std::align_val_t alignment) operator delete() argument
231 operator delete[](void * ptr,std::align_val_t alignment) operator delete[]() argument
235 operator delete[](void * ptr,std::align_val_t alignment,const std::nothrow_t &) operator delete[]() argument
239 operator delete[](void * ptr,size_t,std::align_val_t alignment) operator delete[]() argument
[all...]
/llvm-project/mlir/test/Interfaces/DataLayoutInterfaces/
H A Dquery.mlir5 // CHECK: alignment = 4
11 // CHECK: alignment = 8
17 // CHECK: alignment = 4
23 // CHECK: alignment = 1
29 // CHECK: alignment = 4
35 // CHECK: alignment = 16
41 // CHECK: alignment = 16
53 // CHECK: alignment = 1
65 // CHECK: alignment = 1
79 // CHECK: alignment = 20
[all …]
/llvm-project/llvm/test/MC/ARM/
H A Dneon-vld-vst-align.s13 @ CHECK-ERRORS: alignment must be 64 or omitted
16 @ CHECK-ERRORS: alignment must be 64 or omitted
20 @ CHECK-ERRORS: alignment must be 64 or omitted
23 @ CHECK-ERRORS: alignment must be 64 or omitted
35 @ CHECK-ERRORS: alignment must be 64 or omitted
38 @ CHECK-ERRORS: alignment must be 64 or omitted
42 @ CHECK-ERRORS: alignment must be 64 or omitted
45 @ CHECK-ERRORS: alignment must be 64 or omitted
57 @ CHECK-ERRORS: alignment must be 64 or omitted
60 @ CHECK-ERRORS: alignment must be 64 or omitted
[all …]
/llvm-project/compiler-rt/test/scudo/
H A Dmemalign.c21 void *aligned_alloc(size_t alignment, size_t size);
25 size_t alignment = 1U << 12; in main() local
32 posix_memalign(&p, alignment, size); in main()
34 assert(((uintptr_t)p & (alignment - 1)) == 0); in main()
36 p = aligned_alloc(alignment, size); in main()
38 assert(((uintptr_t)p & (alignment - 1)) == 0); in main()
42 alignment = 1U << i; in main()
46 p = memalign(alignment, size - (2 * sizeof(void *) * k)); in main()
48 assert(((uintptr_t)p & (alignment - 1)) == 0); in main()
56 alignment = 1U << i; in main()
[all …]
/llvm-project/mlir/test/Dialect/LLVMIR/
H A Dmem2reg.mlir7 %1 = llvm.alloca %0 x i32 {alignment = 4 : i64} : (i32) -> !llvm.ptr
8 %2 = llvm.load %1 {alignment = 4 : i64} : !llvm.ptr -> i32
21 %3 = llvm.alloca %0 x i32 {alignment = 4 : i64} : (i32) -> !llvm.ptr
23 llvm.store %1, %3 {alignment = 4 : i64} : i32, !llvm.ptr
25 llvm.store %3, %2 {alignment = 8 : i64} : !llvm.ptr, !llvm.ptr
36 %2 = llvm.alloca %0 x i32 {alignment = 4 : i64} : (i32) -> !llvm.ptr
42 llvm.store %1, %2 {alignment = 4 : i64} : i32, !llvm.ptr
54 %3 = llvm.alloca %0 x i32 {alignment = 4 : i64} : (i32) -> !llvm.ptr
55 llvm.store %1, %3 {alignment = 4 : i64} : i32, !llvm.ptr
62 llvm.store %2, %3 {alignment
[all...]
H A Dlayout.mlir6 // CHECK: alignment = 8
17 // CHECK: alignment = 8
28 // CHECK: alignment = 8
57 // CHECK: alignment = 4
68 // CHECK: alignment = 4
79 // CHECK: alignment = 8
90 // CHECK: alignment = 8
118 // expected-error@below {{preferred alignment is expected to be at least as large as ABI alignment}}
141 // CHECK: alignment = 4
149 // CHECK: alignment = 8
[all …]
/llvm-project/compiler-rt/lib/sanitizer_common/
H A Dsanitizer_allocator_checks.h44 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()
55 inline bool CheckPosixMemalignAlignment(uptr alignment) { in CheckPosixMemalignAlignment() argument
56 return alignment != 0 && IsPowerOfTwo(alignment) && in CheckPosixMemalignAlignment()
57 (alignment % sizeof(void *)) == 0; in CheckPosixMemalignAlignment()
/llvm-project/libcxx/test/libcxx/language.support/support.dynamic/
H A Dnew_faligned_allocation.pass.cpp
/llvm-project/libc/src/__support/
H A Dblock.h27 /// Returns the value rounded down to the nearest multiple of alignment.
28 LIBC_INLINE constexpr size_t align_down(size_t value, size_t alignment) {
30 return (value / alignment) * alignment;
33 /// Returns the value rounded up to the nearest multiple of alignment. May wrap
35 LIBC_INLINE constexpr size_t align_up(size_t value, size_t alignment) {
36 return align_down(value + alignment - 1, alignment);
243 LIBC_INLINE bool is_usable_space_aligned(size_t alignment) const { in mark_used()
244 return reinterpret_cast<uintptr_t>(usable_space()) % alignment in mark_used()
37 align_down(size_t value,size_t alignment) align_down() argument
44 align_down(T * value,size_t alignment) align_down() argument
50 align_up(size_t value,size_t alignment) align_up() argument
57 align_up(T * value,size_t alignment) align_up() argument
227 size_t alignment() const { return used() ? info_.alignment : 1; } alignment() function
265 is_usable_space_aligned(size_t alignment) is_usable_space_aligned() argument
269 padding_for_alignment(size_t alignment) padding_for_alignment() argument
359 uint16_t alignment : 14; global() member
369 get_aligned_subspan(ByteSpan bytes,size_t alignment) get_aligned_subspan() argument
419 can_allocate(size_t alignment,size_t size) can_allocate() argument
434 allocate(Block * block,size_t alignment,size_t size) allocate() argument
[all...]
/llvm-project/llvm/test/CodeGen/PowerPC/
H A Dmi-peepholes-trap-opt.mir7 alignment: 16
31 alignment: 16
50 alignment: 16
66 alignment: 16
82 alignment: 16
97 alignment: 16
113 alignment: 16
128 alignment: 16
143 alignment: 16
160 alignment: 16
[all …]
/llvm-project/mlir/lib/Dialect/SPIRV/Utils/
H A DLayoutUtils.cpp23 Size alignment = 1; in decorateType() local
24 return decorateType(structType, size, alignment); in decorateType()
30 VulkanLayoutUtils::Size &alignment) { in decorateType() argument
69 alignment = maxMemberAlignment; in decorateType()
81 VulkanLayoutUtils::Size &alignment) { in decorateType() argument
83 alignment = getScalarTypeAlignment(type); in decorateType()
85 size = alignment; in decorateType()
89 return decorateType(structType, size, alignment); in decorateType()
91 return decorateType(arrayType, size, alignment); in decorateType()
93 return decorateType(vectorType, size, alignment); in decorateType()
[all …]
/llvm-project/openmp/runtime/src/
H A Dkmp_barrier.h21 #define KMP_ALIGNED_ALLOCATE(size, alignment) _mm_malloc(size, alignment) argument
24 #define KMP_ALGIN_UP(val, alignment) \ argument
25 (((val) + (alignment)-1) / (alignment) * (alignment))
26 #define KMP_ALIGNED_ALLOCATE(size, alignment) \ argument
27 aligned_alloc(alignment, KMP_ALGIN_UP(size, alignment))
30 static inline void *KMP_ALIGNED_ALLOCATE(size_t size, size_t alignment) { in KMP_ALIGNED_ALLOCATE() argument
32 int n = posix_memalign(&ptr, alignment, size); in KMP_ALIGNED_ALLOCATE()
43 #define KMP_ALIGNED_ALLOCATE(size, alignment) _aligned_malloc(size, alignment) argument
46 #define KMP_ALIGNED_ALLOCATE(size, alignment) KMP_INTERNAL_MALLOC(size) argument
/llvm-project/mlir/lib/Target/LLVMIR/
H A DDataLayoutImporter.cpp82 FailureOr<SmallVector<uint64_t>> alignment = tryToParseIntList(token); in tryToParseAlignment() local
83 if (failed(alignment)) in tryToParseAlignment()
85 if (alignment->empty() || alignment->size() > 2) in tryToParseAlignment()
89 // form <abi>[:<pref>], where abi specifies the minimal alignment and pref the in tryToParseAlignment()
90 // optional preferred alignment. The preferred alignment is set to the minimal in tryToParseAlignment()
91 // alignment if not available. in tryToParseAlignment()
92 uint64_t minimal = (*alignment)[0]; in tryToParseAlignment()
93 uint64_t preferred = alignment in tryToParseAlignment()
101 FailureOr<SmallVector<uint64_t>> alignment = tryToParseIntList(token); tryToParsePointerAlignment() local
196 FailureOr<uint64_t> alignment = tryToParseInt(token); tryToEmplaceStackAlignmentEntry() local
[all...]
/llvm-project/llvm/test/tools/llvm-reduce/mir/
H A Dpreserve-frame-info.mir27 # RESULT-NEXT: - { id: 0, offset: 56, size: 4, alignment: 8, callee-saved-register: '$sgpr44',
29 # RESULT-NEXT: - { id: 1, offset: 52, size: 4, alignment: 4, callee-saved-register: '$sgpr43' }
30 # RESULT-NEXT: - { id: 2, offset: 48, size: 8, alignment: 16, isAliased: true }
31 # RESULT-NEXT: - { id: 3, offset: 16, size: 16, alignment: 16 }
32 # RESULT-NEXT: - { id: 4, size: 8, alignment: 16 }
35 # RESULT-NEXT: - { id: 0, name: bigalloca, offset: 16, size: 16, alignment: 8 }
36 # RESULT-NEXT: - { id: 1, offset: 64, size: 4, alignment: 16, debug-info-variable: '!8',
38 # RESULT-NEXT: - { id: 2, type: spill-slot, offset: 32, size: 4, alignment: 4 }
39 # RESULT-NEXT: - { id: 3, type: spill-slot, offset: 36, size: 4, alignment: 4, stack-id: sgpr-spil…
40 # RESULT-NEXT: - { id: 4, name: dynamic_alloca, type: variable-sized, alignment: 64 }
[all …]
/llvm-project/openmp/runtime/test/api/
H A Dkmp_aligned_malloc.c10 uint64_t alignment = 1; in aligned_by() local
11 while((addr & (alignment-1)) == 0) { in aligned_by()
12 alignment <<= 1; in aligned_by()
14 return (alignment >> 1); in aligned_by()
28 int alignment = alignments[i]; in test_kmp_aligned_malloc() local
31 ptr = (int*)kmp_aligned_malloc(alignment, alignment); in test_kmp_aligned_malloc()
33 if(addr & (alignment-1)) { in test_kmp_aligned_malloc()
35 " alignment = %d\n", tid, ptr, aligned_by(addr), alignment); in test_kmp_aligned_malloc()
/llvm-project/llvm/test/CodeGen/AArch64/
H A Dalign-down.ll5 ; ptr - (ptr & (alignment-1))
7 ; ptr & (0 - alignment)
17 define i32 @t0_32(i32 %ptr, i32 %alignment) nounwind {
23 %mask = add i32 %alignment, -1
28 define i64 @t1_64(i64 %ptr, i64 %alignment) nounwind {
34 %mask = add i64 %alignment, -1
40 define i32 @t2_commutative(i32 %ptr, i32 %alignment) nounwind {
46 %mask = add i32 %alignment, -1
54 define i32 @t3_extrause0(i32 %ptr, i32 %alignment, ptr %mask_storage) nounwind {
62 %mask = add i32 %alignment, -1
[all …]
H A Dstack-id-pei-alloc.mir9 # CHECK: id: 0, name: '', type: default, offset: -8, size: 8, alignment: 8,
11 # CHECK: id: 1, name: '', type: default, offset: -16, size: 8, alignment: 8,
13 # CHECK: id: 2, name: '', type: default, offset: 0, size: 8, alignment: 8,
19 - { id: 0, stack-id: default, size: 8, alignment: 8, offset: 0 }
20 - { id: 1, stack-id: default, size: 8, alignment: 8, offset: 0 }
21 - { id: 2, stack-id: noalloc, size: 8, alignment: 8, offset: 0 }
28 # with alignment of 64. MaxAlignment only pertains to the default stack
38 - { id: 0, stack-id: default, size: 16, alignment: 32 }
39 - { id: 1, stack-id: noalloc, size: 16, alignment: 64 }
51 - { id: 0, stack-id: default, size: 16, alignment: 32 }
[all …]
/llvm-project/libcxx/test/libcxx/strings/basic.string/string.capacity/
H A Dmax_size.pass.cpp21 static const std::size_t alignment = 8; variable
26 assert(str.max_size() == std::numeric_limits<std::size_t>::max() - alignment); in full_size()
30 assert(u8str.max_size() == std::numeric_limits<std::size_t>::max() - alignment); in full_size()
35 assert(wstr.max_size() == std::numeric_limits<std::size_t>::max() / sizeof(wchar_t) - alignment); in full_size()
40 assert(u16str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment); in full_size()
41 assert(u32str.max_size() == std::numeric_limits<std::size_t>::max() / 4 - alignment); in full_size()
47 assert(str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment); in half_size()
51 assert(u8str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment); in half_size()
57 … std::numeric_limits<std::size_t>::max() / std::max<size_t>(2ul, sizeof(wchar_t)) - alignment); in half_size()
62 assert(u16str.max_size() == std::numeric_limits<std::size_t>::max() / 2 - alignment); in half_size()
[all …]
/llvm-project/llvm/test/MC/MachO/
H A Dx86_32-optimal_nop.s4 .align 4, 0 # start with 16 byte alignment filled with zeros
11 .align 4, 0 # start with 16 byte alignment filled with zeros
19 .align 4, 0 # start with 16 byte alignment filled with zeros
26 .align 4, 0 # start with 16 byte alignment filled with zeros
36 .align 4, 0 # start with 16 byte alignment filled with zeros
45 .align 4, 0 # start with 16 byte alignment filled with zeros
53 .align 4, 0 # start with 16 byte alignment filled with zeros
60 .align 4, 0 # start with 16 byte alignment filled with zeros
74 .align 4, 0 # start with 16 byte alignment filled with zeros
87 .align 4, 0 # start with 16 byte alignment fille
[all...]
/llvm-project/lld/wasm/
H A DOutputSegment.cpp21 alignment = std::max(alignment, inSeg->alignment); in addInputSegment()
23 size = llvm::alignTo(size, 1ULL << inSeg->alignment); in addInputSegment()
26 << " align=" << inSeg->alignment << " at:" << size << "\n"); in addInputSegment()
53 return seg->flags == ms->flags && seg->alignment == ms->alignment; in finalizeInputSegments()
57 << " alignment=" << ms->alignment << "\n"); in finalizeInputSegments()
58 auto *syn = make<SyntheticMergedChunk>(name, ms->alignment, ms->flags); in finalizeInputSegments()
75 size = llvm::alignTo(size, 1ULL << seg->alignment); in finalizeInputSegments()
/llvm-project/llvm/test/tools/llvm-objcopy/ELF/
H A Dset-section-alignment.test3 # RUN: llvm-objcopy --set-section-alignment .foo=4 --set-section-alignment .bar=0x5 \
4 # RUN: --set-section-alignment .baz=0 %t %t.2
19 # RUN: llvm-objcopy --set-section-alignment .foo=4 --set-section-alignment=.foo=7 %t %t.3
33 # RUN: llvm-objcopy --set-section-alignment .not_exist=4 %t.3 %t.4
36 # RUN: not llvm-objcopy --set-section-alignment=.foo %t /dev/null 2>&1 | \
38 # MISSING-EQUAL: error: bad format for --set-section-alignment: missing '='
40 # RUN: not llvm-objcopy --set-section-alignment==4 %t /dev/null 2>&1 | \
42 # MISSING-SECTION: error: bad format for --set-section-alignment: missing section name
44 # RUN: not llvm-objcopy --set-section-alignment=.foo=bar %t /dev/null 2>&1 | \
46 # INVALID-ALIGN: error: invalid value for --set-section-alignment: 'bar'
/llvm-project/llvm/include/llvm/Support/
H A DEndian.h33 /// ::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
220 static constexpr std::size_t alignment = Alignment; global() member
[all...]
/llvm-project/compiler-rt/lib/dfsan/
H A Ddfsan_allocator.cpp94 static void *DFsanAllocate(uptr size, uptr alignment, bool zeroise) { in DFsanAllocate()
114 allocated = allocator.Allocate(cache, size, alignment); in DFsanAllocate()
118 allocated = allocator.Allocate(cache, size, alignment); in DFsanAllocate()
157 static void *DFsanReallocate(void *old_p, uptr new_size, uptr alignment) { in DFsanReallocate()
169 void *new_p = DFsanAllocate(new_size, alignment, false /*zeroise*/); in DFsanReallocate()
263 void *__dfsan::dfsan_aligned_alloc(uptr alignment, uptr size) { in dfsan_aligned_alloc()
264 if (UNLIKELY(!CheckAlignedAllocAlignmentAndSize(alignment, size))) { in dfsan_aligned_alloc()
269 ReportInvalidAlignedAllocAlignment(size, alignment, &stack); in dfsan_aligned_alloc()
271 return SetErrnoOnNull(DFsanAllocate(size, alignment, false /*zeroise*/)); in dfsan_memalign() argument
274 void *__dfsan::dfsan_memalign(uptr alignment, upt in dfsan_memalign()
91 DFsanAllocate(uptr size,uptr alignment,bool zeroise) DFsanAllocate() argument
154 DFsanReallocate(void * old_p,uptr new_size,uptr alignment) DFsanReallocate() argument
260 dfsan_aligned_alloc(uptr alignment,uptr size) dfsan_aligned_alloc() argument
282 dfsan_posix_memalign(void ** memptr,uptr alignment,uptr size) dfsan_posix_memalign() argument
[all...]

12345678910>>...100