This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, LTO] Re-assign BINFOs when unifying types
- From: Richard Guenther <rguenther at suse dot de>
- To: Martin Jambor <mjambor at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Thu, 11 Aug 2011 09:11:07 +0200 (CEST)
- Subject: Re: [PATCH, LTO] Re-assign BINFOs when unifying types
- References: <20110810204059.GA6942@virgil.arch.suse.de>
On Wed, 10 Aug 2011, Martin Jambor wrote:
> Hi,
>
> the following patch sets BINFOs of prevailing but non-main-variant
> types to what the main variant has, so that for a type t with a binfo
> the following is always true:
>
> TYPE_BINFO (t) == TYPE_BINFO (TYPE_MAIN_VARIANT (t))
>
> as I I believe in non-LTO world it always is. Moreover, the BINFO
> trees of non-prevailing type nodes now always get garbage collected
> (at least as far as my experiments with 483.xalancbmk go). The memory
> savings are negligible, but still I think we should do it.
>
> Bootstrapped and tested on x86_64-linux, also tested by LTOing Mozilla
> Firefox and 483.xalancbmk.
>
> OK for trunk?
Ok.
Thanks,
Richard.
> Thanks,
>
> Martin
>
>
> 2011-08-03 Martin Jambor <mjambor@suse.cz>
>
> * lto.c (uniquify_nodes): Use main variant's BINFO too.
>
> Index: src/gcc/lto/lto.c
> ===================================================================
> --- src.orig/gcc/lto/lto.c
> +++ src/gcc/lto/lto.c
> @@ -720,6 +720,8 @@ uniquify_nodes (struct data_in *data_in,
> {
> TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (mv);
> TYPE_NEXT_VARIANT (mv) = t;
> + if (RECORD_OR_UNION_TYPE_P (t))
> + TYPE_BINFO (t) = TYPE_BINFO (mv);
> }
>
> /* Finally adjust our main variant and fix it up. */
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix ImendÃrffer