summaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-24 07:56:56 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-24 07:56:56 +0000
commitc4d867e016d15d83fd56246c31074f7694cbf9e8 (patch)
treebc85c149f3a2ee968ec2f35b28ea170572c7b44d /gcc/tree-cfg.c
parent4e3592306d71b0147b62484ac5fa202aede63fb8 (diff)
downloadgcc-c4d867e016d15d83fd56246c31074f7694cbf9e8.tar.gz
* bb-reorder.c (copy_bb, duplicate_computed_gotos): Add argument
to duplicate_block. * cfghooks.c (duplicate_block): Added position where to place new block as argument. * cfghooks.h (duplicate_block): Declaration changed. * cfglayout.c (copy_bbs): Add argument after. Pass it to duplicate_block. * cfglayout.h (copy_bbs): Declaration changed. * cfgloop.h (loop_version): Declaration changed. * cfgloopmanip.c (duplicate_loop_to_header_edge): Pass position to copy_bbs. (loop_version): Pass position to duplicate_loop_to_header_edge. Add place_after argument and position new blocks according to it. * modulo-sched.c (sms_schedule): Pass place_after argument to loop_version. * tracer.c (tail_duplicate): Pass argument to duplicate_block. * tree-cfg.c (split_edge_bb_loc): New function. (tree_split_edge, tree_duplicate_sese_region): Use split_edge_bb_loc to determine position of new blocks. * tree-ssa-loop-unswitch.c (tree_unswitch_loop): Pass argument to loop_version. * tree-ssa-threadupdate.c (create_block_for_threading): Pass argument to duplicate_block. * tree-vectorizer.c (slpeel_tree_duplicate_loop_to_edge_cfg): Pass position to copy_bbs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103437 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index ad399fbce64..7a0bf1b9102 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3037,6 +3037,22 @@ reinstall_phi_args (edge new_edge, edge old_edge)
PENDING_STMT (old_edge) = NULL;
}
+/* Returns the basic block after that the new basic block created
+ by splitting edge EDGE_IN should be placed. Tries to keep the new block
+ near its "logical" location. This is of most help to humans looking
+ at debugging dumps. */
+
+static basic_block
+split_edge_bb_loc (edge edge_in)
+{
+ basic_block dest = edge_in->dest;
+
+ if (dest->prev_bb && find_edge (dest->prev_bb, dest))
+ return edge_in->src;
+ else
+ return dest->prev_bb;
+}
+
/* Split a (typically critical) edge EDGE_IN. Return the new block.
Abort on abnormal edges. */
@@ -3052,13 +3068,7 @@ tree_split_edge (edge edge_in)
src = edge_in->src;
dest = edge_in->dest;
- /* Place the new block in the block list. Try to keep the new block
- near its "logical" location. This is of most help to humans looking
- at debugging dumps. */
- if (dest->prev_bb && find_edge (dest->prev_bb, dest))
- after_bb = edge_in->src;
- else
- after_bb = dest->prev_bb;
+ after_bb = split_edge_bb_loc (edge_in);
new_bb = create_empty_bb (after_bb);
new_bb->frequency = EDGE_FREQUENCY (edge_in);
@@ -4346,7 +4356,8 @@ tree_duplicate_sese_region (edge entry, edge exit,
entry_freq = total_freq;
}
- copy_bbs (region, n_region, region_copy, &exit, 1, &exit_copy, loop);
+ copy_bbs (region, n_region, region_copy, &exit, 1, &exit_copy, loop,
+ split_edge_bb_loc (entry));
if (total_count)
{
scale_bbs_frequencies_gcov_type (region, n_region,