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]

[PATCH] Reduce compile time hog in symbol-summary.h


Hello.

For every created function_summary, we validate (with flag_checking) that
all cgraph_nodes have summary_uid > 0. It produces a compile hog.
It's sufficient to validate that for nodes that really utilize a function summary.

Patch can bootstrap&regtest on ppc64le-linux-gnu.

Ready for trunk?
Martin
>From e5a33bd95a102d16d38bbe2a35ecf0fd9a196ee3 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 29 Apr 2016 13:48:31 +0200
Subject: [PATCH] Symbol summary: refactor usage of gcc_checking_asserts

gcc/ChangeLog:

2016-04-29  Martin Liska  <mliska@suse.cz>

	* symbol-summary.h (function_summary::function_summary):
	Remove checking assert for all cgraph nodes.
	(function_summary::get): Check summary_uid.
	(symtab_insertion): Check summary_uid.
---
 gcc/symbol-summary.h | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h
index c0dd5aa..a22352b 100644
--- a/gcc/symbol-summary.h
+++ b/gcc/symbol-summary.h
@@ -39,13 +39,6 @@ public:
   function_summary (symbol_table *symtab, bool ggc = false): m_ggc (ggc),
     m_map (13, ggc), m_insertion_enabled (true), m_symtab (symtab)
   {
-    if (flag_checking)
-      {
-	cgraph_node *node;
-	FOR_EACH_FUNCTION (node)
-	  gcc_assert (node->summary_uid > 0);
-      }
-
     m_symtab_insertion_hook =
       symtab->add_cgraph_insertion_hook
       (function_summary::symtab_insertion, this);
@@ -124,6 +117,7 @@ public:
   /* Getter for summary callgraph node pointer.  */
   T* get (cgraph_node *node)
   {
+    gcc_checking_assert (node->summary_uid);
     return get (node->summary_uid);
   }
 
@@ -148,6 +142,7 @@ public:
   /* Symbol insertion hook that is registered to symbol table.  */
   static void symtab_insertion (cgraph_node *node, void *data)
   {
+    gcc_checking_assert (node->summary_uid);
     function_summary *summary = (function_summary <T *> *) (data);
 
     if (summary->m_insertion_enabled)
-- 
2.8.1


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