On Fri, Apr 5, 2019 at 12:42 PM Martin Liška <mli...@suse.cz> wrote:
>
> Hi.
>
> The patch adds a new config that makes LTO+PGO bootstrap faster by
> using LTO only in stage4. In stage3, generators are build with LTO
> in order to collect a reasonable profile for LTO FE.
>
> Ready for trunk?

I wonder if you need the

+AC_SUBST(GENERATOR_CFLAGS)

at all, can't you just use

+BUILD_CFLAGS= @BUILD_CFLAGS@ $(GENERATOR_CFLAGS) -DGENERATOR_FILE
+BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ $(GENERATOR_CFLAGS) -DGENERATOR_FILE

?

Please mention in both bootstrap-lto-lean.mk and the documentation
that the intended make target for this config is profiledbootstrap
since for non-profiledbootstrap it ends up not using LTO at all.  A "lean"
mode for non-profiledbootstrap would need to set up things to
use LTO only for stage3 which means not doing a bootstrap comparison
which means we could "skip" stage2 as well here.  So partial support
for that would be to have

STAGE2_CFLAGS += -frandom-seed=1
STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1
...
do-compare = true

So if this works for non-profiledbootstrap the docs could be
changed to say "but is intended for faster build by only
using LTO in the final bootstrap stage.  With @samp{...}
the LTO frontend is trained only on generator files."

(why do we need -frandom-seed=1?  IIRC that was only for the
comparison step which is elided in all cases for -lean.mk).

Richard.

> Thanks,
> Martin
>
> ChangeLog:
>
> 2019-04-05  Martin Liska  <mli...@suse.cz>
>
>         * Makefile.in: Regenerate.
>         * Makefile.tpl: Pass GENERATOR_CFLAGS
>         in all stages.
>
> config/ChangeLog:
>
> 2019-04-05  Martin Liska  <mli...@suse.cz>
>
>         * bootstrap-lto-lean.mk: New file.
>
> gcc/ChangeLog:
>
> 2019-04-05  Martin Liska  <mli...@suse.cz>
>
>         * Makefile.in: Use GENERATOR_CFLAGS for all generators.
>         * configure: Regenerate.
>         * configure.ac: Pass GENERATOR_CFLAGS.
>         * doc/install.texi: Document the new config.
> ---
>  Makefile.in                  | 207 +++++++++++++++++++++++++++++++++++
>  Makefile.tpl                 |   2 +
>  config/bootstrap-lto-lean.mk |  19 ++++
>  gcc/Makefile.in              |   4 +-
>  gcc/configure                |   6 +-
>  gcc/configure.ac             |   1 +
>  gcc/doc/install.texi         |   6 +
>  7 files changed, 241 insertions(+), 4 deletions(-)
>  create mode 100644 config/bootstrap-lto-lean.mk
>
>

Reply via email to