[PATCH 0/5] IPA ICF: more clean up

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/5] IPA ICF: more clean up

Martin Liška-2
Hi.

There's another series that brings yet another bunch of clean up
patches:

1) push/pop_cfun is overused, it is not needed
2) make dump reason more precise
3) Do not use custom hashing (add_expr, add_type) and use proper
   func_checker::hash_operand that can be improved for the future.
4) hash FIELD_DECL offset information to improve hashing
5) update statistics about really needed symbols during merging

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

Martin Liska (5):
  Do not overuse push/pop_cfun in IPA ICF.
  Update dump message in IPA ICF.
  Use func_checker::hash_operand for hashing of GIMPLE operands.
  Handle FIELD_DECL in IPA ICF.
  Update statistics about needed symbols in IPA ICF.

 gcc/ipa-icf-gimple.c |  10 +-
 gcc/ipa-icf-gimple.h |  11 ++
 gcc/ipa-icf.c        | 266 +++++++++----------------------------------
 gcc/ipa-icf.h        |  28 ++---
 4 files changed, 86 insertions(+), 229 deletions(-)

--
2.24.0

Reply | Threaded
Open this post in threaded view
|

[PATCH 1/5] Do not overuse push/pop_cfun in IPA ICF.

Martin Liška-2

gcc/ChangeLog:

2019-11-11  Martin Liska  <[hidden email]>

        * ipa-icf.c (sem_function::equals_private): Do not overuse
        push/pop_cfun functions.
---
 gcc/ipa-icf.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)


0001-Do-not-overuse-push-pop_cfun-in-IPA-ICF.patch (567 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/5] Update dump message in IPA ICF.

Martin Liška-2
In reply to this post by Martin Liška-2

gcc/ChangeLog:

2019-11-11  Martin Liska  <[hidden email]>

        * ipa-icf-gimple.c (func_checker::compare_gimple_call): Update
        bail out reason.
        (func_checker::compare_gimple_assign): Likewise.
---
 gcc/ipa-icf-gimple.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


0002-Update-dump-message-in-IPA-ICF.patch (831 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[PATCH 3/5] Use func_checker::hash_operand for hashing of GIMPLE operands.

Martin Liška-2
In reply to this post by Martin Liška-2

gcc/ChangeLog:

2019-11-11  Martin Liska  <[hidden email]>

        * ipa-icf-gimple.h (func_checker::func_checker): Add
        default constructor.
        * ipa-icf.c (sem_function::init): Make operand_equal_p
        and hash_operand public.
        (sem_item::add_expr): Remove.
        (sem_item::add_type): Remove.
        (sem_function::hash_stmt): Use m_checker for hashing
        of GIMPLE statements.
        (sem_function::parse): Init with checker.
        (sem_variable::parse): Pass NULL as checker.
        (sem_item_optimizer::parse_funcs_and_vars):
        Pass checker to ::parse function.
        (sem_item_optimizer::parse_nonsingleton_classes): Likewise.
        (sem_variable::parse): New function.
        (sem_variable::get_hash): Only return computed hash value.
        (sem_variable::init): Initialize hash of a variable.
        * ipa-icf.h: Remove add_expr, add_type and add func_checker
        to couple of functions as a new argument.
---
 gcc/ipa-icf-gimple.h |  11 ++
 gcc/ipa-icf.c        | 239 ++++++++-----------------------------------
 gcc/ipa-icf.h        |  20 ++--
 3 files changed, 60 insertions(+), 210 deletions(-)


0003-Use-func_checker-hash_operand-for-hashing-of-GIMPLE-.patch (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[PATCH 4/5] Handle FIELD_DECL in IPA ICF.

Martin Liška-2
In reply to this post by Martin Liška-2

gcc/ChangeLog:

2019-11-11  Martin Liska  <[hidden email]>

        * ipa-icf-gimple.c (func_checker::hash_operand): Improve
        func_checker::hash_operand by handling of FIELD_DECLs.
---
 gcc/ipa-icf-gimple.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


0004-Handle-FIELD_DECL-in-IPA-ICF.patch (522 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[PATCH 5/5] Update statistics about needed symbols in IPA ICF.

Martin Liška-2
In reply to this post by Martin Liška-2

gcc/ChangeLog:

2019-11-11  Martin Liska  <[hidden email]>

        * ipa-icf.c (sem_item_optimizer::execute): Save
        loaded_symbols.
        (sem_item_optimizer::parse_nonsingleton_classes):
        Return number of loaded symbols.
        (sem_item_optimizer::merge_classes): Print
        statistics about totally needed symbols.
        * ipa-icf.h (parse_nonsingleton_classes): Change return
        type.
        (merge_classes): Add one argument.
---
 gcc/ipa-icf.c | 20 +++++++++++++-------
 gcc/ipa-icf.h |  8 +++++---
 2 files changed, 18 insertions(+), 10 deletions(-)


0005-Update-statistics-about-needed-symbols-in-IPA-ICF.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/5] Do not overuse push/pop_cfun in IPA ICF.

Richard Biener-2
In reply to this post by Martin Liška-2
On Wed, Nov 13, 2019 at 10:22 AM Martin Liska <[hidden email]> wrote:
>

OK.

> gcc/ChangeLog:
>
> 2019-11-11  Martin Liska  <[hidden email]>
>
>         * ipa-icf.c (sem_function::equals_private): Do not overuse
>         push/pop_cfun functions.
> ---
>  gcc/ipa-icf.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 2/5] Update dump message in IPA ICF.

Jeff Law
In reply to this post by Martin Liška-2
On 11/8/19 12:13 AM, Martin Liska wrote:
>
> gcc/ChangeLog:
>
> 2019-11-11  Martin Liska  <[hidden email]>
>
> * ipa-icf-gimple.c (func_checker::compare_gimple_call): Update
> bail out reason.
> (func_checker::compare_gimple_assign): Likewise.
OK
jeff

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 4/5] Handle FIELD_DECL in IPA ICF.

