Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(319)

Issue 4515186: [lto] Unify decl and type registration (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by Diego Novillo
Modified:
12 years, 11 months ago
Reviewers:
CC:
rguenther_suse.de, jh_suse.de, gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+146 lines, -146 lines) Patch
M gcc/lto-streamer-in.c View 3 chunks +0 lines, -141 lines 0 comments Download
M gcc/lto/lto.c View 3 chunks +146 lines, -5 lines 0 comments Download

Messages

Total messages: 6
Diego Novillo
As discussed in http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00063.html, this patch moves decl registration in symbol tables to the LTO ...
12 years, 11 months ago (2011-06-03 14:49:01 UTC) #1
rguenther_suse.de
On Fri, 3 Jun 2011, Diego Novillo wrote: > > As discussed in http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00063.html, > ...
12 years, 11 months ago (2011-06-06 08:50:08 UTC) #2
Diego Novillo
On Mon, Jun 6, 2011 at 04:50, Richard Guenther <rguenther@suse.de> wrote: > I'd have it ...
12 years, 11 months ago (2011-06-06 14:27:26 UTC) #3
Diego Novillo
On Mon, Jun 6, 2011 at 10:27, Diego Novillo <dnovillo@google.com> wrote: > On Mon, Jun ...
12 years, 11 months ago (2011-06-06 17:03:00 UTC) #4
Diego Novillo
On Mon, Jun 6, 2011 at 13:02, Diego Novillo <dnovillo@google.com> wrote: > On Mon, Jun ...
12 years, 11 months ago (2011-06-06 18:41:52 UTC) #5
rguenther_suse.de
12 years, 11 months ago (2011-06-07 08:50:46 UTC) #6
On Mon, 6 Jun 2011, Diego Novillo wrote:

> On Mon, Jun 6, 2011 at 10:27, Diego Novillo <dnovillo@google.com> wrote:
> > On Mon, Jun 6, 2011 at 04:50, Richard Guenther <rguenther@suse.de> wrote:
> >
> >> I'd have it done in the loop that computes canonical types, at this
> >> place we do not gain the advantage that the decl register functions
> >> get completely fixed up trees.
> >
> > Hm, yes, I had forgotten about the call to rest_of_decl_compilation.
> > Patch coming up.
> 
> You mean this?  Currently under testing.

Yes.

Thanks,
Richard.

> 
>         * lto.c (uniquify_nodes): Move code to register decls to
>         the loop that computes canonical types.
> 
> diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
> index 74dfecd..6e49ee7 100644
> --- a/gcc/lto/lto.c
> +++ b/gcc/lto/lto.c
> @@ -651,21 +651,13 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
>    /* Go backwards because children streamed for the first time come
>       as part of their parents, and hence are created after them.  */
> 
> -  /* First register all declarations and types in the cache.
> -     This makes sure to have the original structure in the type cycles
> -     when registering them and computing hashes.  */
> +  /* First register all the types in the cache.  This makes sure to
> +     have the original structure in the type cycles when registering
> +     them and computing hashes.  */
>    for (i = len; i-- > from;)
>      {
>        tree t = VEC_index (tree, cache->nodes, i);
> -
> -      if (t == NULL_TREE)
> -       continue;
> -
> -      if (TREE_CODE (t) == VAR_DECL)
> -       lto_register_var_decl_in_symtab (data_in, t);
> -      else if (TREE_CODE (t) == FUNCTION_DECL && !DECL_BUILT_IN (t))
> -       lto_register_function_decl_in_symtab (data_in, t);
> -      else if (TYPE_P (t))
> +      if (t && TYPE_P (t))
>         gimple_register_type (t);
>      }
> 
> @@ -788,19 +780,23 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
>         }
>      }
> 
> -  /* Finally compute the canonical type of t.  From this point
> -     there are no longer any types with TYPE_STRUCTURAL_EQUALITY_P
> -     and its type-based alias problems.  This step requires the
> -     TYPE_POINTER_TO lists being present, so make sure it is done
> -     last.  */
> +  /* Finally compute the canonical type of all TREE_TYPEs and register
> +     VAR_DECL and FUNCTION_DECL nodes in the symbol table.
> +     From this point there are no longer any types with
> +     TYPE_STRUCTURAL_EQUALITY_P and its type-based alias problems.
> +     This step requires the TYPE_POINTER_TO lists being present, so
> +     make sure it is done last.  */
>    for (i = len; i-- > from;)
>      {
>        tree t = VEC_index (tree, cache->nodes, i);
> -      if (!t
> -         || !TYPE_P (t))
> +      if (t == NULL_TREE)
>         continue;
> 
> -      if (!TYPE_CANONICAL (t))
> +      if (TREE_CODE (t) == VAR_DECL)
> +       lto_register_var_decl_in_symtab (data_in, t);
> +      else if (TREE_CODE (t) == FUNCTION_DECL && !DECL_BUILT_IN (t))
> +       lto_register_function_decl_in_symtab (data_in, t);
> +      else if (TYPE_P (t) && !TYPE_CANONICAL (t))
>         TYPE_CANONICAL (t) = gimple_register_canonical_type (t);
>      }
>  }
> 
> 

-- 
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
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b