Commit fec3cad3 by Kai Tietz Committed by Kai Tietz

tree-ssa-propagate.c (substitute_and_fold): Use do_dce flag to deside...

2011-07-21  Kai Tietz  <ktietz@redhat.com>

	* tree-ssa-propagate.c (substitute_and_fold): Use
	do_dce flag to deside, if BB's statements are scanned
	in last to first, or first to last order.

From-SVN: r176556
parent 21f3ae2f
2011-07-21 Kai Tietz <ktietz@redhat.com>
* tree-ssa-propagate.c (substitute_and_fold): Use
do_dce flag to deside, if BB's statements are scanned
in last to first, or first to last order.
2011-07-21 Georg-Johann Lay <avr@gjlay.de> 2011-07-21 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr.c (avr_rtx_costs): Set cost of CONST, LABEL_REF to 0. * config/avr/avr.c (avr_rtx_costs): Set cost of CONST, LABEL_REF to 0.
......
...@@ -966,6 +966,9 @@ replace_phi_args_in (gimple phi, ssa_prop_get_value_fn get_value) ...@@ -966,6 +966,9 @@ replace_phi_args_in (gimple phi, ssa_prop_get_value_fn get_value)
DO_DCE is true if trivially dead stmts can be removed. DO_DCE is true if trivially dead stmts can be removed.
If DO_DCE is true, the statements within a BB are walked from
last to first element. Otherwise we scan from first to last element.
Return TRUE when something changed. */ Return TRUE when something changed. */
bool bool
...@@ -1046,9 +1049,10 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn, ...@@ -1046,9 +1049,10 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn,
for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i)) for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i))
replace_phi_args_in (gsi_stmt (i), get_value_fn); replace_phi_args_in (gsi_stmt (i), get_value_fn);
/* Propagate known values into stmts. Do a backward walk to expose /* Propagate known values into stmts. Do a backward walk if
more trivially deletable stmts. */ do_dce is true. In some case it exposes
for (i = gsi_last_bb (bb); !gsi_end_p (i);) more trivially deletable stmts to walk backward. */
for (i = (do_dce ? gsi_last_bb (bb) : gsi_start_bb (bb)); !gsi_end_p (i);)
{ {
bool did_replace; bool did_replace;
gimple stmt = gsi_stmt (i); gimple stmt = gsi_stmt (i);
...@@ -1057,7 +1061,10 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn, ...@@ -1057,7 +1061,10 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn,
gimple_stmt_iterator oldi; gimple_stmt_iterator oldi;
oldi = i; oldi = i;
gsi_prev (&i); if (do_dce)
gsi_prev (&i);
else
gsi_next (&i);
/* Ignore ASSERT_EXPRs. They are used by VRP to generate /* Ignore ASSERT_EXPRs. They are used by VRP to generate
range information for names and they are discarded range information for names and they are discarded
......
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