diff options
author | Michael Hayes <mhayes@redhat.com> | 2001-01-25 09:28:55 +0000 |
---|---|---|
committer | Michael Hayes <m.hayes@gcc.gnu.org> | 2001-01-25 09:28:55 +0000 |
commit | 86e212125feadb56d55459f167c9de10e8bf998c (patch) | |
tree | ebd458480ad696ce4a1b2b5597c6de5617decfb4 | |
parent | 9dee3e02ce0937566ea043f335975b2afc84ccf5 (diff) | |
download | gcc-86e212125feadb56d55459f167c9de10e8bf998c.zip gcc-86e212125feadb56d55459f167c9de10e8bf998c.tar.gz gcc-86e212125feadb56d55459f167c9de10e8bf998c.tar.bz2 |
loop.c (loop_call_insn_emit_before, [...]): New.
* loop.c (loop_call_insn_emit_before, loop_call_insn_hoist): New.
(loop_insn_emit_before): No longer static.
(move_movables): Replace emit_insn_after with loop_insn_emit_after.
(loop_givs_rescan, load_mems): Likewise.
(check_dbra_loop): Replace emit_insn_before with loop_insn_emit_before.
(maybe_eliminate_biv_1):
(move_movables): Replace emit_call_insn_before with
loop_call_insn_hoist.
* loop.h (loop_insn_emit_before): Add.
* unroll.c (copy_loop_body): Replace emit_insn_before with
loop_insn_emit_before.
From-SVN: r39260
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/loop.c | 55 | ||||
-rw-r--r-- | gcc/loop.h | 2 | ||||
-rw-r--r-- | gcc/unroll.c | 2 |
4 files changed, 58 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d3c77b4..491a93e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2001-01-25 Michael Hayes <mhayes@redhat.com> + + * loop.c (loop_call_insn_emit_before, loop_call_insn_hoist): New. + (loop_insn_emit_before): No longer static. + (move_movables): Replace emit_insn_after with loop_insn_emit_after. + (loop_givs_rescan, load_mems): Likewise. + (check_dbra_loop): Replace emit_insn_before with loop_insn_emit_before. + (maybe_eliminate_biv_1): + (move_movables): Replace emit_call_insn_before with + loop_call_insn_hoist. + * loop.h (loop_insn_emit_before): Add. + * unroll.c (copy_loop_body): Replace emit_insn_before with + loop_insn_emit_before. + 2001-01-25 Neil Booth <neil@daikokuya.demon.co.uk> * diagnostic.c (fatal): Request preprocessed source. @@ -253,8 +253,9 @@ static int iv_add_mult_cost PARAMS ((rtx, rtx, rtx, rtx)); static rtx loop_insn_emit_after PARAMS((const struct loop *, basic_block, rtx, rtx)); -static rtx loop_insn_emit_before PARAMS((const struct loop *, basic_block, - rtx, rtx)); +static rtx loop_call_insn_emit_before PARAMS((const struct loop *, + basic_block, rtx, rtx)); +static rtx loop_call_insn_hoist PARAMS((const struct loop *, rtx)); static rtx loop_insn_sink_or_swim PARAMS((const struct loop *, rtx)); static void loop_dump_aux PARAMS ((const struct loop *, FILE *, int)); @@ -1885,13 +1886,13 @@ move_movables (loop, movables, threshold, insn_count) if (GET_CODE (temp) == CALL_INSN && fn_address != 0 && reg_referenced_p (fn_reg, body)) - emit_insn_after (gen_move_insn (fn_reg, - fn_address), - fn_address_insn); + loop_insn_emit_after (loop, 0, fn_address_insn, + gen_move_insn + (fn_reg, fn_address)); if (GET_CODE (temp) == CALL_INSN) { - i1 = emit_call_insn_before (body, loop_start); + i1 = loop_call_insn_hoist (loop, body); /* Because the USAGE information potentially contains objects other than hard registers we need to copy it. */ @@ -1937,7 +1938,7 @@ move_movables (loop, movables, threshold, insn_count) } else if (GET_CODE (p) == CALL_INSN) { - i1 = emit_call_insn_before (PATTERN (p), loop_start); + i1 = loop_call_insn_hoist (loop, PATTERN (p)); /* Because the USAGE information potentially contains objects other than hard registers we need to copy it. */ @@ -4052,8 +4053,8 @@ loop_givs_rescan (loop, bl, reg_map) { /* Not replaceable; emit an insn to set the original giv reg from the reduced giv, same as above. */ - emit_insn_after (gen_move_insn (v->dest_reg, v->new_reg), - v->insn); + loop_insn_emit_after (loop, 0, v->insn, + gen_move_insn (v->dest_reg, v->new_reg)); } /* When a loop is reversed, givs which depend on the reversed @@ -7563,7 +7564,7 @@ check_dbra_loop (loop, insn_count) tem = gen_sequence (); end_sequence (); - p = emit_insn_before (tem, bl->biv->insn); + p = loop_insn_emit_before (loop, 0, bl->biv->insn, tem); delete_insn (bl->biv->insn); /* Update biv info to reflect its new status. */ @@ -7941,8 +7942,9 @@ maybe_eliminate_biv_1 (loop, x, insn, bl, eliminate_p, where_bb, where_insn) into a register (it will be a loop invariant.) */ tem = gen_reg_rtx (GET_MODE (v->new_reg)); - emit_insn_before (gen_move_insn (tem, copy_rtx (v->add_val)), - where_insn); + loop_insn_emit_before (loop, 0, where_insn, + gen_move_insn (tem, + copy_rtx (v->add_val))); /* Substitute the new register for its invariant value in the compare expression. */ @@ -9075,7 +9077,7 @@ load_mems (loop) /* Store the memory immediately after END, which is the NOTE_LOOP_END. */ set = gen_move_insn (copy_rtx (mem), reg); - emit_insn_after (set, label); + loop_insn_emit_after (loop, 0, label, set); } if (loop_dump_stream) @@ -9459,7 +9461,7 @@ loop_insn_emit_after (loop, where_bb, where_insn, pattern) in basic block WHERE_BB (ignored in the interim) within the loop otherwise hoist PATTERN into the loop pre-header. */ -static rtx +rtx loop_insn_emit_before (loop, where_bb, where_insn, pattern) const struct loop *loop; basic_block where_bb ATTRIBUTE_UNUSED; @@ -9472,6 +9474,20 @@ loop_insn_emit_before (loop, where_bb, where_insn, pattern) } +/* Emit call insn for PATTERN before WHERE_INSN in basic block + WHERE_BB (ignored in the interim) within the loop. */ + +static rtx +loop_call_insn_emit_before (loop, where_bb, where_insn, pattern) + const struct loop *loop ATTRIBUTE_UNUSED; + basic_block where_bb ATTRIBUTE_UNUSED; + rtx where_insn; + rtx pattern; +{ + return emit_call_insn_before (pattern, where_insn); +} + + /* Hoist insn for PATTERN into the loop pre-header. */ rtx @@ -9483,6 +9499,17 @@ loop_insn_hoist (loop, pattern) } +/* Hoist call insn for PATTERN into the loop pre-header. */ + +static rtx +loop_call_insn_hoist (loop, pattern) + const struct loop *loop; + rtx pattern; +{ + return loop_call_insn_emit_before (loop, 0, loop->start, pattern); +} + + /* Sink insn for PATTERN after the loop end. */ rtx @@ -412,6 +412,8 @@ int back_branch_in_range_p PARAMS ((const struct loop *, rtx)); int loop_insn_first_p PARAMS ((rtx, rtx)); typedef rtx (*loop_insn_callback) PARAMS ((struct loop *, rtx, int, int)); void for_each_insn_in_loop PARAMS ((struct loop *, loop_insn_callback)); +rtx loop_insn_emit_before PARAMS((const struct loop *, basic_block, + rtx, rtx)); rtx loop_insn_sink PARAMS((const struct loop *, rtx)); rtx loop_insn_hoist PARAMS((const struct loop *, rtx)); diff --git a/gcc/unroll.c b/gcc/unroll.c index ec0a151..0d39276 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -2257,7 +2257,7 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration, tem = gen_sequence (); end_sequence (); - emit_insn_before (tem, insert_before); + loop_insn_emit_before (loop, 0, insert_before, tem); } /* Emit an insn, using the expand_binop to ensure that a valid insn is |