This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 3/5] IPA ICF pass
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Markus Trippelsdorf <markus at trippelsdorf dot de>
- Cc: Martin Liška <mliska at suse dot cz>, gcc-patches at gcc dot gnu dot org, Jan Hubicka <hubicka at ucw dot cz>
- Date: Sat, 27 Sep 2014 01:27:13 +0200
- Subject: Re: [PATCH 3/5] IPA ICF pass
- Authentication-results: sourceware.org; auth=none
- References: <c5c2463c07186b4ba35b10f3063ecdd8f8d46d63 dot 1402913001 dot git dot mliska at suse dot cz> <ac1da49f0ee78643bc4521580862fa92e1051764 dot 1402913001 dot git dot mliska at suse dot cz> <20140620073156 dot GC12633 at tsaunders-iceball dot corp dot tor1 dot mozilla dot com> <alpine dot LSU dot 2 dot 11 dot 1407052337210 dot 30120 at tuna dot site> <20140705225351 dot GK16837 at kam dot mff dot cuni dot cz> <53C7E626 dot 8080400 at suse dot cz> <54255A09 dot 1090305 at suse dot cz> <20140926144441 dot GA4266 at x4>
> 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