tree-if-conv.c (add_bb_predicate_gimplified_stmts): Use gimple_seq_add_seq_without_update.

2016-05-20  Richard Biener  <rguenther@suse.de>

	* tree-if-conv.c (add_bb_predicate_gimplified_stmts): Use
	gimple_seq_add_seq_without_update.
	(release_bb_predicate): Assert we have no operands to free.
	(if_convertible_loop_p_1): Calculate post dominators later.
	Do not free BB predicates here.
	(combine_blocks): Do not recompute BB predicates.
	(version_loop_for_if_conversion): Save BB predicates around
	loop versioning.

	* gcc.dg/tree-ssa/ifc-cd.c: Adjust.

From-SVN: r236498
This commit is contained in:
Richard Biener 2016-05-20 09:01:23 +00:00 committed by Richard Biener
parent ceb17928e5
commit 58f10249a8
4 changed files with 32 additions and 10 deletions

View File

@ -1,3 +1,14 @@
2016-05-20 Richard Biener <rguenther@suse.de>
* tree-if-conv.c (add_bb_predicate_gimplified_stmts): Use
gimple_seq_add_seq_without_update.
(release_bb_predicate): Assert we have no operands to free.
(if_convertible_loop_p_1): Calculate post dominators later.
Do not free BB predicates here.
(combine_blocks): Do not recompute BB predicates.
(version_loop_for_if_conversion): Save BB predicates around
loop versioning.
2016-05-19 Segher Boessenkool <segher@kernel.crashing.org>
* function.c (make_epilogue_seq): Remove epilogue_end parameter.

View File

@ -1,3 +1,7 @@
2016-05-20 Richard Biener <rguenther@suse.de>
* gcc.dg/tree-ssa/ifc-cd.c: Adjust.
2016-05-19 Marek Polacek <polacek@redhat.com>
PR c++/71075

View File

@ -25,4 +25,4 @@ void foo (int *x1, int *x2, int *x3, int *x4, int *y)
}
}
/* { dg-final { scan-tree-dump-times "Use predicate of bb" 8 "ifcvt" } } */
/* { dg-final { scan-tree-dump-times "Use predicate of bb" 4 "ifcvt" } } */

View File

@ -257,7 +257,7 @@ set_bb_predicate_gimplified_stmts (basic_block bb, gimple_seq stmts)
static inline void
add_bb_predicate_gimplified_stmts (basic_block bb, gimple_seq stmts)
{
gimple_seq_add_seq
gimple_seq_add_seq_without_update
(&(((struct bb_predicate *) bb->aux)->predicate_gimplified_stmts), stmts);
}
@ -280,10 +280,11 @@ release_bb_predicate (basic_block bb)
gimple_seq stmts = bb_predicate_gimplified_stmts (bb);
if (stmts)
{
gimple_stmt_iterator i;
if (flag_checking)
for (gimple_stmt_iterator i = gsi_start (stmts);
!gsi_end_p (i); gsi_next (&i))
gcc_assert (! gimple_use_ops (gsi_stmt (i)));
for (i = gsi_start (stmts); !gsi_end_p (i); gsi_next (&i))
free_stmt_operands (cfun, gsi_stmt (i));
set_bb_predicate_gimplified_stmts (bb, NULL);
}
}
@ -1322,7 +1323,6 @@ if_convertible_loop_p_1 (struct loop *loop, vec<data_reference_p> *refs)
return false;
calculate_dominance_info (CDI_DOMINATORS);
calculate_dominance_info (CDI_POST_DOMINATORS);
/* Allow statements that can be handled during if-conversion. */
ifc_bbs = get_loop_body_in_if_conv_order (loop);
@ -1370,6 +1370,7 @@ if_convertible_loop_p_1 (struct loop *loop, vec<data_reference_p> *refs)
= new hash_map<innermost_loop_behavior_hash, data_reference_p>;
baseref_DR_map = new hash_map<tree_operand_hash, data_reference_p>;
calculate_dominance_info (CDI_POST_DOMINATORS);
predicate_bbs (loop);
for (i = 0; refs->iterate (i, &dr); i++)
@ -1421,9 +1422,6 @@ if_convertible_loop_p_1 (struct loop *loop, vec<data_reference_p> *refs)
return false;
}
for (i = 0; i < loop->num_nodes; i++)
free_bb_predicate (ifc_bbs[i]);
/* Checking PHIs needs to be done after stmts, as the fact whether there
are any masked loads or stores affects the tests. */
for (i = 0; i < loop->num_nodes; i++)
@ -2298,7 +2296,6 @@ combine_blocks (struct loop *loop)
edge e;
edge_iterator ei;
predicate_bbs (loop);
remove_conditions_and_labels (loop);
insert_gimplified_predicates (loop);
predicate_all_scalar_phis (loop);
@ -2428,13 +2425,23 @@ version_loop_for_if_conversion (struct loop *loop)
integer_zero_node);
gimple_call_set_lhs (g, cond);
/* Save BB->aux around loop_version as that uses the same field. */
void **saved_preds = XALLOCAVEC (void *, loop->num_nodes);
for (unsigned i = 0; i < loop->num_nodes; i++)
saved_preds[i] = ifc_bbs[i]->aux;
initialize_original_copy_tables ();
new_loop = loop_version (loop, cond, &cond_bb,
REG_BR_PROB_BASE, REG_BR_PROB_BASE,
REG_BR_PROB_BASE, true);
free_original_copy_tables ();
for (unsigned i = 0; i < loop->num_nodes; i++)
ifc_bbs[i]->aux = saved_preds[i];
if (new_loop == NULL)
return false;
new_loop->dont_vectorize = true;
new_loop->force_vectorize = false;
gsi = gsi_last_bb (cond_bb);