This is the mail archive of the
mailing list for the GCC project.
Re: [GOOGLE] Disable -fdevirtualize by default
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Teresa Johnson <tejohnson at google dot com>
- Cc: David Li <davidxl at google dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 18 Oct 2014 19:10:35 +0200
- Subject: Re: [GOOGLE] Disable -fdevirtualize by default
- Authentication-results: sourceware.org; auth=none
- References: <CAAe5K+Wi0UtgdkOdZFRRQTPwHbSB5SOhhv4Rj1OHVgwDgbk7dw at mail dot gmail dot com>
> Disabling devirtualization reduces code size, both for instrumentation (because
> many more virtual functions are kept longer and therefore instrumented) and for
> normal optimization.
OK, with profile instrumentation (that you seem to try to minimize) i can see
how you get noticeably more counters because virtual functions are kept longer.
(note that 4.9 is a lot more agressive on removing unreacable virtual functions
than earlier compilers).
Instead of disabling -fdevirtualize completely (that will get you more indirect
calls and thus more topn profiling) you may consider just hacking
ipa.c:walk_polymorphic_call_targets to not make the possible targets as
reachable. (see the conditional on before_inlining_p).
Of course this will get you less devirtualization (but with LTO the difference
should not be big - perhaps I could make switch for that for mainline) and less
accurate profiles when you get speculative devirtualization via topn.
I would be very interested to see how much difference this makes.