On Wed, 25 Apr 2018, Richard Biener wrote:

> 
> The following patch improves bootstrap times in general, without
> resorting to file splitting.  The observation that stage2 build
> of gimple-match.c improves by 50% when using -fno-checking
> suggests that we avoid doing redundant checking when bootstrapping
> and simply disable that when using the slow stage1 compiler
> (or building stage2 target libs - maybe that should include stage1
> target libs as well).  Given we in the end compare stage2 and stage3
> this will "only" delay checking failures plus also check whether
> the IL checking affects code generation (hah).  I've resorted to
> leave STAGE4 alone.
> 
> For a release checking build the overall win should be slightly
> lower given the patch ends up enabling -fchecking for all target
> libaries built in the final stage rather than just for those
> built by the stage1 compiler (the stage1 compiler has checking
> enabled for release builds as well unless manually specified).
> 
> Bootstrap with all languages enabled running on x86_64-unknown-linux-gnu.
> 
> I'll provide timings before/after the patch when they are gathered.

On a i7-8700 with --enable-languages=c,c++ and -j12 unpatched trunk
bootstraps in

17196.62user 313.77system 37:40.82elapsed 774%CPU (0avgtext+0avgdata 
734572maxresident)k
152inputs+27472376outputs (0major+161848104minor)pagefaults 0swaps

and with an adjusted patch to also do STAGE1_TFLAGS += -fno-checking
we can get that down to

12683.57user 310.63system 29:35.19elapsed 731%CPU (0avgtext+0avgdata 
734572maxresident)k
176inputs+27461016outputs (0major+161926483minor)pagefaults 0swaps

that's a 25% reduction in user/system time and a 22% reduction
in wall-clock time.  As you can see I'm not lucky and parallellism
is reduced (if I can trust %CPU).

Forcefully setting STAGE3_[CT]FLAGS doesn't have any effect on
a checking enabled build but it will disrupt profiledbootstrap
on a release build by training with -fchecking.  Suggestions
welcome - not sure whether adjusting STAGE3_[CT]FLAGS after
setting STAGEtrain_[CT]FLAGS will have the desired effect of
leaving the latter alone.

Richard.

> Any comments?  Any suggested changes (STAGE1_TFLAGS?)
> 
> Thanks,
> Richard.
> 
> 2018-04-25  Richard Biener  <rguent...@suse.de>
> 
>       * Makefile.tpl (STAGE2_CFLAGS): Add -fno-checking.
>       (STAGE2_TFLAGS): Likewise.
>       (STAGE3_CFLAGS): Add -fchecking.
>       (STAGE3_TFLAGS): Likewise.
>       * Makefile.in: Re-generate.
> 
> Index: Makefile.tpl
> ===================================================================
> --- Makefile.tpl      (revision 259638)
> +++ Makefile.tpl      (working copy)
> @@ -452,6 +452,15 @@ STAGE1_CONFIGURE_FLAGS = --disable-inter
>         --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
>         --disable-build-format-warnings
>  
> +# When using the slow stage1 compiler disable IL verification and forcefully
> +# enable it when using the stage2 compiler instead.  As we later compare
> +# stage2 and stage3 we are merely avoid doing redundant work, plus we apply
> +# checking when building all target libraries for release builds.
> +STAGE2_CFLAGS += -fno-checking
> +STAGE2_TFLAGS += -fno-checking
> +STAGE3_CFLAGS += -fchecking
> +STAGE3_TFLAGS += -fchecking
> +
>  STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
>  STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
>  
> Index: Makefile.in
> ===================================================================
> --- Makefile.in       (revision 259638)
> +++ Makefile.in       (working copy)
> @@ -529,6 +529,15 @@ STAGE1_CONFIGURE_FLAGS = --disable-inter
>         --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
>         --disable-build-format-warnings
>  
> +# When using the slow stage1 compiler disable IL verification and forcefully
> +# enable it when using the stage2 compiler instead.  As we later compare
> +# stage2 and stage3 we are merely avoid doing redundant work, plus we apply
> +# checking when building all target libraries for release builds.
> +STAGE2_CFLAGS += -fno-checking
> +STAGE2_TFLAGS += -fno-checking
> +STAGE3_CFLAGS += -fchecking
> +STAGE3_TFLAGS += -fchecking
> +
>  STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
>  STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
>  
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 
21284 (AG Nuernberg)

Reply via email to