Commit ab51c2f0 by Kazu Hirata Committed by Kazu Hirata

tree-cfg.c (cleanup_tree_cfg): Don't iterate on thread_jumps.

	* tree-cfg.c (cleanup_tree_cfg): Don't iterate on
	thread_jumps.
	(thread_jumps): Iterate until no new forwarder block arises.

From-SVN: r89244
parent 78b6731d
2004-10-18 Kazu Hirata <kazu@cs.umass.edu> 2004-10-18 Kazu Hirata <kazu@cs.umass.edu>
* tree-cfg.c (cleanup_tree_cfg): Don't iterate on
thread_jumps.
(thread_jumps): Iterate until no new forwarder block arises.
2004-10-18 Kazu Hirata <kazu@cs.umass.edu>
* tree-cfg.c (tree_forwarder_block_p): Don't set forwardable. * tree-cfg.c (tree_forwarder_block_p): Don't set forwardable.
(thread_jumps): Use forwardable as cache of (thread_jumps): Use forwardable as cache of
tree_forwarder_block_p throughout the function. tree_forwarder_block_p throughout the function.
......
...@@ -718,18 +718,14 @@ cleanup_tree_cfg (void) ...@@ -718,18 +718,14 @@ cleanup_tree_cfg (void)
retval = cleanup_control_flow (); retval = cleanup_control_flow ();
retval |= delete_unreachable_blocks (); retval |= delete_unreachable_blocks ();
retval |= thread_jumps ();
/* thread_jumps sometimes leaves further transformation
opportunities for itself, so iterate on it until nothing
changes. */
while (thread_jumps ())
retval = true;
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
if (retval) if (retval)
{ {
gcc_assert (!cleanup_control_flow ()); gcc_assert (!cleanup_control_flow ());
gcc_assert (!delete_unreachable_blocks ()); gcc_assert (!delete_unreachable_blocks ());
gcc_assert (!thread_jumps ());
} }
#endif #endif
...@@ -3780,10 +3776,13 @@ thread_jumps (void) ...@@ -3780,10 +3776,13 @@ thread_jumps (void)
tree phi; tree phi;
int arg; int arg;
bool retval = false; bool retval = false;
bool rerun;
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
bb_ann (bb)->forwardable = tree_forwarder_block_p (bb); bb_ann (bb)->forwardable = tree_forwarder_block_p (bb);
restart:
rerun = false;
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
{ {
edge_iterator ei; edge_iterator ei;
...@@ -3945,8 +3944,10 @@ thread_jumps (void) ...@@ -3945,8 +3944,10 @@ thread_jumps (void)
two arms eventually merge without any intervening two arms eventually merge without any intervening
statements. */ statements. */
if (this_jump_threaded && tree_forwarder_block_p (bb)) if (this_jump_threaded && tree_forwarder_block_p (bb))
bb_ann (bb)->forwardable = true; bb_ann (bb)->forwardable = rerun = true;
} }
if (rerun)
goto restart;
return retval; return retval;
} }
......
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