[libc-commits] [PATCH] D128051: [libc] Rely on __builtin_memcpy_inline for memcpy implementation

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Jun 17 06:36:54 PDT 2022


gchatelet created this revision.
gchatelet added a reviewer: courbet.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added projects: libc-project, All.
gchatelet requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128051

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128051.437873.patch
Type: text/x-patch
Size: 3787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220617/c4252e2c/attachment-0001.bin>


More information about the libc-commits mailing list