This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/4] New data structure for cgraph_summary introduced.


On 12/22/2014 03:50 PM, Martin Liška wrote:
On 12/18/2014 08:40 PM, Jan Hubicka wrote:
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.

Hello.

There's patch I've been just testing. It removes summary_uid and uid is going to be
really unique. I tested the change on Inkscape WPA, and there's time difference in level
of < 1%.

Ready for trunk after proper testing?
Thanks,
Martin

+
+/* 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



PING.

Thanks,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]