On Thu, May 20, 2021 at 2:34 PM Martin Liška <mli...@suse.cz> wrote: > > Hello. > > I've got a patch candidate that leverages partial linking for a couple of > selected object files. > > I'm sending make all-host- jX results for my machine: > > before: 3m18s (user 32m52s) > https://gist.githubusercontent.com/marxin/223890df4d8d8e490b6b2918b77dacad/raw/1dd5eae5001295ba0230a689f7edc67284c9b742/gcc-all-host.svg > > after: 2m57m (user 35m) > https://gist.githubusercontent.com/marxin/223890df4d8d8e490b6b2918b77dacad/raw/d659b2187cf622167841efbbe6bc93cb33855fa9/gcc-all-host-partial-lto.svg > > One can utilize it with: > make -j16 all-host PARTIAL_LTO=1 > > @Segher, Andrew: Can you please measure time improvement for your slow > bootstrap? > One can also tweak --param=lto-partitions=16 param value. > > Thoughts?
You're LTO linking multiple objects here - that's almost as if you were doing this for the whole of libbackend.a ... so $(OBJS)_CLFAGS += -flto and in the libbackend.a rule do a similar partial link trick. That gets you half of a LTO bootstrap then. So why did you go from applying this per-file to multiple files? Does $(LINKER) have a proper rule to pick up a jobserver? When upstreaming in any form you probably have to gate it on bootstrap-lto being not active. Richard. > Thanks, > Martin