public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Avoid quadratic behaviour of symbol renaming
@ 2023-01-04 17:15 Jan Hubicka
  0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2023-01-04 17:15 UTC (permalink / raw)
  To: gcc-patches, mjambor

Hi,
LTO partitioning does renaming of symbols that ends up in same partition
and clash with assembler name.  This is done for "ordinary" symbols (such
as static functions) but also for symbols that are kept only as master
clones holding bodies of functions to be specialized later.
This is done only becuase we stream bodies to named section and clash
in names would mean that ltrans will load wrong body and crash.

Martin recently added bit to stream body for clones that are needed
since this makes it easier to bookeep what summaries are output.  THis
however triggers mass renaming of inline clones that is very slow
and unnecesary since their bodies are never streamed.

Bootstrapped/regtested x86_64-linux, comitted.

gcc/lto/ChangeLog:

2023-01-04  Jan Hubicka  <hubicka@ucw.cz>

	* lto-partition.cc (may_need_named_section_p): Clones with no body
	need no remaning.

diff --git a/gcc/lto/lto-partition.cc b/gcc/lto/lto-partition.cc
index 654d67f272e..b96d1dd473d 100644
--- a/gcc/lto/lto-partition.cc
+++ b/gcc/lto/lto-partition.cc
@@ -1035,15 +1035,18 @@ promote_symbol (symtab_node *node)
 /* Return true if NODE needs named section even if it won't land in
    the partition symbol table.
 
-   FIXME: we should really not use named sections for inline clones
-   and master clones.  */
+   FIXME: we should really not use named sections for master clones.  */
 
 static bool
 may_need_named_section_p (lto_symtab_encoder_t encoder, symtab_node *node)
 {
   struct cgraph_node *cnode = dyn_cast <cgraph_node *> (node);
+  /* We do not need to handle variables since we never clone them.  */
   if (!cnode)
     return false;
+  /* Only master clones will have bodies streamed.  */
+  if (cnode->clone_of)
+    return false;
   if (node->real_symbol_p ())
     return false;
   return (!encoder

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-04 17:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04 17:15 Avoid quadratic behaviour of symbol renaming Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).