[libc-commits] [libc] [libc][string] Optimize inline_memmove routine for Aarch64 (PR #232494)

Victor Campos via libc-commits libc-commits at lists.llvm.org
Thu Oct 29 08:10:11 PDT 2026


vhscampos wrote:

I used Arm Optimized Routines' benchmark system to get these data. It is open source and here on GitHub. It is able to run very specialised benchmarks for string functions across many different scenarios.

I've set the current LLVM libc implementation as the baseline ("vanilla"), and compared it against this PR's implementation ("optimized"). The CPU is a Neoverse V2.

Full table:
https://markdownpastebin.com/?id=2f6a4f7e29ff48a1bdd409aa6cfc44d1

I've asked Codex to digest the numbers and come up with a quick summary:

The optimized version performs best on small, non-overlapping copies, winning at every tested size from 1–64 bytes and at 127–128 bytes, for both aligned and unaligned addresses. Its largest gains are at 64 bytes: 1.57× aligned and 1.93× unaligned. Vanilla’s strongest advantage is at 65 bytes, where optimized takes approximately 36% longer aligned and 55% longer unaligned. Overlapping copies show mixed results: optimized improves some cases, such as 511-byte backward overlaps with offsets 1 and 15, while vanilla wins others, notably the 127-byte backward overlap with offset 64, where optimized takes about 20% longer. Large copies generally perform almost identically, and identical-pointer cases show no consistent advantage. These highlighted differences have pointwise 95% confidence intervals excluding 1×; intervals containing 1× leave the direction uncertain.

https://github.com/llvm/llvm-project/pull/232494


More information about the libc-commits mailing list