Minimize clone counter memory usage in create_virtual_clone.
authorMichael Ploujnikov <michael.ploujnikov@oracle.com>
Fri, 30 Nov 2018 22:27:11 +0000 (22:27 +0000)
committerMichael Ploujnikov <plouj@gcc.gnu.org>
Fri, 30 Nov 2018 22:27:11 +0000 (22:27 +0000)
commit53aedcce09b10467e60b9717223191f28e0360a3
treec72d1dda4f4a1aa9ddf8b49d3b4e9c31949ec228
parentb75255a9b11ae672e569966860090d70ff10ffca
Minimize clone counter memory usage in create_virtual_clone.

Based on Martin Jambour's suggestion:
https://gcc.gnu.org/ml/gcc-patches/2018-09/msg00111.html

gcc:

* cgraph.h (clone_function_name): Add a variant that takes a
tree decl.
* cgraph.h (cgraph_node::create_virtual_clone): Add a new
argument: num_suffix.
* cgraphclones.c (cgraph_node::create_virtual_clone): Pass
num_suffix to clone_function_name.
(clone_function_name): Add a variant that takes a tree decl.
* ipa-cp.c (create_specialized_node): Keep track of clone
counters in clone_num_suffixes hash map.
(ipcp_driver): Free the counter hash map.
* ipa-hsa.c (process_hsa_functions): Creates at most one hsa
clone per function.

From-SVN: r266692
gcc/ChangeLog
gcc/cgraph.h
gcc/cgraphclones.c
gcc/ipa-cp.c
gcc/ipa-hsa.c