LLVM's libc Gets Much Faster memcpy For RISC-V

Written by Michael Larabel in LLVM on 21 May 2023 at 06:08 AM EDT. 4 Comments
LLVM
Being merged into LLVM's libc library recently are an optimized memory copy function "memcpy" implementation for the RISC-V architecture.

Optimized memcpy for RISC-V was merged that better handles where unaligned memory accesses are either illegal or extremely slow. ARM32 could benefit as well but for now it's enabled for RISC-V 32-bit and 64-bit software.

Benchmarks of this new implementation by Guillaume Chatelet of Google show some tests dropping from 474 ns to 126 ns while in extreme cases going from 6033 ns down to just 981 ns.

RISC-V libc memcpy performance


Even with these big memcpy speed-ups for RISC-V, GNU's Glibc is still showing much faster RISC-V memcpy results. In some cases the Glibc memcpy performance on RISC-V is still twice as fast as the new optimized implementation with LLVM libc. Details for those interested via this change that is now in living in LLVM 17 Git.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week