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: [GOOGLE] Disable -fdevirtualize by default


Devirtualization needs more tuning to be usable internally. We have
seen 1.6% size increase on average, but unnoticable performance
improvement with this option on. I would rather use the size budget to
make inliner more aggressive :)

For instrumentation build, some of our builds will reach the build
machine limit with this option on.

In LIPO mode, the compiler uses indirect target  profile counter to
build fake edges in order to keep the targets alive -- this is
probably the reason we do not see an performance impact.

David


On Sat, Oct 18, 2014 at 10:10 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> 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.
>
> Honza


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