[all-commits] [llvm/llvm-project] d27527: [libc] Optimize mempcy size thresholds (#70049)

Dmitry Vyukov via All-commits all-commits at lists.llvm.org
Mon Nov 6 23:37:33 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d27527754411534cf7640a90d91988482375fa6e
      https://github.com/llvm/llvm-project/commit/d27527754411534cf7640a90d91988482375fa6e
  Author: Dmitry Vyukov <dvyukov at google.com>
  Date:   2023-11-07 (Tue, 07 Nov 2023)

  Changed paths:
    M libc/src/string/memory_utils/x86_64/inline_memcpy.h

  Log Message:
  -----------
  [libc] Optimize mempcy size thresholds (#70049)

Adjust boundary conditions for sizes = 16/32/64.
See the added comment for explanations.

Results on a machine with AVX2, so sizes 64/128 affected:
```
                │   baseline   │               adjusted               │
                │    sec/op    │   sec/op     vs base                 │
memcpy/Google_A   5.701n ±  0%   5.551n ± 1%   -2.63% (n=100)
memcpy/Google_B   3.817n ±  0%   3.776n ± 0%   -1.07% (p=0.000 n=100)
memcpy/Google_D   11.35n ±  1%   11.32n ± 0%        ~ (p=0.066 n=100)
memcpy/Google_U   3.874n ± 1%    3.821n ± 1%   -1.37% (p=0.001 n=100)
memcpy/64         3.843n ±  0%   3.105n ± 3%  -19.22% (n=50)
memcpy/128        4.842n ±  0%   3.818n ± 0%  -21.15% (p=0.000 n=50)
```




More information about the All-commits mailing list