]> git.ipfire.org Git - thirdparty/gcc.git/commit
make autprofiledbootstrap with LTO meaningful
authorJan Hubicka <hubicka@ucw.cz>
Wed, 1 Oct 2025 15:06:41 +0000 (17:06 +0200)
committerJan Hubicka <hubicka@ucw.cz>
Wed, 1 Oct 2025 15:06:41 +0000 (17:06 +0200)
commitf77e2fbf8297c293d23bf60e0b04d4d56b6ddc24
tree26a15d2d489c38377cad8428d55476158d2fdc26
parent8498ef3d0758012bf3e355a61a0f89aff7513851
make autprofiledbootstrap with LTO meaningful

currently autoprofiled bootstrap produces auto-profiles for cc1 and cc1plus
binaries.  Those are used to build respective frontend files.  For backend
cc1plus.fda is used.   This does not work well with LTO bootstrap where cc1plus
backend is untrained since it is used only for parsing and ealry opts. As a
result all binaries gets most of the backend optimized for size rather then
speed.

This patch adds lto1.fda and then combines all of cc1, cc1plus and lto1 into
all.fda that is used compiling common modules.  This is more or less equivalent
to what -fprofile-use effectively uses modulo that with -fprofile-use we know
number of runs of evety object file and scale accordingly at LTO time.

gcc/ChangeLog:

* Makefile.in (ALL_FDAS): New variable.
(ALL_HOST_BACKEND_OBJ): Use all.fda instead of cc1plus.fda
(all.fda): New target

gcc/c/ChangeLog:

* Make-lang.in: Add c_FDAS
(create_fdas_for_cc1): Be sure that build fails if create_gcov fails.

gcc/cp/ChangeLog:

* Make-lang.in: Add c++_FDAS
(create_fdas_for_cc1plus): Be sure that build fails if create_gcov fails.

gcc/lto/ChangeLog:

* Make-lang.in: Add lto_FDAS; enable FDA collection
(create_fdas_for_lto1): Be sure that build fails if create_gcov fails.
gcc/Makefile.in
gcc/c/Make-lang.in
gcc/cp/Make-lang.in
gcc/lto/Make-lang.in