Commit 6ae533cf by Josef Zlomek Committed by Josef Zlomek

PR optimization/13430, PR optimization/12322

	PR optimization/13430, PR optimization/12322
	* bb-reorder.c (copy_bb_p): Do not allow block with many successors to
	be copied.
	(find_traces_1_round): Surround check for fake edges by
	#ifdef ENABLE_CHECKING #endif.

From-SVN: r74887
parent 5d7f899b
2003-12-20 Josef Zlomek <zlomekj@suse.cz>
PR optimization/13430, PR optimization/12322
* bb-reorder.c (copy_bb_p): Do not allow block with many successors to
be copied.
(find_traces_1_round): Surround check for fake edges by
#ifdef ENABLE_CHECKING #endif.
2003-12-20 Eric Botcazou <ebotcazou@libertysurf.fr> 2003-12-20 Eric Botcazou <ebotcazou@libertysurf.fr>
PR other/7956 PR other/7956
......
...@@ -415,8 +415,10 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, ...@@ -415,8 +415,10 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
/* Select the successor that will be placed after BB. */ /* Select the successor that will be placed after BB. */
for (e = bb->succ; e; e = e->succ_next) for (e = bb->succ; e; e = e->succ_next)
{ {
#ifdef ENABLE_CHECKING
if (e->flags & EDGE_FAKE) if (e->flags & EDGE_FAKE)
abort (); abort ();
#endif
if (e->dest == EXIT_BLOCK_PTR) if (e->dest == EXIT_BLOCK_PTR)
continue; continue;
...@@ -1001,6 +1003,8 @@ copy_bb_p (basic_block bb, int code_may_grow) ...@@ -1001,6 +1003,8 @@ copy_bb_p (basic_block bb, int code_may_grow)
int size = 0; int size = 0;
int max_size = uncond_jump_length; int max_size = uncond_jump_length;
rtx insn; rtx insn;
int n_succ;
edge e;
if (!bb->frequency) if (!bb->frequency)
return false; return false;
...@@ -1009,6 +1013,15 @@ copy_bb_p (basic_block bb, int code_may_grow) ...@@ -1009,6 +1013,15 @@ copy_bb_p (basic_block bb, int code_may_grow)
if (!cfg_layout_can_duplicate_bb_p (bb)) if (!cfg_layout_can_duplicate_bb_p (bb))
return false; return false;
/* Avoid duplicating blocks which have many successors (PR/13430). */
n_succ = 0;
for (e = bb->succ; e; e = e->succ_next)
{
n_succ++;
if (n_succ > 8)
return false;
}
if (code_may_grow && maybe_hot_bb_p (bb)) if (code_may_grow && maybe_hot_bb_p (bb))
max_size *= 8; max_size *= 8;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment