[PATCH] Come up with bootstrap-lto-lean config.

Martin Liška mliska@suse.cz
Mon Apr 8 11:30:00 GMT 2019


On 4/8/19 12:08 PM, Richard Biener wrote:
> On Fri, Apr 5, 2019 at 12:42 PM Martin Liška <mliska@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
> 
> ?

I've just tested that and it does not work for me.

> 
> 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

Changed to tihs.

> 
> 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."

Likewise.

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

Yep, it's not neded now.

Martin

> 
> Richard.
> 
>> Thanks,
>> Martin
>>
>> ChangeLog:
>>
>> 2019-04-05  Martin Liska  <mliska@suse.cz>
>>
>>         * Makefile.in: Regenerate.
>>         * Makefile.tpl: Pass GENERATOR_CFLAGS
>>         in all stages.
>>
>> config/ChangeLog:
>>
>> 2019-04-05  Martin Liska  <mliska@suse.cz>
>>
>>         * bootstrap-lto-lean.mk: New file.
>>
>> gcc/ChangeLog:
>>
>> 2019-04-05  Martin Liska  <mliska@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
>>
>>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Come-up-with-bootstrap-lto-lean-config.patch
Type: text/x-patch
Size: 89140 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190408/f4428e4d/attachment.bin>


More information about the Gcc-patches mailing list