tree-optimization/103990 - fix CFG cleanup regression from PRE change

This adjusts the CFG cleanup flow back to what it was before the
last change which fixes the observed regression of 541.leela_r with
LTO and FDO.

2022-01-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/103990
	* tree-pass.h (tail_merge_optimize): Drop unused argument.
	* tree-ssa-tail-merge.c (tail_merge_optimize): Likewise.
	* tree-ssa-pre.c (pass_pre::execute): Retain TODO_cleanup_cfg
	and adjust call to tail_merge_optimize.
This commit is contained in:
Richard Biener 2022-01-12 15:25:07 +01:00
parent 2c16dfe626
commit 2f62294dec
3 changed files with 5 additions and 7 deletions

View File

@ -412,7 +412,7 @@ extern gimple_opt_pass *make_pass_early_thread_jumps (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_split_crit_edges (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_laddress (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_pre (gcc::context *ctxt);
extern unsigned int tail_merge_optimize (unsigned int, bool);
extern unsigned int tail_merge_optimize (bool);
extern gimple_opt_pass *make_pass_profile (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_strip_predict_hints (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_lower_complex_O0 (gcc::context *ctxt);

View File

@ -4442,7 +4442,6 @@ pass_pre::execute (function *fun)
if (todo & TODO_cleanup_cfg)
{
cleanup_tree_cfg ();
todo &= ~TODO_cleanup_cfg;
need_crit_edge_split = true;
}
@ -4458,9 +4457,8 @@ pass_pre::execute (function *fun)
It should either:
- call merge_blocks after each tail merge iteration
- call merge_blocks after all tail merge iterations
- mark TODO_cleanup_cfg when necessary
- share the cfg cleanup with fini_pre. */
todo |= tail_merge_optimize (todo, need_crit_edge_split);
- mark TODO_cleanup_cfg when necessary. */
todo |= tail_merge_optimize (need_crit_edge_split);
free_rpo_vn ();

View File

@ -1724,7 +1724,7 @@ update_debug_stmts (void)
/* Runs tail merge optimization. */
unsigned int
tail_merge_optimize (unsigned int todo, bool need_crit_edge_split)
tail_merge_optimize (bool need_crit_edge_split)
{
int nr_bbs_removed_total = 0;
int nr_bbs_removed;
@ -1814,5 +1814,5 @@ tail_merge_optimize (unsigned int todo, bool need_crit_edge_split)
timevar_pop (TV_TREE_TAIL_MERGE);
return todo;
return 0;
}