> 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