This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Issues with intraprocedural devirtualization
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Jason Merrill <jason at redhat dot com>, rguenther at suse dot de, mjambor at suse dot cz, gcc-patches at gcc dot gnu dot org
- Date: Fri, 23 Aug 2013 16:27:08 +0200
- Subject: Re: [RFC] Issues with intraprocedural devirtualization
- References: <20130817214457 dot GA7313 at kam dot mff dot cuni dot cz> <52101BC9 dot 3090801 at redhat dot com> <20130818085303 dot GB16557 at kam dot mff dot cuni dot cz> <20130818085527 dot GC16557 at kam dot mff dot cuni dot cz> <20130819091031 dot GA12549 at kam dot mff dot cuni dot cz> <20130822224253 dot GA5211 at kam dot mff dot cuni dot cz>
> Hi,
> I went through some statistics on firefox build (it is a source combining many coding styles).
> I was basically curious where we do devirtualization. The result is:
>
> Before inline (i.e. important devirtualization)
> 624 ssa-pre devirt 0
> this is interaprocedural devirutalization happening during early FRE by propagating
> constant accesses into vtables entries. (i.e. not type based at all)
>
> 10 ssa-pre devirt2 0
> this is type based intraprocedural analysis during early optimizations
> 177 ipa-prop devirt
> devirtualization in ipa-cp
> 243 ipa-cp inline devirt
> this is devirtualization happening at IPA stage during inlining
The promesed stats with this change.
59 Single type devirt
this is my new code devirtualizing types in anonymous namespaces when there is only
one node. I will send separate patch for this.
696 ssa-pre devirt 0
11% better than w/o patch (probably because of more early inline)
537 ipa-cp inline devirt
120% better than w/o patch
5 ssa-pre devirt2 0
50% less probably because I handle it earlier
309 ipa-prop devirt
74% more
10 gimple-fold devirt2 0
type based code in gimple-fold. It now does something.
>
> After inline (i.e. devirtualization where we missed the chance to do something useful)
> 82 gimple-fold devirt 1
> this is the gimple-fold function in question (it also run pre-inline but apparently
> always fail. I will try the proposed patch and sed updated stats tomorrow)
I was having trakcing bug here. This is standard folding based propagation.
The type based path never suceeded.
>
> 27 ipa-prop intra devirt 1
> intraprocedural type based analysis
> 1569 ssa-pre devirt 1
> this is interaprocedural devirutalization happening during late FRE (not type based)
83 gimple-fold devirt 1
One more.
7 gimple-fold devirt2 1
type based path now does something
27 ssa-pre devirt2 1
type based path, no change.
1847 ssa-pre devirt 1
17% up.
>
> So overall type based analyssi accounts 430 devirtualizations pre-inline and 109 post inline.
> Low level propagation of vtable accesses gets 624 pre-inline and 1569 post inline.
>
> Obviously the post inline numbers shows that we miss majority of interesting cases.
> I hope we can noticeably improve this.
>
> I am re-building with the proposed change now.
>
> Honza