mirror of git://gcc.gnu.org/git/gcc.git
tree-ssa-pre.c (add_to_exp_gen): Adjust.
2012-09-04 Richard Guenther <rguenther@suse.de> * tree-ssa-pre.c (add_to_exp_gen): Adjust. (make_values_for_phi): Do not add to PHI_GEN for FRE. (compute_avail): Stop processing after adding all defs to AVAIL_OUT for FRE. (init_pre): Do not allocate not needed bitmap sets for FRE. From-SVN: r190930
This commit is contained in:
parent
e8f6d0461b
commit
3c1d57d074
|
|
@ -1,3 +1,11 @@
|
||||||
|
2012-09-04 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
* tree-ssa-pre.c (add_to_exp_gen): Adjust.
|
||||||
|
(make_values_for_phi): Do not add to PHI_GEN for FRE.
|
||||||
|
(compute_avail): Stop processing after adding all defs to
|
||||||
|
AVAIL_OUT for FRE.
|
||||||
|
(init_pre): Do not allocate not needed bitmap sets for FRE.
|
||||||
|
|
||||||
2012-09-04 Diego Novillo <dnovillo@google.com>
|
2012-09-04 Diego Novillo <dnovillo@google.com>
|
||||||
|
|
||||||
Rewrite VEC_* functions as member functions of vec_t.
|
Rewrite VEC_* functions as member functions of vec_t.
|
||||||
|
|
|
||||||
|
|
@ -3786,14 +3786,15 @@ insert (void)
|
||||||
static void
|
static void
|
||||||
add_to_exp_gen (basic_block block, tree op)
|
add_to_exp_gen (basic_block block, tree op)
|
||||||
{
|
{
|
||||||
if (!in_fre)
|
pre_expr result;
|
||||||
{
|
|
||||||
pre_expr result;
|
gcc_checking_assert (!in_fre);
|
||||||
if (TREE_CODE (op) == SSA_NAME && ssa_undefined_value_p (op))
|
|
||||||
return;
|
if (TREE_CODE (op) == SSA_NAME && ssa_undefined_value_p (op))
|
||||||
result = get_or_alloc_expr_for_name (op);
|
return;
|
||||||
bitmap_value_insert_into_set (EXP_GEN (block), result);
|
|
||||||
}
|
result = get_or_alloc_expr_for_name (op);
|
||||||
|
bitmap_value_insert_into_set (EXP_GEN (block), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create value ids for PHI in BLOCK. */
|
/* Create value ids for PHI in BLOCK. */
|
||||||
|
|
@ -3805,23 +3806,23 @@ make_values_for_phi (gimple phi, basic_block block)
|
||||||
|
|
||||||
/* We have no need for virtual phis, as they don't represent
|
/* We have no need for virtual phis, as they don't represent
|
||||||
actual computations. */
|
actual computations. */
|
||||||
if (!virtual_operand_p (result))
|
if (virtual_operand_p (result))
|
||||||
|
return;
|
||||||
|
|
||||||
|
pre_expr e = get_or_alloc_expr_for_name (result);
|
||||||
|
add_to_value (get_expr_value_id (e), e);
|
||||||
|
bitmap_value_insert_into_set (AVAIL_OUT (block), e);
|
||||||
|
if (!in_fre)
|
||||||
{
|
{
|
||||||
pre_expr e = get_or_alloc_expr_for_name (result);
|
unsigned i;
|
||||||
add_to_value (get_expr_value_id (e), e);
|
|
||||||
bitmap_insert_into_set (PHI_GEN (block), e);
|
bitmap_insert_into_set (PHI_GEN (block), e);
|
||||||
bitmap_value_insert_into_set (AVAIL_OUT (block), e);
|
for (i = 0; i < gimple_phi_num_args (phi); ++i)
|
||||||
if (!in_fre)
|
|
||||||
{
|
{
|
||||||
unsigned i;
|
tree arg = gimple_phi_arg_def (phi, i);
|
||||||
for (i = 0; i < gimple_phi_num_args (phi); ++i)
|
if (TREE_CODE (arg) == SSA_NAME)
|
||||||
{
|
{
|
||||||
tree arg = gimple_phi_arg_def (phi, i);
|
e = get_or_alloc_expr_for_name (arg);
|
||||||
if (TREE_CODE (arg) == SSA_NAME)
|
add_to_value (get_expr_value_id (e), e);
|
||||||
{
|
|
||||||
e = get_or_alloc_expr_for_name (arg);
|
|
||||||
add_to_value (get_expr_value_id (e), e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3934,6 +3935,10 @@ compute_avail (void)
|
||||||
bitmap_value_insert_into_set (AVAIL_OUT (block), e);
|
bitmap_value_insert_into_set (AVAIL_OUT (block), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* That's all we need to do when doing FRE. */
|
||||||
|
if (in_fre)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (gimple_has_side_effects (stmt) || stmt_could_throw_p (stmt))
|
if (gimple_has_side_effects (stmt) || stmt_could_throw_p (stmt))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -3992,8 +3997,7 @@ compute_avail (void)
|
||||||
|
|
||||||
get_or_alloc_expression_id (result);
|
get_or_alloc_expression_id (result);
|
||||||
add_to_value (get_expr_value_id (result), result);
|
add_to_value (get_expr_value_id (result), result);
|
||||||
if (!in_fre)
|
bitmap_value_insert_into_set (EXP_GEN (block), result);
|
||||||
bitmap_value_insert_into_set (EXP_GEN (block), result);
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -4105,8 +4109,7 @@ compute_avail (void)
|
||||||
|
|
||||||
get_or_alloc_expression_id (result);
|
get_or_alloc_expression_id (result);
|
||||||
add_to_value (get_expr_value_id (result), result);
|
add_to_value (get_expr_value_id (result), result);
|
||||||
if (!in_fre)
|
bitmap_value_insert_into_set (EXP_GEN (block), result);
|
||||||
bitmap_value_insert_into_set (EXP_GEN (block), result);
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -4733,15 +4736,15 @@ my_rev_post_order_compute (int *post_order, bool include_entry_exit)
|
||||||
src = ei_edge (ei)->src;
|
src = ei_edge (ei)->src;
|
||||||
dest = ei_edge (ei)->dest;
|
dest = ei_edge (ei)->dest;
|
||||||
|
|
||||||
/* Check if the edge destination has been visited yet. */
|
/* Check if the edge source has been visited yet. */
|
||||||
if (src != ENTRY_BLOCK_PTR && ! TEST_BIT (visited, src->index))
|
if (src != ENTRY_BLOCK_PTR && ! TEST_BIT (visited, src->index))
|
||||||
{
|
{
|
||||||
/* Mark that we have visited the destination. */
|
/* Mark that we have visited the destination. */
|
||||||
SET_BIT (visited, src->index);
|
SET_BIT (visited, src->index);
|
||||||
|
|
||||||
if (EDGE_COUNT (src->preds) > 0)
|
if (EDGE_COUNT (src->preds) > 0)
|
||||||
/* Since the DEST node has been visited for the first
|
/* Since the SRC node has been visited for the first
|
||||||
time, check its successors. */
|
time, check its predecessors. */
|
||||||
stack[sp++] = ei_start (src->preds);
|
stack[sp++] = ei_start (src->preds);
|
||||||
else
|
else
|
||||||
post_order[post_order_num++] = src->index;
|
post_order[post_order_num++] = src->index;
|
||||||
|
|
@ -4807,9 +4810,12 @@ init_pre (bool do_fre)
|
||||||
sizeof (struct pre_expr_d), 30);
|
sizeof (struct pre_expr_d), 30);
|
||||||
FOR_ALL_BB (bb)
|
FOR_ALL_BB (bb)
|
||||||
{
|
{
|
||||||
EXP_GEN (bb) = bitmap_set_new ();
|
if (!do_fre)
|
||||||
PHI_GEN (bb) = bitmap_set_new ();
|
{
|
||||||
TMP_GEN (bb) = bitmap_set_new ();
|
EXP_GEN (bb) = bitmap_set_new ();
|
||||||
|
PHI_GEN (bb) = bitmap_set_new ();
|
||||||
|
TMP_GEN (bb) = bitmap_set_new ();
|
||||||
|
}
|
||||||
AVAIL_OUT (bb) = bitmap_set_new ();
|
AVAIL_OUT (bb) = bitmap_set_new ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue