RFC: support of PGO?
Nick Clifton
nickc@redhat.com
Mon Oct 19 11:50:55 GMT 2020
Hi Martin,
> May I please ping this?
Sorry for not responding earleir.
>> Right now I make the PGO with:
>>
>> export C{,XX}FLAGS "-fprofile-generate=/tmp/binutils -O2 -flto"
[...]
>> Questions I have:
>> - Would it be possible to integrate PGO into the root Makefile?
Possible yes. But you would need approval from the GDB and GCC
communities, since we all use the same top level Makefile.
Probably the easiest way to approach this is to create a patch that
adds a new set of targets to the makefile. Eg "pgo-all" or "pgo-gas".
Then submit this patch for review.
Maybe there is a way to toggle using pgo (an environment variable
maybe ?), so that the new targets are not needed. I am not enough
of a Makefile expert to know if this idea is feasible however.
>> - Or do you prefer the way I made the PGO?
Your method is definitely the simplest - no changes needed to any
files. It might be helpful - if the Makefile patching idea is shot
down - to document this process in eg binutils/README so that other
contributors can benefit.
Please excuse my ignorance on PGO - but does it work well when changes
are made to the code base ? For example if I patch gas in some (major) way,
is it necessary to run the multiple configure-and-build steps that you
outlined in order to gain the benefits of PGO, or will a simple rebuild,
using the old profile information, still work ?
>> - I see quite some failures in ld test-suite:
>> /home/marxin/Programming/binutils/objdir/ld/tmpdir/ld/collect-ld: /tmp/ld1.g2iFBN.ltrans0.ltrans.o: in function `yy_get_previous_state':
>> /home/marxin/Programming/binutils/objdir/ld/ldlex.c:3527: undefined reference to `__gcov_time_profiler_counter'
>> which means the libiberty built with PGO is missing -fprofile-generate in linker argument.
>> Can one pass LDFALGS to 'make check'?
Yes - but I suspect that you will find that not all tests honour it.
Cheers
Nick
More information about the Binutils
mailing list