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

Paul Kirth via libc-commits libc-commits at lists.llvm.org
Fri Oct 16 09:58:00 PDT 2026


ilovepi wrote:

> The code size reduction by itself is already promising. But I'd also like to see actual performance numbers before we go ahead with this.
> 
> The figures you already have are for which optimization level?

I focused on -O2/-O3, since I think that's mostly what people are using for libc. Those are certainly the opt levels we're targeting on Fuchsia user and kernel code.  I did take some measurements at other opt levels though. `-Oz` seems to do notably worse. That's frequently been my observation for lots of code though as we miss out on a lot of opportunities to remove code w/ the `minsize` attribute. Also, I was using clang at ToT for these measurements. I don't imagine GCC is much different, but I didn't try either.


| Build Mode                       | Opt   | main Size | PR Size | Size Delta | main Cycles | PR Cycles | Cycle Delta |
| :------------------------------- | :---- | --------: | ------: | ---------: | ----------: | --------: | ----------: |
| Default (`+simd`)                | -O2 |     860 B |   596 B |     -30.7% |       4,113 |     2,946 |      -28.4% |
| Default (`+simd`)                | -O3 |     872 B |   596 B |     -31.7% |       4,213 |     2,946 |      -30.1% |
| Default (`+simd`)                | -Os |     856 B |   596 B |     -30.4% |       4,079 |     2,946 |      -27.8% |
| Default (`+simd`)                | -Oz |   1,104 B | 1,160 B |      +5.1% |      12,705 |    13,005 |       +2.4% |
| GPR-only  | -O2 |   1,280 B |   696 B |     -45.6% |      15,004 |     3,975 |      -73.5% |
| GPR-only  | -O3 |   1,312 B |   696 B |     -47.0% |      15,104 |     3,975 |      -73.7% |
| GPR-only  | -Os |   1,116 B | 1,012 B |      -9.3% |      12,399 |    11,107 |      -10.4% |
| GPR-only  | -Oz |   1,432 B | 1,612 B |     +12.6% |      17,752 |    21,199 |      +19.4% |

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


More information about the libc-commits mailing list