Skip to content

Revert "[libc][bazel] Enable software prefetching for memcpy" #111370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

gchatelet
Copy link
Contributor

Reverts #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.

@llvmbot llvmbot added libc bazel "Peripheral" support tier build system: utils/bazel labels Oct 7, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 7, 2024

@llvm/pr-subscribers-libc

Author: Guillaume Chatelet (gchatelet)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/111370.diff

1 Files Affected:

  • (modified) utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl (+1-1)
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

@gchatelet gchatelet merged commit dda107b into main Oct 7, 2024
10 checks passed
@gchatelet gchatelet deleted the revert-108939-enable_prefetching_for_memcpy branch October 7, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel libc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants