* [PATCH] Significantly speed up verifiers for a cgraph_node with many clones.
@ 2019-02-22 11:02 Martin Liška
2019-03-06 10:05 ` Martin Liška
2019-03-07 15:38 ` Jan Hubicka
0 siblings, 2 replies; 3+ messages in thread
From: Martin Liška @ 2019-02-22 11:02 UTC (permalink / raw)
To: gcc-patches; +Cc: Jan Hubicka
[-- Attachment #1: Type: text/plain, Size: 691 bytes --]
Hi.
The patch makes a significant verifier speed up in a project that
has a dtor for which we create ~70.000 clones.
Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
Ready to be installed?
Thanks,
Martin
gcc/ChangeLog:
2019-02-22 Martin Liska <mliska@suse.cz>
* cgraph.c (cgraph_node::verify_node): Verify with a neighbour
which is equivalent to searching for this in clones chain.
* symtab.c (symtab_node::verify_base): Similarly compare ASM
names with a neighbour and special case first node in a chain.
---
gcc/cgraph.c | 14 +++++++-------
gcc/symtab.c | 39 +++++++++++++++++++++++----------------
2 files changed, 30 insertions(+), 23 deletions(-)
[-- Attachment #2: 0001-Significantly-speed-up-verifiers-for-a-cgraph_node-w.patch --]
[-- Type: text/x-patch, Size: 2135 bytes --]
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index de82316d4b1..dfe1833ed1d 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -3240,14 +3240,14 @@ cgraph_node::verify_node (void)
if (clone_of)
{
- cgraph_node *n;
- for (n = clone_of->clones; n; n = n->next_sibling_clone)
- if (n == this)
- break;
- if (!n)
+ cgraph_node *first_clone = clone_of->clones;
+ if (first_clone != this)
{
- error ("cgraph_node has wrong clone_of");
- error_found = true;
+ if (prev_sibling_clone->clone_of != clone_of)
+ {
+ error ("cgraph_node has wrong clone_of");
+ error_found = true;
+ }
}
}
if (clones)
diff --git a/gcc/symtab.c b/gcc/symtab.c
index c9fa16b353b..16a21359f8d 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -1040,23 +1040,30 @@ symtab_node::verify_base (void)
if (symtab->assembler_name_hash)
{
hashed_node = symtab_node::get_for_asmname (DECL_ASSEMBLER_NAME (decl));
- if (hashed_node && hashed_node->previous_sharing_asm_name)
+ if (hashed_node)
{
- error ("assembler name hash list corrupted");
- error_found = true;
- }
- while (hashed_node)
- {
- if (hashed_node == this)
- break;
- hashed_node = hashed_node->next_sharing_asm_name;
- }
- if (!hashed_node
- && !(is_a <varpool_node *> (this)
- && DECL_HARD_REGISTER (decl)))
- {
- error ("node not found in symtab assembler name hash");
- error_found = true;
+ if (hashed_node->previous_sharing_asm_name)
+ {
+ error ("assembler name hash list corrupted");
+ error_found = true;
+ }
+ else if (previous_sharing_asm_name == NULL)
+ {
+ if (hashed_node != this)
+ {
+ error ("assembler name hash list corrupted");
+ error_found = true;
+ }
+ }
+ else if (!(is_a <varpool_node *> (this) && DECL_HARD_REGISTER (decl)))
+ {
+ if (!asmname_hasher::equal (previous_sharing_asm_name,
+ DECL_ASSEMBLER_NAME (decl)))
+ {
+ error ("node not found in symtab assembler name hash");
+ error_found = true;
+ }
+ }
}
}
if (previous_sharing_asm_name
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Significantly speed up verifiers for a cgraph_node with many clones.
2019-02-22 11:02 [PATCH] Significantly speed up verifiers for a cgraph_node with many clones Martin Liška
@ 2019-03-06 10:05 ` Martin Liška
2019-03-07 15:38 ` Jan Hubicka
1 sibling, 0 replies; 3+ messages in thread
From: Martin Liška @ 2019-03-06 10:05 UTC (permalink / raw)
To: gcc-patches; +Cc: Jan Hubicka
@Honza: PING^1
On 2/22/19 11:59 AM, Martin Liška wrote:
> Hi.
>
> The patch makes a significant verifier speed up in a project that
> has a dtor for which we create ~70.000 clones.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2019-02-22 Martin Liska <mliska@suse.cz>
>
> * cgraph.c (cgraph_node::verify_node): Verify with a neighbour
> which is equivalent to searching for this in clones chain.
> * symtab.c (symtab_node::verify_base): Similarly compare ASM
> names with a neighbour and special case first node in a chain.
> ---
> gcc/cgraph.c | 14 +++++++-------
> gcc/symtab.c | 39 +++++++++++++++++++++++----------------
> 2 files changed, 30 insertions(+), 23 deletions(-)
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Significantly speed up verifiers for a cgraph_node with many clones.
2019-02-22 11:02 [PATCH] Significantly speed up verifiers for a cgraph_node with many clones Martin Liška
2019-03-06 10:05 ` Martin Liška
@ 2019-03-07 15:38 ` Jan Hubicka
1 sibling, 0 replies; 3+ messages in thread
From: Jan Hubicka @ 2019-03-07 15:38 UTC (permalink / raw)
To: Martin Liška; +Cc: gcc-patches
> Hi.
>
> The patch makes a significant verifier speed up in a project that
> has a dtor for which we create ~70.000 clones.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2019-02-22 Martin Liska <mliska@suse.cz>
>
> * cgraph.c (cgraph_node::verify_node): Verify with a neighbour
> which is equivalent to searching for this in clones chain.
> * symtab.c (symtab_node::verify_base): Similarly compare ASM
> names with a neighbour and special case first node in a chain.
OK, thanks!
Honza
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-07 15:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22 11:02 [PATCH] Significantly speed up verifiers for a cgraph_node with many clones Martin Liška
2019-03-06 10:05 ` Martin Liška
2019-03-07 15:38 ` 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).