aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2004-11-02 00:23:04 +0000
committerAndrew Macleod <amacleod@gcc.gnu.org>2004-11-02 00:23:04 +0000
commitedfaf675109ca666d7ddbd901c82c18383385255 (patch)
treeb53d70edc3071cf94765fb9657ab1326ec36c283 /gcc/tree-cfg.c
parent8bf639fa5e1887d9313c9a251cfe550033708bef (diff)
downloadgcc-edfaf675109ca666d7ddbd901c82c18383385255.zip
gcc-edfaf675109ca666d7ddbd901c82c18383385255.tar.gz
gcc-edfaf675109ca666d7ddbd901c82c18383385255.tar.bz2
re PR tree-optimization/16447 (out of ssa generates bloated code)
2004-11-01 Andrew MacLeod <amacleod@redhat.com> PR tree-optimization/16447 * tree-cfg.c (bsi_commit_one_edge_insert): Rename from bsi_commit_edge_inserts_1, and make funtion external. Return new block. (bsi_commit_edge_inserts): Use renamed bsi_commit_one_edge_insert. * tree-optimize.c (pass_cleanup_cfg_post_optimizing): Enable listing. * tree-flow.h (bsi_commit_one_edge_insert): Extern decl. * tree-outof-ssa.c (rewrite_trees): Don't commit edges here. (same_stmt_list_p): New. Return TRUE if edge is to be forwarded. (identical_copies_p): New. Return true is two copies are the same. (identical_stmt_lists_p): New. Return true if stmt lists are the same. (analyze_edges_for_bb): New. Determine how best to insert edge stmts for a basic block. (perform_edge_inserts): New. Determine what to do with all stmts that have been inserted on edges. (remove_ssa_form): Analyze and commit edges from here. From-SVN: r89970
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 1861c4f..c886f6a 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -93,7 +93,6 @@ static int tree_verify_flow_info (void);
static void tree_make_forwarder_block (edge);
static bool thread_jumps (void);
static bool tree_forwarder_block_p (basic_block);
-static void bsi_commit_edge_inserts_1 (edge e);
static void tree_cfg2vcg (FILE *);
/* Flowgraph optimization and cleanup. */
@@ -2871,22 +2870,25 @@ bsi_commit_edge_inserts (int *new_blocks)
blocks = n_basic_blocks;
- bsi_commit_edge_inserts_1 (EDGE_SUCC (ENTRY_BLOCK_PTR, 0));
+ bsi_commit_one_edge_insert (EDGE_SUCC (ENTRY_BLOCK_PTR, 0), NULL);
FOR_EACH_BB (bb)
FOR_EACH_EDGE (e, ei, bb->succs)
- bsi_commit_edge_inserts_1 (e);
+ bsi_commit_one_edge_insert (e, NULL);
if (new_blocks)
*new_blocks = n_basic_blocks - blocks;
}
-/* Commit insertions pending at edge E. */
+/* Commit insertions pending at edge E. If a new block is created, set NEW_BB
+ to this block, otherwise set it to NULL. */
-static void
-bsi_commit_edge_inserts_1 (edge e)
+void
+bsi_commit_one_edge_insert (edge e, basic_block *new_bb)
{
+ if (new_bb)
+ *new_bb = NULL;
if (PENDING_STMT (e))
{
block_stmt_iterator bsi;
@@ -2894,7 +2896,7 @@ bsi_commit_edge_inserts_1 (edge e)
PENDING_STMT (e) = NULL_TREE;
- if (tree_find_edge_insert_loc (e, &bsi, NULL))
+ if (tree_find_edge_insert_loc (e, &bsi, new_bb))
bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
else
bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);