This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Make ipa-icf to not prevent devirtualization
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 15 Jan 2016 12:40:56 +0100
- Subject: Re: Make ipa-icf to not prevent devirtualization
- Authentication-results: sourceware.org; auth=none
- References: <20160115110148 dot GC77658 at kam dot mff dot cuni dot cz> <CAFiYyc2Mzo4ihnAKXQYZ1GP9ovh+XvZPhtVLBM2K_1FmDQ16rw at mail dot gmail dot com>
> On Fri, Jan 15, 2016 at 12:01 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> > Hi,
> > this patch avoid ipa-icf to take away body of a virtual function which is a subject
> > of later devirtualization.
>
> But isn't can_remove_if_no_direct_alls_p () supposed to return false
> then? (depending
> on cgraph state)
No, can_remove_if_no_direct_calls_p returns true if you can remove the body after
you eliminate all calls (as the name is supposed to suggest).
For the virtual function in question this is satisfied, but unfortunately in ICF
case makes us to miss optimization for no very good reason. it is indeed quite bit
more subtle than I would like to. Changing the predicate itself will however make
inliner to inline those functions less agressively which is not very desired either.
Honza