[libc-commits] [PATCH] D154494: [libc] Adding a version of memcpy w/ software prefetching
Guillaume Chatelet via Phabricator via libc-commits
libc-commits at lists.llvm.org
Wed Jul 5 04:37:50 PDT 2023
gchatelet created this revision.
gchatelet added reviewers: sivachandra, courbet.
Herald added subscribers: libc-commits, pengfei.
Herald added projects: libc-project, All.
gchatelet requested review of this revision.
For machines with a lot of cores, hardware prefetchers can saturate the memory bus when utilization is high.
In this case it is desirable to turn off the hardware prefetcher completely.
This has a big impact on the performance of memory functions such as `memcpy` that rely on the fact that the next cache line will be readily available.
This patch adds the 'LIBC_COPT_MEMCPY_X86_USE_SOFTWARE_PREFETCHING' compile time option that generates a version of memcpy with software prefetching. While not fully restoring the original performances it mitigates the impact to an acceptable level.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D154494
Files:
libc/src/string/CMakeLists.txt
libc/src/string/memory_utils/op_builtin.h
libc/src/string/memory_utils/x86_64/memcpy_implementations.h
utils/bazel/llvm-project-overlay/libc/BUILD.bazel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154494.537294.patch
Type: text/x-patch
Size: 14565 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230705/65a7dbff/attachment-0001.bin>
More information about the libc-commits
mailing list