[llvm] Revert "[libc][bazel] Enable software prefetching for memcpy" (PR #111370)

Guillaume Chatelet via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 05:39:11 PDT 2024


https://github.com/gchatelet created https://github.com/llvm/llvm-project/pull/111370

Reverts llvm/llvm-project#108939

When `AVX` is available but `-mprefer-vector-width=128` some of the `mov` instructions turn into the x86 `rep;movsb` instruction leading to poor performance on "old" architectures (sandybridge, haswell). The possible solutions are : get rid of the `-mprefer-vector-width` option or use smaller static copy sizes in `inline_memcpy_x86_sse2_ge64_sw_prefetching`. Right now a copy size of 3 cache lines (192B) relying exclusively on xmm registers gets turned into `rep;movsb`.

>From 924ef8306fc889498a0bcc701956acaa8b608e05 Mon Sep 17 00:00:00 2001
From: Guillaume Chatelet <chatelet.guillaume at gmail.com>
Date: Mon, 7 Oct 2024 14:27:57 +0200
Subject: [PATCH] Revert "[libc][bazel] Enable software prefetching for memcpy
 (#108939)"

This reverts commit 42b696d7b9942fdf07d65267da40ab178464adaa.
---
 .../bazel/llvm-project-overlay/libc/libc_configure_options.bzl  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl b/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl
index 96d7fa86e9ddf2..f65da9e98226b6 100644
--- a/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl
@@ -24,7 +24,7 @@ LIBC_CONFIGURE_OPTIONS = [
     # Documentation in libc/src/string/memory_utils/...
     # "LIBC_COPT_MEMCPY_USE_EMBEDDED_TINY",
     # "LIBC_COPT_MEMCPY_X86_USE_REPMOVSB_FROM_SIZE",
-    "LIBC_COPT_MEMCPY_X86_USE_SOFTWARE_PREFETCHING",
+    # "LIBC_COPT_MEMCPY_X86_USE_SOFTWARE_PREFETCHING",
     "LIBC_COPT_MEMSET_X86_USE_SOFTWARE_PREFETCHING",
 
     # Documentation in libc/docs/dev/printf_behavior.rst



More information about the llvm-commits mailing list