Jeff Law
In reply to this post by Martin Liška-2
On 11/8/19 3:01 AM, Martin Liska wrote:
>
> gcc/ChangeLog:
>
> 2019-11-11  Martin Liska  <[hidden email]>
>
> * ipa-icf-gimple.c (func_checker::hash_operand): Improve
> func_checker::hash_operand by handling of FIELD_DECLs.
OK
jeff

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 5/5] Update statistics about needed symbols in IPA ICF.

Jeff Law
In reply to this post by Martin Liška-2
On 11/11/19 6:38 AM, Martin Liska wrote:

>
> gcc/ChangeLog:
>
> 2019-11-11  Martin Liska  <[hidden email]>
>
> * ipa-icf.c (sem_item_optimizer::execute): Save
> loaded_symbols.
> (sem_item_optimizer::parse_nonsingleton_classes):
> Return number of loaded symbols.
> (sem_item_optimizer::merge_classes): Print
> statistics about totally needed symbols.
> * ipa-icf.h (parse_nonsingleton_classes): Change return
> type.
> (merge_classes): Add one argument.
OK
jeff

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 3/5] Use func_checker::hash_operand for hashing of GIMPLE operands.

Jeff Law
In reply to this post by Martin Liška-2
On 11/8/19 1:31 AM, Martin Liska wrote:

> gcc/ChangeLog:
>
> 2019-11-11  Martin Liska  <[hidden email]>
>
> * ipa-icf-gimple.h (func_checker::func_checker): Add
> default constructor.
> * ipa-icf.c (sem_function::init): Make operand_equal_p
> and hash_operand public.
> (sem_item::add_expr): Remove.
> (sem_item::add_type): Remove.
> (sem_function::hash_stmt): Use m_checker for hashing
> of GIMPLE statements.
> (sem_function::parse): Init with checker.
> (sem_variable::parse): Pass NULL as checker.
> (sem_item_optimizer::parse_funcs_and_vars):
> Pass checker to ::parse function.
> (sem_item_optimizer::parse_nonsingleton_classes): Likewise.
> (sem_variable::parse): New function.
> (sem_variable::get_hash): Only return computed hash value.
> (sem_variable::init): Initialize hash of a variable.
> * ipa-icf.h: Remove add_expr, add_type and add func_checker
> to couple of functions as a new argument.
OK
jeff