RFA: Fix other/44566

Jan Hubicka hubicka@ucw.cz
Mon Jun 28 07:06:00 GMT 2010


>> So, concretely, carrying LTO/WHOPR overhead during the compiler build
>> itself to me seems OK if that gets us a better compiler and user's can't
>> tell the difference.  In fact, we probably want to turn on LTO/WHOPR by
>> default once we feel it's sufficiently reliable since presumably we'll
>> get better code that way, no matter how the compiler is structured.
>
> The worst performance hit is probably when using stage1 to build the  
> stage1 libraries and the stage2 compiler, as a compiler built with -O0  
> is used
> to do LTO/WHOPR.

I've setup WHOPR bootstrap and I use it daily.  It is sort of in useable stage.
Main observation is that we build backend _really_ many times.  Our LTO
code is still doing one build to produce .o and then compile again, so it
is automatically about twice sloer.

Since we produce several binaries (one for each frontend, that is 6 binaries)
and since we compile each twice to get in the checksum needed for PCH, we get
backend build 13 times for stage2 and 13times for stage3.  So we speak about
building backend 27 times instead of 3 that is considerable build time hit.

Reality is not that bad as it sounds when you have enough of parallelizm.
24 CPU machine needs slightly over a minute per binary and there is room
for parallelizm left, so the 6 binaries build in about 4 minutes in stage3.
Stage2 is about 3 times slower because of -O0 compiler.

I think we should shoot to make WHOPR bootstrap officially working at the
next release.  Immediately we still need to solve many things:

1) Build machinery needs updating. Alexandre recently added bootstrap-lto,
   but it does not do the trick since it just adds -flto to BOOT flags.
   We need -flto -fwhole-program and GOLD plugin flags (without GOLD we
   still drop all LTO from libbckend.a making it useless)
2) We need incremental WHOPR to avoid the second rebuild because of
   checksum
3) Ada currently fails because of debug output ICE
4) Plugin tests fails for me with -fwhole-program (probably because exported
   functions are not properly marked)

Also it would be nice to see noticeable imrpvoements on compiler performance
for WHOPR bootstrap. I did some benchmarking but fixed a lot of things afterwards
so will need to re-test where we stand.  

Honza



More information about the Gcc-patches mailing list