public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: "Martin Liška" <mliska@suse.cz>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Biener <richard.guenther@gmail.com>
Subject: Re: [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.
Date: Mon, 19 Jun 2017 10:37:00 -0000	[thread overview]
Message-ID: <20170619103713.GB72026@kam.mff.cuni.cz> (raw)
In-Reply-To: <9203f3a8-3aa4-292b-1f2d-6749d3e6d0f7@suse.cz>

> On 05/29/2017 07:04 AM, Markus Trippelsdorf wrote:
> > On 2017.05.25 at 11:55 +0200, Martin Liška wrote:
> >> Hi.
> >>
> >> As I spoke about the PGO with Honza and Richi, current 3-stage is not ideal for following
> >> 2 reasons:
> >>
> >> 1) stageprofile compiler is train just on libraries that are built during stage2
> >> 2) apart from that, as the compiler is also used to build the final compiler, profile
> >> is being updated during the build. So the stage2 compiler is making different decisions.
> >>
> >> Both problems can be resolved by adding another step in between current stage2 and stage3
> >> where we train stage2 compiler by building compiler with default options.
> > 
> > Another issue that I've noticed is that LTO doesn't get used in the
> > final stage (stagefeedback) with "bootstrap-O3 bootstrap-lto".
> > It only is used during training. So either move -flto to stagefeedback,
> > or use -flto both during training and during the final stage.
> > 
> 
> You're right, thus I'm suggesting to use -flto in all stages of PGO if 'make profiledbootstrap'
> is invoked.

Thanks, this makes sense to me.  I wonder about quality of training.  One perofmrance
critical bit that does not get trained at all is LTO stremaing when you build non-LTO
compiler.  I guess we should add someting for that as that seems to be rather common
case. Similarly -O0 path may need bit of care.  But your changes seems improvement
over current state for sure.

What are the bootstrap times now?
Honza
> 
> Martin

> >From 77fb3302ef98548d37bf0f891ff09bca297f77fa Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Tue, 6 Jun 2017 11:23:38 +0200
> Subject: [PATCH] Enable -flto in all PGO stages for
>  bootstrap-lto-{,noplugin}.mk.
> 
> config/ChangeLog:
> 
> 2017-06-06  Martin Liska  <mliska@suse.cz>
> 
> 	* bootstrap-lto-noplugin.mk: Enable -flto in all PGO stages.
> 	* bootstrap-lto.mk: Likewise.
> ---
>  config/bootstrap-lto-noplugin.mk | 4 +++-
>  config/bootstrap-lto.mk          | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/config/bootstrap-lto-noplugin.mk b/config/bootstrap-lto-noplugin.mk
> index a5073365b5a..fc980d2bc17 100644
> --- a/config/bootstrap-lto-noplugin.mk
> +++ b/config/bootstrap-lto-noplugin.mk
> @@ -3,4 +3,6 @@
>  
>  STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
>  STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
> -STAGEprofile_CFLAGS += -fno-lto
> +STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
> +STAGEtrain_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
> +STAGEfeedback_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
> diff --git a/config/bootstrap-lto.mk b/config/bootstrap-lto.mk
> index 9e065e1d85a..50b86ef1c81 100644
> --- a/config/bootstrap-lto.mk
> +++ b/config/bootstrap-lto.mk
> @@ -2,7 +2,9 @@
>  
>  STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1
>  STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1
> -STAGEprofile_CFLAGS += -fno-lto
> +STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1
> +STAGEtrain_CFLAGS += -flto=jobserver -frandom-seed=1
> +STAGEfeedback_CFLAGS += -flto=jobserver -frandom-seed=1
>  
>  # assumes the host supports the linker plugin
>  LTO_AR = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ar$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
> -- 
> 2.13.0
> 

  reply	other threads:[~2017-06-19 10:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25 10:00 Martin Liška
2017-05-25 10:00 ` Martin Liška
2017-05-25 11:38 ` Markus Trippelsdorf
2017-05-25 16:28   ` Martin Liška
2017-05-29 15:11     ` Jan Hubicka
2017-05-29  5:14 ` Markus Trippelsdorf
2017-06-06 13:30   ` Martin Liška
2017-06-19 10:37     ` Jan Hubicka [this message]
2017-08-30 10:44       ` [RFC] Make 4-stage PGO bootstrap really working Martin Liška
2017-09-14 12:21         ` Martin Liška
2017-10-19 12:59           ` Martin Liška
2017-10-19 14:53             ` Markus Trippelsdorf
2017-10-25 12:43         ` Markus Trippelsdorf
2017-10-27 13:07           ` Martin Liška
2017-10-27 15:00             ` Markus Trippelsdorf
2017-10-30 11:08               ` Richard Biener
2017-10-27 13:17           ` [PATCH][OBVIOUS] Fix profiledbootstrap Martin Liška
2017-10-27 13:19 ` [PATCH] Append PWD to path when using -fprofile-generate=/some/path Martin Liška
2017-12-20 14:55   ` Martin Liška
2017-12-20 17:35   ` Martin Sebor
2017-12-20 17:45     ` Jakub Jelinek
2017-12-20 18:00       ` Martin Sebor
2017-12-21  9:13       ` Martin Liška
2017-12-21 16:30         ` Martin Sebor
2018-05-16 12:26         ` [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759) Martin Liška
2018-06-20 11:54           ` Martin Liška
2018-06-22 20:35           ` Jeff Law
2018-06-29 14:38             ` Martin Liška
2018-07-02  8:51               ` Rainer Orth
2018-07-20  4:02               ` Bin.Cheng
2018-07-20  8:43                 ` Martin Liška
2018-07-03  9:39           ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170619103713.GB72026@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=markus@trippelsdorf.de \
    --cc=mliska@suse.cz \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).