aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-10-22 17:32:32 +0200
committerJan Hubicka <jh@suse.cz>2020-10-22 17:32:32 +0200
commit0e590b68fa3743656f40aee8374b788b108350c7 (patch)
tree1183a176f4543e9e141d2a2657e1212e6f1dc7af /gcc/cgraph.h
parentc26d7df103197e52dcd6edbb9a7f58eafdd6c715 (diff)
downloadgcc-0e590b68fa3743656f40aee8374b788b108350c7.zip
gcc-0e590b68fa3743656f40aee8374b788b108350c7.tar.gz
gcc-0e590b68fa3743656f40aee8374b788b108350c7.tar.bz2
Materialize clones on demand
this patch removes the pass to materialize all clones and instead this is now done on demand. The motivation is to reduce lifetime of function bodies in ltrans that should noticeably reduce memory use for highly parallel compilations of large programs (like Martin does) or with partitioning reduced/disabled. For cc1 with one partition the memory use seems to go down from 4gb to cca 1.5gb (seeing from top, so this is not particularly accurate). gcc/ChangeLog: 2020-10-22 Jan Hubicka <hubicka@ucw.cz> * cgraph.c (cgraph_node::get_untransformed_body): Perform lazy clone materialization. * cgraph.h (cgraph_node::materialize_clone): Declare. (symbol_table::materialize_all_clones): Remove. * cgraphclones.c (cgraph_materialize_clone): Turn to ... (cgraph_node::materialize_clone): .. this one; move here dumping from symbol_table::materialize_all_clones. (symbol_table::materialize_all_clones): Remove. * cgraphunit.c (mark_functions_to_output): Clear stmt references. (cgraph_node::expand): Initialize bitmaps early; do not call execute_all_ipa_transforms if there are no transforms. * ipa-inline-transform.c (save_inline_function_body): Fix formating. (inline_transform): Materialize all clones before function is modified. * ipa-param-manipulation.c (ipa_param_adjustments::modify_call): Materialize clone if needed. * ipa.c (class pass_materialize_all_clones): Remove. (make_pass_materialize_all_clones): Remove. * passes.c (execute_all_ipa_transforms): Materialize all clones. * passes.def: Remove pass_materialize_all_clones. * tree-pass.h (make_pass_materialize_all_clones): Remove. * tree-ssa-structalias.c (ipa_pta_execute): Clear refs.
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index c953a1b..6c45034 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1145,12 +1145,14 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node
/* When doing LTO, read cgraph_node's body from disk if it is not already
present. */
- bool get_untransformed_body (void);
+ bool get_untransformed_body ();
/* Prepare function body. When doing LTO, read cgraph_node's body from disk
if it is not already present. When some IPA transformations are scheduled,
apply them. */
- bool get_body (void);
+ bool get_body ();
+
+ void materialize_clone (void);
/* Release memory used to represent body of function.
Use this only for functions that are released before being translated to
@@ -2286,13 +2288,6 @@ public:
functions inserted into callgraph already at construction time. */
void process_new_functions (void);
- /* Once all functions from compilation unit are in memory, produce all clones
- and update all calls. We might also do this on demand if we don't want to
- bring all functions to memory prior compilation, but current WHOPR
- implementation does that and it is bit easier to keep everything right
- in this order. */
- void materialize_all_clones (void);
-
/* Register a symbol NODE. */
inline void register_symbol (symtab_node *node);