[all-commits] [llvm/llvm-project] 7b73f5: [libc] Rely on __builtin_memcpy_inline for memcpy ...

Guillaume Chatelet via All-commits all-commits at lists.llvm.org
Fri Jun 17 07:22:51 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b73f53790f3db9ee589dc26a05a481a5e9e6915
      https://github.com/llvm/llvm-project/commit/7b73f53790f3db9ee589dc26a05a481a5e9e6915
  Author: Guillaume Chatelet <gchatelet at google.com>
  Date:   2022-06-17 (Fri, 17 Jun 2022)

  Changed paths:
    M libc/src/string/CMakeLists.txt
    M libc/src/string/memory_utils/memcpy_implementations.h
    M utils/bazel/llvm-project-overlay/libc/BUILD.bazel

  Log Message:
  -----------
  [libc] Rely on __builtin_memcpy_inline for memcpy implementation

This patch removes usage of `-mllvm -combiner-global-alias-analysis`
and relies on compiler builtin to implement `memcpy`.

Note that `-mllvm -combiner-global-alias-analysis` is actually only useful for
functions where buffers can alias (namely `memcpy` and `memmove`). The other
memory functions where not benefiting from the flag anyways.

The upside is that the memory functions can now be compiled from source with
thinlto (thinlto would not be able to carry on the flag when doing inlining).

The downside is that for compilers other than clang (i.e. not providing
`__builtin_memcpy_inline`) the codegen may be worse.

Differential Revision: https://reviews.llvm.org/D128051




More information about the All-commits mailing list