jump.c (redirect_jump): Add delete_unused argument.
* jump.c (redirect_jump): Add delete_unused argument. Don't remove labels and code following when LABEL_NUSES goes to zero. (invert_jump): Likewise. (jump_optimize_1): Fix redirect/invert arguments. (do_cross_jump, thread_jumps): Likewise. * flow.c (split_edge): Likewise. * reorg.c (optimize_skip): Likewise. (reorg_redirect_jump, relax_delay_slots, dbr_schedule): Likewise. * profile.c (instrument_arcs): Likewise. * loop.c (find_and_verify_loops): Likewise. Fix indentation. * rtl.h: Update prototypes. From-SVN: r34033
This commit is contained in:
parent
63864c8290
commit
9ba11d5ad2
|
@ -1,3 +1,17 @@
|
||||||
|
2000-05-19 Richard Henderson <rth@cygnus.com>
|
||||||
|
|
||||||
|
* jump.c (redirect_jump): Add delete_unused argument. Don't
|
||||||
|
remove labels and code following when LABEL_NUSES goes to zero.
|
||||||
|
(invert_jump): Likewise.
|
||||||
|
(jump_optimize_1): Fix redirect/invert arguments.
|
||||||
|
(do_cross_jump, thread_jumps): Likewise.
|
||||||
|
* flow.c (split_edge): Likewise.
|
||||||
|
* reorg.c (optimize_skip): Likewise.
|
||||||
|
(reorg_redirect_jump, relax_delay_slots, dbr_schedule): Likewise.
|
||||||
|
* profile.c (instrument_arcs): Likewise.
|
||||||
|
* loop.c (find_and_verify_loops): Likewise. Fix indentation.
|
||||||
|
* rtl.h: Update prototypes.
|
||||||
|
|
||||||
Fri May 19 12:05:13 2000 Clinton Popetz <cpopetz@cygnus.com>
|
Fri May 19 12:05:13 2000 Clinton Popetz <cpopetz@cygnus.com>
|
||||||
|
|
||||||
* ssa.c (convert_from_ssa): Tell life_analysis we need death
|
* ssa.c (convert_from_ssa): Tell life_analysis we need death
|
||||||
|
|
|
@ -1556,7 +1556,7 @@ split_edge (edge_in)
|
||||||
if (JUMP_LABEL (insn) != old_label)
|
if (JUMP_LABEL (insn) != old_label)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
redirect_jump (insn, new_label);
|
redirect_jump (insn, new_label, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
emit_label_before (new_label, bb_note);
|
emit_label_before (new_label, bb_note);
|
||||||
|
|
22
gcc/jump.c
22
gcc/jump.c
|
@ -342,7 +342,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
|
||||||
/* See if this jump goes to another jump and redirect if so. */
|
/* See if this jump goes to another jump and redirect if so. */
|
||||||
nlabel = follow_jumps (JUMP_LABEL (insn));
|
nlabel = follow_jumps (JUMP_LABEL (insn));
|
||||||
if (nlabel != JUMP_LABEL (insn))
|
if (nlabel != JUMP_LABEL (insn))
|
||||||
changed |= redirect_jump (insn, nlabel);
|
changed |= redirect_jump (insn, nlabel, 1);
|
||||||
|
|
||||||
if (! optimize || minimal)
|
if (! optimize || minimal)
|
||||||
continue;
|
continue;
|
||||||
|
@ -444,7 +444,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
|
||||||
if (prev_label)
|
if (prev_label)
|
||||||
++LABEL_NUSES (prev_label);
|
++LABEL_NUSES (prev_label);
|
||||||
|
|
||||||
if (invert_jump (insn, JUMP_LABEL (reallabelprev)))
|
if (invert_jump (insn, JUMP_LABEL (reallabelprev), 1))
|
||||||
{
|
{
|
||||||
/* It is very likely that if there are USE insns before
|
/* It is very likely that if there are USE insns before
|
||||||
this jump, they hold REG_DEAD notes. These REG_DEAD
|
this jump, they hold REG_DEAD notes. These REG_DEAD
|
||||||
|
@ -507,7 +507,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_insn (temp);
|
delete_insn (temp);
|
||||||
redirect_jump (insn, get_label_before (temp1));
|
redirect_jump (insn, get_label_before (temp1), 1);
|
||||||
reallabelprev = prev_real_insn (temp1);
|
reallabelprev = prev_real_insn (temp1);
|
||||||
changed = 1;
|
changed = 1;
|
||||||
next = NEXT_INSN (insn);
|
next = NEXT_INSN (insn);
|
||||||
|
@ -579,7 +579,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan,
|
||||||
&& swap_condition (GET_CODE (temp2)) == GET_CODE (tc)
|
&& swap_condition (GET_CODE (temp2)) == GET_CODE (tc)
|
||||||
&& rtx_equal_p (XEXP (tc, 0), XEXP (temp2, 0))
|
&& rtx_equal_p (XEXP (tc, 0), XEXP (temp2, 0))
|
||||||
&& rtx_equal_p (XEXP (tc, 1), XEXP (temp2, 1))
|
&& rtx_equal_p (XEXP (tc, 1), XEXP (temp2, 1))
|
||||||
&& redirect_jump (insn, get_label_after (temp)))
|
&& redirect_jump (insn, get_label_after (temp), 1))
|
||||||
{
|
{
|
||||||
changed = 1;
|
changed = 1;
|
||||||
continue;
|
continue;
|
||||||
|
@ -1629,7 +1629,7 @@ do_cross_jump (insn, newjpos, newlpos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
redirect_jump (insn, label);
|
redirect_jump (insn, label, 1);
|
||||||
|
|
||||||
/* Delete the matching insns before the jump. Also, remove any REG_EQUAL
|
/* Delete the matching insns before the jump. Also, remove any REG_EQUAL
|
||||||
or REG_EQUIV note in the NEWLPOS stream that isn't also present in
|
or REG_EQUIV note in the NEWLPOS stream that isn't also present in
|
||||||
|
@ -3182,8 +3182,9 @@ redirect_jump_1 (jump, nlabel)
|
||||||
(this can only occur for NLABEL == 0). */
|
(this can only occur for NLABEL == 0). */
|
||||||
|
|
||||||
int
|
int
|
||||||
redirect_jump (jump, nlabel)
|
redirect_jump (jump, nlabel, delete_unused)
|
||||||
rtx jump, nlabel;
|
rtx jump, nlabel;
|
||||||
|
int delete_unused;
|
||||||
{
|
{
|
||||||
register rtx olabel = JUMP_LABEL (jump);
|
register rtx olabel = JUMP_LABEL (jump);
|
||||||
|
|
||||||
|
@ -3221,7 +3222,7 @@ redirect_jump (jump, nlabel)
|
||||||
&& NOTE_LINE_NUMBER (NEXT_INSN (olabel)) == NOTE_INSN_FUNCTION_END)
|
&& NOTE_LINE_NUMBER (NEXT_INSN (olabel)) == NOTE_INSN_FUNCTION_END)
|
||||||
emit_note_after (NOTE_INSN_FUNCTION_END, nlabel);
|
emit_note_after (NOTE_INSN_FUNCTION_END, nlabel);
|
||||||
|
|
||||||
if (olabel && --LABEL_NUSES (olabel) == 0)
|
if (olabel && --LABEL_NUSES (olabel) == 0 && delete_unused)
|
||||||
delete_insn (olabel);
|
delete_insn (olabel);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -3321,8 +3322,9 @@ invert_jump_1 (jump, nlabel)
|
||||||
NLABEL instead of where it jumps now. Return true if successful. */
|
NLABEL instead of where it jumps now. Return true if successful. */
|
||||||
|
|
||||||
int
|
int
|
||||||
invert_jump (jump, nlabel)
|
invert_jump (jump, nlabel, delete_unused)
|
||||||
rtx jump, nlabel;
|
rtx jump, nlabel;
|
||||||
|
int delete_unused;
|
||||||
{
|
{
|
||||||
/* We have to either invert the condition and change the label or
|
/* We have to either invert the condition and change the label or
|
||||||
do neither. Either operation could fail. We first try to invert
|
do neither. Either operation could fail. We first try to invert
|
||||||
|
@ -3332,7 +3334,7 @@ invert_jump (jump, nlabel)
|
||||||
if (! invert_exp (PATTERN (jump), jump))
|
if (! invert_exp (PATTERN (jump), jump))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (redirect_jump (jump, nlabel))
|
if (redirect_jump (jump, nlabel, delete_unused))
|
||||||
{
|
{
|
||||||
/* An inverted jump means that a probability taken becomes a
|
/* An inverted jump means that a probability taken becomes a
|
||||||
probability not taken. Subtract the branch probability from the
|
probability not taken. Subtract the branch probability from the
|
||||||
|
@ -3911,7 +3913,7 @@ thread_jumps (f, max_reg, flag_before_loop)
|
||||||
new_label = gen_label_rtx ();
|
new_label = gen_label_rtx ();
|
||||||
emit_label_after (new_label, PREV_INSN (prev));
|
emit_label_after (new_label, PREV_INSN (prev));
|
||||||
}
|
}
|
||||||
changed |= redirect_jump (b1, new_label);
|
changed |= redirect_jump (b1, new_label, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
12
gcc/loop.c
12
gcc/loop.c
|
@ -2865,7 +2865,7 @@ find_and_verify_loops (f, loops)
|
||||||
|
|
||||||
/* Verify that uid_loop is large enough and that
|
/* Verify that uid_loop is large enough and that
|
||||||
we can invert P. */
|
we can invert P. */
|
||||||
if (invert_jump (p, new_label))
|
if (invert_jump (p, new_label, 1))
|
||||||
{
|
{
|
||||||
rtx q, r;
|
rtx q, r;
|
||||||
|
|
||||||
|
@ -2902,11 +2902,11 @@ find_and_verify_loops (f, loops)
|
||||||
q = NEXT_INSN (q))
|
q = NEXT_INSN (q))
|
||||||
uid_loop[INSN_UID (q)] = target_loop;
|
uid_loop[INSN_UID (q)] = target_loop;
|
||||||
|
|
||||||
/* The label jumped to by INSN is no longer a loop exit.
|
/* The label jumped to by INSN is no longer a loop
|
||||||
Unless INSN does not have a label (e.g., it is a
|
exit. Unless INSN does not have a label (e.g.,
|
||||||
RETURN insn), search loop->exit_labels to find
|
it is a RETURN insn), search loop->exit_labels
|
||||||
its label_ref, and remove it. Also turn off
|
to find its label_ref, and remove it. Also turn
|
||||||
LABEL_OUTSIDE_LOOP_P bit. */
|
off LABEL_OUTSIDE_LOOP_P bit. */
|
||||||
if (JUMP_LABEL (insn))
|
if (JUMP_LABEL (insn))
|
||||||
{
|
{
|
||||||
for (q = 0,
|
for (q = 0,
|
||||||
|
|
|
@ -293,14 +293,14 @@ instrument_arcs (f, num_blocks, dump_file)
|
||||||
if (this_is_simplejump)
|
if (this_is_simplejump)
|
||||||
{
|
{
|
||||||
after = NEXT_INSN (arcptr->branch_insn);
|
after = NEXT_INSN (arcptr->branch_insn);
|
||||||
if (! redirect_jump (arcptr->branch_insn, new_label))
|
if (! redirect_jump (arcptr->branch_insn, new_label, 1))
|
||||||
/* Don't know what to do if this branch won't
|
/* Don't know what to do if this branch won't
|
||||||
redirect. */
|
redirect. */
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! invert_jump (arcptr->branch_insn, new_label))
|
if (! invert_jump (arcptr->branch_insn, new_label, 1))
|
||||||
/* Don't know what to do if this branch won't invert. */
|
/* Don't know what to do if this branch won't invert. */
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
|
|
20
gcc/reorg.c
20
gcc/reorg.c
|
@ -733,7 +733,7 @@ optimize_skip (insn)
|
||||||
{
|
{
|
||||||
if (eligible_for_annul_false (insn, 0, trial, flags))
|
if (eligible_for_annul_false (insn, 0, trial, flags))
|
||||||
{
|
{
|
||||||
if (invert_jump (insn, JUMP_LABEL (insn)))
|
if (invert_jump (insn, JUMP_LABEL (insn), 1))
|
||||||
INSN_FROM_TARGET_P (trial) = 1;
|
INSN_FROM_TARGET_P (trial) = 1;
|
||||||
else if (! eligible_for_annul_true (insn, 0, trial, flags))
|
else if (! eligible_for_annul_true (insn, 0, trial, flags))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1888,7 +1888,7 @@ reorg_redirect_jump (jump, nlabel)
|
||||||
rtx nlabel;
|
rtx nlabel;
|
||||||
{
|
{
|
||||||
incr_ticks_for_insn (jump);
|
incr_ticks_for_insn (jump);
|
||||||
return redirect_jump (jump, nlabel);
|
return redirect_jump (jump, nlabel, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called when INSN is being moved forward into a delay slot of DELAYED_INSN.
|
/* Called when INSN is being moved forward into a delay slot of DELAYED_INSN.
|
||||||
|
@ -3087,7 +3087,7 @@ relax_delay_slots (first)
|
||||||
if (label)
|
if (label)
|
||||||
++LABEL_NUSES (label);
|
++LABEL_NUSES (label);
|
||||||
|
|
||||||
if (invert_jump (insn, label))
|
if (invert_jump (insn, label, 1))
|
||||||
{
|
{
|
||||||
delete_insn (next);
|
delete_insn (next);
|
||||||
next = insn;
|
next = insn;
|
||||||
|
@ -3123,16 +3123,8 @@ relax_delay_slots (first)
|
||||||
rtx other_target = JUMP_LABEL (other);
|
rtx other_target = JUMP_LABEL (other);
|
||||||
target_label = JUMP_LABEL (insn);
|
target_label = JUMP_LABEL (insn);
|
||||||
|
|
||||||
/* Increment the count of OTHER_TARGET, so it doesn't get deleted
|
if (invert_jump (other, target_label, 0))
|
||||||
as we move the label. */
|
|
||||||
if (other_target)
|
|
||||||
++LABEL_NUSES (other_target);
|
|
||||||
|
|
||||||
if (invert_jump (other, target_label))
|
|
||||||
reorg_redirect_jump (insn, other_target);
|
reorg_redirect_jump (insn, other_target);
|
||||||
|
|
||||||
if (other_target)
|
|
||||||
--LABEL_NUSES (other_target);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now look only at cases where we have filled a delay slot. */
|
/* Now look only at cases where we have filled a delay slot. */
|
||||||
|
@ -3338,7 +3330,7 @@ relax_delay_slots (first)
|
||||||
if (old_label)
|
if (old_label)
|
||||||
++LABEL_NUSES (old_label);
|
++LABEL_NUSES (old_label);
|
||||||
|
|
||||||
if (invert_jump (delay_insn, label))
|
if (invert_jump (delay_insn, label, 1))
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -3570,7 +3562,7 @@ dbr_schedule (first, file)
|
||||||
&& JUMP_LABEL (insn) != 0
|
&& JUMP_LABEL (insn) != 0
|
||||||
&& ((target = prev_label (next_active_insn (JUMP_LABEL (insn))))
|
&& ((target = prev_label (next_active_insn (JUMP_LABEL (insn))))
|
||||||
!= JUMP_LABEL (insn)))
|
!= JUMP_LABEL (insn)))
|
||||||
redirect_jump (insn, target);
|
redirect_jump (insn, target, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
init_resource_info (epilogue_insn);
|
init_resource_info (epilogue_insn);
|
||||||
|
|
|
@ -1522,11 +1522,11 @@ extern int returnjump_p PARAMS ((rtx));
|
||||||
extern int onlyjump_p PARAMS ((rtx));
|
extern int onlyjump_p PARAMS ((rtx));
|
||||||
extern int sets_cc0_p PARAMS ((rtx));
|
extern int sets_cc0_p PARAMS ((rtx));
|
||||||
extern int invert_jump_1 PARAMS ((rtx, rtx));
|
extern int invert_jump_1 PARAMS ((rtx, rtx));
|
||||||
extern int invert_jump PARAMS ((rtx, rtx));
|
extern int invert_jump PARAMS ((rtx, rtx, int));
|
||||||
extern int rtx_renumbered_equal_p PARAMS ((rtx, rtx));
|
extern int rtx_renumbered_equal_p PARAMS ((rtx, rtx));
|
||||||
extern int true_regnum PARAMS ((rtx));
|
extern int true_regnum PARAMS ((rtx));
|
||||||
extern int redirect_jump_1 PARAMS ((rtx, rtx));
|
extern int redirect_jump_1 PARAMS ((rtx, rtx));
|
||||||
extern int redirect_jump PARAMS ((rtx, rtx));
|
extern int redirect_jump PARAMS ((rtx, rtx, int));
|
||||||
extern void jump_optimize PARAMS ((rtx, int, int, int));
|
extern void jump_optimize PARAMS ((rtx, int, int, int));
|
||||||
extern void jump_optimize_minimal PARAMS ((rtx));
|
extern void jump_optimize_minimal PARAMS ((rtx));
|
||||||
extern void rebuild_jump_labels PARAMS ((rtx));
|
extern void rebuild_jump_labels PARAMS ((rtx));
|
||||||
|
|
Loading…
Reference in New Issue