aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
authorMichael Ploujnikov <michael.ploujnikov@oracle.com>2018-11-30 22:27:11 +0000
committerMichael Ploujnikov <plouj@gcc.gnu.org>2018-11-30 22:27:11 +0000
commit53aedcce09b10467e60b9717223191f28e0360a3 (patch)
treec72d1dda4f4a1aa9ddf8b49d3b4e9c31949ec228 /gcc/cgraph.h
parentb75255a9b11ae672e569966860090d70ff10ffca (diff)
downloadgcc-53aedcce09b10467e60b9717223191f28e0360a3.zip
gcc-53aedcce09b10467e60b9717223191f28e0360a3.tar.gz
gcc-53aedcce09b10467e60b9717223191f28e0360a3.tar.bz2
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
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index dd1e8fd..b8e23cc 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -968,11 +968,13 @@ public:
cgraph_node *new_inlined_to,
bitmap args_to_skip, const char *suffix = NULL);
- /* Create callgraph node clone with new declaration. The actual body will
- be copied later at compilation stage. */
+ /* Create callgraph node clone with new declaration. The actual body will be
+ copied later at compilation stage. The name of the new clone will be
+ constructed from the name of the original node, SUFFIX and NUM_SUFFIX. */
cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers,
vec<ipa_replace_map *, va_gc> *tree_map,
- bitmap args_to_skip, const char * suffix);
+ bitmap args_to_skip, const char * suffix,
+ unsigned num_suffix);
/* cgraph node being removed from symbol table; see if its entry can be
replaced by other inline clone. */
@@ -2386,6 +2388,8 @@ tree clone_function_name_numbered (const char *name, const char *suffix);
tree clone_function_name_numbered (tree decl, const char *suffix);
tree clone_function_name (const char *name, const char *suffix,
unsigned long number);
+tree clone_function_name (tree decl, const char *suffix,
+ unsigned long number);
tree clone_function_name (tree decl, const char *suffix);
void tree_function_versioning (tree, tree, vec<ipa_replace_map *, va_gc> *,