[Bug ipa/89306] [8/9 regression] Hash based IPA summaries are too slow and consume up to 80% of IPA optimization time.

2019-02-18 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89306

--- Comment #7 from Martin Liška  ---
Author: marxin
Date: Mon Feb 18 08:21:23 2019
New Revision: 268979

URL: https://gcc.gnu.org/viewcvs?rev=268979=gcc=rev
Log:
Come up with fast {function,call}_summary classes (PR ipa/89306).

2019-02-18  Martin Liska  

PR ipa/89306
* cgraph.c (symbol_table::create_edge): Set m_summary_id to -1
by default.
(symbol_table::free_edge): Recycle m_summary_id.
* cgraph.h (get_summary_id): New.
(symbol_table::release_symbol): Set m_summary_id to -1
by default.
(symbol_table::allocate_cgraph_symbol): Recycle m_summary_id.
* ipa-fnsummary.c (ipa_fn_summary_t): Switch from
function_summary to fast_function_summary.
* ipa-fnsummary.h (ipa_fn_summary_t): Likewise.
* ipa-pure-const.c (class funct_state_summary_t):
Switch from function_summary to fast_function_summary.
* ipa-reference.c (class ipa_ref_var_info_summary_t): Likewise.
(class ipa_ref_opt_summary_t): Switch from function_summary
to fast_function_summary.
* symbol-summary.h (class function_summary_base): New class
that is created from base of former function_summary.
(function_summary_base::unregister_hooks): New.
(class function_summary): Inherit from function_summary_base.
(class call_summary_base): New class
that is created from base of former call_summary.
(class call_summary): Inherit from call_summary_base.
(struct is_same): New.
(class fast_function_summary): New summary class.
(class fast_call_summary): New summary class.
* vec.h (vec_safe_grow_cleared): New function.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/cgraph.c
trunk/gcc/cgraph.h
trunk/gcc/ipa-fnsummary.c
trunk/gcc/ipa-fnsummary.h
trunk/gcc/ipa-pure-const.c
trunk/gcc/ipa-reference.c
trunk/gcc/symbol-summary.h
trunk/gcc/vec.h

[Bug ipa/89306] [8/9 regression] Hash based IPA summaries are too slow and consume up to 80% of IPA optimization time.

2019-02-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89306

--- Comment #6 from Martin Liška  ---
Having all *.o files in RAM, I see time change for WPA from 93.0 to 90.0s.
So relatively small improvement.

[Bug ipa/89306] [8/9 regression] Hash based IPA summaries are too slow and consume up to 80% of IPA optimization time.

2019-02-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89306

Martin Liška  changed:

   What|Removed |Added

 Status|ASSIGNED|WAITING

--- Comment #5 from Martin Liška  ---
So considering only fns with more that 0.05% I see before:

 0.83%  lto1-wpa lto1  [.]
hash_table, ipa_fn_summary*,
simple_hashmap_traits >,
ipa_fn_summary*> >::hash_entry, xcallocator>::find_with_hash
 0.37%  lto1-wpa lto1  [.]
hash_table, ipa_call_summary*,
simple_hashmap_traits >,
ipa_call_summary*> >::hash_entry, xcallocator>::find_slot_with_hash
 0.36%  lto1-wpa lto1  [.]
hash_table, ipa_call_summary*,
simple_hashmap_traits >,
ipa_call_summary*> >::hash_entry, xcallocator>::find_with_hash

After the patch:

 0.49%  lto1-wpa lto1  [.]
fast_call_summary::get_create

So there's an improvement, but it's quite small.
Can you Honza re-measure that for me please?

[Bug ipa/89306] [8/9 regression] Hash based IPA summaries are too slow and consume up to 80% of IPA optimization time.

2019-02-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89306

--- Comment #4 from Martin Liška  ---
Created attachment 45720
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45720=edit
libxul.so WPA (--enable-checking=release) after patch

[Bug ipa/89306] [8/9 regression] Hash based IPA summaries are too slow and consume up to 80% of IPA optimization time.

2019-02-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89306

--- Comment #3 from Martin Liška  ---
Created attachment 45719
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45719=edit
libxul.so WPA (--enable-checking=release) before patch

[Bug ipa/89306] [8/9 regression] Hash based IPA summaries are too slow and consume up to 80% of IPA optimization time.

2019-02-14 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89306

--- Comment #2 from Martin Liška  ---
Created attachment 45718
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45718=edit
Tentative patch

[Bug ipa/89306] [8/9 regression] Hash based IPA summaries are too slow and consume up to 80% of IPA optimization time.

2019-02-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89306

Martin Liška  changed:

   What|Removed |Added

  Known to work||8.2.0, 9.0
   Target Milestone|--- |9.0

[Bug ipa/89306] [8/9 regression] Hash based IPA summaries are too slow and consume up to 80% of IPA optimization time.

2019-02-12 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89306

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-02-12
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Mine then.