This is an archive of the discontinued LLVM Phabricator instance.

[libc] Rely on __builtin_memcpy_inline for memcpy implementation
ClosedPublic

Authored by gchatelet on Jun 17 2022, 6:36 AM.

Details

Summary

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.

Diff Detail

Event Timeline

gchatelet created this revision.Jun 17 2022, 6:36 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 17 2022, 6:36 AM
gchatelet requested review of this revision.Jun 17 2022, 6:36 AM
courbet accepted this revision.Jun 17 2022, 6:53 AM
courbet added inline comments.
utils/bazel/llvm-project-overlay/libc/BUILD.bazel
833

Let's so that in a separate patch.

This revision is now accepted and ready to land.Jun 17 2022, 6:53 AM
gchatelet updated this revision to Diff 437893.Jun 17 2022, 7:20 AM
gchatelet marked an inline comment as done.
  • Address comments
This revision was landed with ongoing or failed builds.Jun 17 2022, 7:22 AM
This revision was automatically updated to reflect the committed changes.