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: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: Trevor Saunders <tsaunders at mozilla dot com>, Martin Liška <mliska at suse dot cz>, gcc-patches at gcc dot gnu dot org, Jan Hubicka <hubicka at ucw dot cz>
- Date: Sun, 6 Jul 2014 00:53:52 +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>
> On Fri, 20 Jun 2014, Trevor Saunders wrote:
> >> +@item -fipa-icf
> >> +@opindex fipa-icf
> >> +Perform Identical Code Folding for functions and read-only variables.
I would perhaps explicitly say that the optimizations reduce code size
and may disturb unwind stacks by replacing a function by equivalent
one with different name.
> >> +Behavior is similar to Gold Linker ICF optimization. Symbols proved
Perhaps tell a bit more here. The optimization works more effectively with link
time optimization enabled and that the Gold and GCC ICF works on different
levels and thus are not equivalent optimizations - there are equivallences that
are found only by GCC and equivalences found only by Gold.
>> +as semantically equivalent are redirected to corresponding symbol. The pass
> >> +sensitively decides for usage of alias, thunk or local redirection.
> >> +This flag is enabled by default at @option{-O2}.
Probably at -Os too.
>
> I found this a bit hard to read/understand.
>
> Perhaps first describe what it does and then, before "This flag is
> enabled..." note that "This is similar to the ICF optimization performed
> by the Gold linker".
>
> "Symbols proved" (plural) vs "to corresponding symbol" seems to miss
> an an "a" as in "a corresponding symbol". Alas, how is that one
> determined? Is this more "...are merged into one", from the user's
> perspective?
>
> What does it mean to "sensitively decide for usage of alias, thunk,
> or local redirection"?
I think this is just a technical detail of the implementation. I would not put that
into user manual. It means that for some functions you can make alias, for others
you need thunk (so addresses stay different)
>
> Gerald