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: [PATCH 3/5] IPA ICF pass


> While a plain Firefox -flto build works fine. LTO/PGO build fails with:
> 
> lto1: internal compiler error: in ipa_merge_profiles, at ipa-utils.c:540
> 0x7d6165 ipa_merge_profiles(cgraph_node*, cgraph_node*)
>         ../../gcc/gcc/ipa-utils.c:540
> 0xf10c41 ipa_icf::sem_function::merge(ipa_icf::sem_item*)
>         ../../gcc/gcc/ipa-icf.c:753
> 0xf15206 ipa_icf::sem_item_optimizer::merge_classes(unsigned int)
>         ../../gcc/gcc/ipa-icf.c:2706
> 0xf1c1f4 ipa_icf::sem_item_optimizer::execute()
>         ../../gcc/gcc/ipa-icf.c:2098
> 0xf1d3f1 ipa_icf_driver
>         ../../gcc/gcc/ipa-icf.c:2784
> 0xf1d3f1 ipa_icf::pass_ipa_icf::execute(function*)
>         ../../gcc/gcc/ipa-icf.c:2831
> 
> 
> The pass is also very memory hungry (from 3GB without ICF to 4GB during
> libxul link), while the code size savings are in the 1% range.

Thnks for checking. I was just thinking about doing that myself.  Would
you mind posting -ftime-report of firefox WPA stage?

It seems that in this case we reject too many of equality candidates?
It think the original numbers was about 4-5% but later some equivalences was
disabled because of devirt/aliasing issues. Do you compare it with gold ICF
enabled? There are quite few obvious improvements to the analysis that can
be done, but I guess we need to analyze the interesting cases one by one.

One thing that Martin can try is to hook into lto-symtab and try to check
that the COMDAT functions that are known to be same pass the equality check.
I suppose we will learn interesting things this way.

I think the patch adds quite important infrastructure for gimple semantic
equality checking and function merging. I went through the majority of code and
I think it is mostly ready to mainline (i.e. cleaner than what we have in
tree-ssa-tailmerge) so hope we can finish the review process next week.
We will need to get better cost/benefits ratio to enable it for -O2 that is
someting I would really like to see for 5.0, but it seems to be easier to
handle this incrementally....

Honza


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