[libc-commits] [libc] [libc][aarch64] Use inline_memcpy_aligned_access_64bit under -mstrict-align (PR #227428)
via libc-commits
libc-commits at lists.llvm.org
Tue Sep 29 14:59:14 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h -- libc/src/string/memory_utils/aarch64/inline_memcpy.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libc/src/string/memory_utils/aarch64/inline_memcpy.h b/libc/src/string/memory_utils/aarch64/inline_memcpy.h
index bc7dead70..3244c16dc 100644
--- a/libc/src/string/memory_utils/aarch64/inline_memcpy.h
+++ b/libc/src/string/memory_utils/aarch64/inline_memcpy.h
@@ -67,12 +67,12 @@ inline_memcpy_aarch64(Ptr __restrict dst, CPtr __restrict src, size_t count) {
// When unaligned access is disabled (-mstrict-align), align_to_next_boundary
// below only aligns `src`. Because `dst` has type `cpp::byte*`, LLVM cannot
// statically prove that `dst` is aligned to more than 1 byte. Under strict
- // alignment, this forces the compiler to lower the bulk copy loop to single-byte
- // load and store instructions to prevent unaligned access faults, causing severe
- // performance degradation.
+ // alignment, this forces the compiler to lower the bulk copy loop to
+ // single-byte load and store instructions to prevent unaligned access faults,
+ // causing severe performance degradation.
//
- // Instead, use inline_memcpy_aligned_access_64bit which explicitly aligns `dst`
- // to an 8-byte boundary so 64-bit word stores can be safely used.
+ // Instead, use inline_memcpy_aligned_access_64bit which explicitly aligns
+ // `dst` to an 8-byte boundary so 64-bit word stores can be safely used.
return inline_memcpy_aligned_access_64bit(dst, src, count);
#else
// When hardware unaligned access is supported, aligning only `src` maximizes
``````````
</details>
https://github.com/llvm/llvm-project/pull/227428
More information about the libc-commits
mailing list