aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfglayout.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2005-08-24 09:56:56 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2005-08-24 07:56:56 +0000
commitb9a6624012d373b43c70193b13fd226f7e5b4c24 (patch)
treebc85c149f3a2ee968ec2f35b28ea170572c7b44d /gcc/cfglayout.c
parent87de2376fdeee0702f6df2ed1ec96681796640a6 (diff)
downloadgcc-b9a6624012d373b43c70193b13fd226f7e5b4c24.zip
gcc-b9a6624012d373b43c70193b13fd226f7e5b4c24.tar.gz
gcc-b9a6624012d373b43c70193b13fd226f7e5b4c24.tar.bz2
bb-reorder.c (copy_bb, [...]): Add argument to duplicate_block.
* 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. From-SVN: r103437
Diffstat (limited to 'gcc/cfglayout.c')
-rw-r--r--gcc/cfglayout.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index c63c6f7..9cc2f8f 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -1243,12 +1243,15 @@ end:
is copied, we do not set the new blocks as header or latch.
Created copies of N_EDGES edges in array EDGES are stored in array NEW_EDGES,
- also in the same order. */
+ also in the same order.
+
+ Newly created basic blocks are put after the basic block AFTER in the
+ instruction stream, and the order of the blocks in BBS array is preserved. */
void
copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs,
edge *edges, unsigned num_edges, edge *new_edges,
- struct loop *base)
+ struct loop *base, basic_block after)
{
unsigned i, j;
basic_block bb, new_bb, dom_bb;
@@ -1259,7 +1262,8 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs,
{
/* Duplicate. */
bb = bbs[i];
- new_bb = new_bbs[i] = duplicate_block (bb, NULL);
+ new_bb = new_bbs[i] = duplicate_block (bb, NULL, after);
+ after = new_bb;
bb->flags |= BB_DUPLICATED;
/* Add to loop. */
add_bb_to_loop (new_bb, bb->loop_father->copy);