This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/4] New data structure for cgraph_summary introduced.
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Martin Liška <mliska at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 18 Dec 2014 20:40:01 +0100
- Subject: Re: [PATCH 2/4] New data structure for cgraph_summary introduced.
- Authentication-results: sourceware.org; auth=none
- References: <cd4c62522f43eb2d2ad92769431e91c8d8bd15bc dot 1415888515 dot git dot mliska at suse dot cz> <8d6246a176f0270dee1f5b190e8ecbddebee342f dot 1415888515 dot git dot mliska at suse dot cz> <20141113155041 dot GF11013 at kam dot mff dot cuni dot cz> <54660BF7 dot 1020506 at suse dot cz> <54661E6C dot 3070600 at suse dot cz> <5485D981 dot 10203 at suse dot cz>
> 2014-12-08 Martin Liska <mliska@suse.cz>
>
> * cgraph.h (symbol_table::allocate_cgraph_symbol): Summary UID
> is filled up.
> * symbol-summary.h: New file.
> * gengtype.c (open_base_files): Add symbol-summary.h.
> * toplev.c (general_init): Call constructor of symbol_table.
> ---
> gcc/cgraph.h | 8 ++
> gcc/gengtype.c | 4 +-
> gcc/symbol-summary.h | 281 +++++++++++++++++++++++++++++++++++++++++++++++++++
> gcc/toplev.c | 3 +-
> 4 files changed, 293 insertions(+), 3 deletions(-)
> create mode 100644 gcc/symbol-summary.h
>
> diff --git a/gcc/cgraph.h b/gcc/cgraph.h
> index a5c5f56..1664bd7 100644
> --- a/gcc/cgraph.h
> +++ b/gcc/cgraph.h
> @@ -1237,6 +1237,8 @@ public:
> int count_materialization_scale;
> /* Unique id of the node. */
> int uid;
> + /* Summary unique id of the node. */
> + int summary_uid;
Hmm, can't we just use uid here? I guess the only difference is that summary
uid is not kept dense, unlike the uid.
This should not propagate into much of trouble simply because the summary datastructure
should safely remove the summaires via removal hook.
> +
> +/* We want to pass just pointer types as argument for function_summary
> + template class. */
> +
> +template <class T>
> +class function_summary
> +{
> +private:
> + function_summary();
> +};
> +
> +template <class T>
> +class GTY((user)) function_summary <T *>
Eventually I would like this to allow attaching summaries to variables (and symbols in general),
too. But currently we do not have use for it, so we can care about this later.
The patch is OK. Preferrably with summary_uid replaced by uid if it is easily doable.
Honza