This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [LTO][PATCH] Compress LTO IL sections in object files


On Fri, May 8, 2009 at 11:26 AM, Simon Baldwin <simonb@google.com> wrote:
> This patch provides an initial implementation of IL compression in LTO object
> files.
>
> In tests, default level compression shrinks an LTO object file to around 35%
> to 40% of its prior size. ÂWriting IL sections with compression is broadly
> neutral, and may offer a slight gain in compilation performance, as the time
> taken to compress can be offset by a lower i/o overhead. ÂResults from
> compiling one of the larger modules in gcc are shown below:
>
> Â$.../gcc-lto-branch_orig/build/gcc/xgcc -B... -c -fwhopr insn-attrtab.i
> Âreal Â0m16.769s user Â0m16.232s sys  0m0.402s
> Â$ls -l insn-attrtab.o
> Â-rw-r----- 1 simonb ... 12477912 May Â8 18:02 insn-attrtab.o
>
> Â$.../gcc-lto-branch_orig/build/gcc/xgcc -B... \
> Â Â-shared -fwhopr -o insn-attrtab.so insn-attrtab.o
> Âreal Â0m13.515s user Â0m13.066s sys  0m0.361s
> Â$ls -l insn-attrtab.so
> Â-rwxr-x--- 1 simonb ... 1565047 May Â8 18:02 insn-attrtab.so
>
> Â$.../gcc-lto-branch/build/gcc/xgcc -B... -c -fwhopr insn-attrtab.i
> Âreal Â0m15.710s user Â0m15.321s sys  0m0.300s
> Â$ls -l insn-attrtab.o
> Â-rw-r----- 1 simonb ... 4993988 May Â8 18:02 insn-attrtab.o
>
> Â$.../gcc-lto-branch/build/gcc/xgcc -B... \
> Â Â-shared -fwhopr -o insn-attrtab.so insn-attrtab.o
> Âreal Â0m13.859s user Â0m13.269s sys  0m0.375s
> Â$ls -l insn-attrtab.so
> Â-rwxr-x--- 1 simonb ... 1565047 May Â8 18:02 insn-attrtab.so
>
> While this is a start, additional work remains. ÂAt the moment, LTO object
> files are compressed, but intermediate ltrans .lto.o files are not. ÂThis is
> due to some awkwardness in the way the LTO streamer connects to ELF i/o.
> Once this is ironed out, it should be possible to carry compression through
> to all LTO phases that involve serialized IL. ÂThat said, .lto.o files are
> often temporary and not necessarily held on disk, so this may not provide
> much additional benefit.
>
> The compression streams are somewhat simple, and buffer all input before
> (un)compressing as the final step, rather than trying to (un)compress each
> passing block. ÂThis might be something to improve later.
>
> And the append_data() lang hooks probably need further attention, in
> particular to try to separate out the notion of data to append from the
> additional pointer passed in as a block to free, perhaps delayed.
>
> Tested and confirmed bootstraps okay on i386. ÂAlso, confirmed gcc, g++, and
> fortran testsuite parity when compared with a pre-patched build.
>
> Anyway, what do we think? ÂOkay for the LTO branch?

A couple of suggestions for you patch:
ZLIB should really be in BACKENDLIBS so you don't need to update
*/Make-lang.in.  This is just like CLOOGLIBS/PLUGINLIBS, etc.
Also Is zlib build by the host compiler now always (correct?), can you
make sure that is true even for a c,lto build?

Thanks,
Andrew Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]