tree-cfg.c (tree_block_forwards_to): Remove.

* tree-cfg.c (tree_block_forwards_to): Remove.
	* tree-flow.h: Remove the corresponding prototype.

From-SVN: r88719
This commit is contained in:
Kazu Hirata 2004-10-07 23:31:04 +00:00 committed by Kazu Hirata
parent ebd9dfc96d
commit 52ea044e54
3 changed files with 5 additions and 64 deletions

View file

@ -1,3 +1,8 @@
2004-10-07 Kazu Hirata <kazu@cs.umass.edu>
* tree-cfg.c (tree_block_forwards_to): Remove.
* tree-flow.h: Remove the corresponding prototype.
2004-10-07 Kazu Hirata <kazu@cs.umass.edu>
* tree-flow-inline.h (phi_nodes): Remove an unnecessary check

View file

@ -1843,69 +1843,6 @@ remove_bb (basic_block bb)
remove_phi_nodes_and_edges_for_unreachable_block (bb);
}
/* Examine BB to determine if it is a forwarding block (a block which only
transfers control to a new destination). If BB is a forwarding block,
then return the edge leading to the ultimate destination. */
edge
tree_block_forwards_to (basic_block bb)
{
block_stmt_iterator bsi;
bb_ann_t ann = bb_ann (bb);
tree stmt;
/* If this block is not forwardable, then avoid useless work. */
if (! ann->forwardable)
return NULL;
/* Set this block to not be forwardable. This prevents infinite loops since
any block currently under examination is considered non-forwardable. */
ann->forwardable = 0;
/* No forwarding is possible if this block is a special block (ENTRY/EXIT),
this block has more than one successor, this block's single successor is
reached via an abnormal edge, this block has phi nodes, or this block's
single successor has phi nodes. */
if (bb == EXIT_BLOCK_PTR
|| bb == ENTRY_BLOCK_PTR
|| EDGE_COUNT (bb->succs) != 1
|| EDGE_SUCC (bb, 0)->dest == EXIT_BLOCK_PTR
|| (EDGE_SUCC (bb, 0)->flags & EDGE_ABNORMAL) != 0
|| phi_nodes (bb)
|| phi_nodes (EDGE_SUCC (bb, 0)->dest))
return NULL;
/* Walk past any labels at the start of this block. */
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
{
stmt = bsi_stmt (bsi);
if (TREE_CODE (stmt) != LABEL_EXPR)
break;
}
/* If we reached the end of this block we may be able to optimize this
case. */
if (bsi_end_p (bsi))
{
edge dest;
/* Recursive call to pick up chains of forwarding blocks. */
dest = tree_block_forwards_to (EDGE_SUCC (bb, 0)->dest);
/* If none found, we forward to bb->succs[0] at minimum. */
if (!dest)
dest = EDGE_SUCC (bb, 0);
ann->forwardable = 1;
return dest;
}
/* No forwarding possible. */
return NULL;
}
/* Try to remove superfluous control structures. */
static bool

View file

@ -482,7 +482,6 @@ extern void cfg_remove_useless_stmts (void);
extern edge thread_edge (edge, basic_block);
extern basic_block label_to_block (tree);
extern void tree_optimize_tail_calls (bool, enum tree_dump_index);
extern edge tree_block_forwards_to (basic_block bb);
extern void bsi_insert_on_edge (edge, tree);
extern basic_block bsi_insert_on_edge_immediate (edge, tree);
extern void bsi_commit_edge_inserts (int *);