https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92535
Bug ID: 92535
Summary: [10 regression] ICF is relatively expensive and became
less effective
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ipa
Assignee: unassigned at gcc dot gnu.org
Reporter: hubicka at gcc dot gnu.org
CC: marxin at gcc dot gnu.org
Target Milestone: ---
Created attachment 47274
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47274&action=edit
Memory use graph for linktime for GCC10
ICF currently is very conservative optimizing libxul.so saving only about 1.5%
of text segment:
$ bloaty libxul.so -- libxul.so.old2
VM SIZE FILE SIZE
++++++++++++++ GROWING ++++++++++++++
+1.5% +1.21Mi .text +1.21Mi +1.5%
+4.4% +351Ki .eh_frame +351Ki +4.4%
+6.0% +102Ki .eh_frame_hdr +102Ki +6.0%
[ = ] 0 .strtab +62.4Ki +0.2%
+0.5% +52.6Ki .rela.dyn +52.6Ki +0.5%
+0.1% +19.6Ki .rodata +19.6Ki +0.1%
+0.4% +13.2Ki .data.rel.ro.local +13.2Ki +0.4%
+1.3% +9.97Ki .data.rel.ro +9.97Ki +1.3%
+0.2% +12 .gcc_except_table +12 +0.2%
-------------- SHRINKING --------------
[ = ] 0 .symtab -10.0Ki -0.1%
-0.0% -64 .data -64 -0.0%
-0.0% -16 .bss 0 [ = ]
-+-+-+-+-+-+-+ MIXED +-+-+-+-+-+-+-
+76% +124 [Unmapped] -3.04Ki -77.5%
+1.3% +1.75Mi TOTAL +1.79Mi +0.9%
This used to be 7% in GCC5 (at Firefox from 2015)
At the same time it is relatively expensive memory wise and compile time wise.
It increases peak memory use from 6GB to 7.5GB and compile time from:
real 8m57.454s
user 91m8.020s
sys 6m20.372s
to
real 9m41.361s
user 91m47.076s
sys 6m16.760s
For GCC 9 the code size improvement is 2.3%, build time change is:
real 7m53.778s
user 76m10.368s
sys 6m55.324s
to
real 8m14.613s
user 72m57.932s
sys 6m32.792s
and peak memory use is from 8gm to 10gb.