This is an archive of the discontinued LLVM Phabricator instance.

[libc] Apply no-builtin everywhere, remove unnecessary flags
ClosedPublic

Authored by gchatelet on Jun 1 2022, 5:03 AM.

Details

Summary

Note, this is a re-submission of D125894 with features = ["-header_modules"]
added to the main BUILD.bazel file.

Some functions like stpncpy are implemented in terms of memset but are not
currently using -fno-builtin-memset. This is somewhat hidden by the fact that
we use -ffreestanding globally and that -ffreestanding implies
-fno-builtin for Clang.

This patch also removes -mllvm -combiner-global-alias-analysis that is Clang
specific and that does not bring substantial gains on modern processors.

Also we keep -mllvm --tail-merge-threshold=0 for aarch64 in CMakeLists.txt
but we omit it in the Bazel config. This is because Bazel consumes the source
files directly and so it can use PGO to take optimal decisions locally.

Diff Detail

Event Timeline

gchatelet created this revision.Jun 1 2022, 5:03 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 1 2022, 5:03 AM
gchatelet requested review of this revision.Jun 1 2022, 5:03 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 1 2022, 6:35 AM
This revision was automatically updated to reflect the committed changes.