Skip to content
Snippets Groups Projects
Commit 0e590b68 authored by Jan Hubicka's avatar Jan Hubicka
Browse files

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.
parent c26d7df1
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment