Commit f27e6bb2 by Kazu Hirata Committed by Kazu Hirata

reorg.c: Fix formatting.

2000-10-18  Kazu Hirata  <kazu@hxi.com>

	* reorg.c: Fix formatting.

From-SVN: r36926
parent b054460b
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
expander that is used when not optimizing. Output a tab after expander that is used when not optimizing. Output a tab after
each assembly insns. each assembly insns.
* reorg.c: Fix formatting.
2000-10-17 Joern Rennecke <amylaar@redhat.co.uk> 2000-10-17 Joern Rennecke <amylaar@redhat.co.uk>
* reload1.c (move2add_note_store): Check for simple * reload1.c (move2add_note_store): Check for simple
......
...@@ -56,7 +56,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -56,7 +56,7 @@ Boston, MA 02111-1307, USA. */
is taken. is taken.
The HP-PA always has a branch delay slot. For unconditional branches The HP-PA always has a branch delay slot. For unconditional branches
its effects can be annulled when the branch is taken. The effects its effects can be annulled when the branch is taken. The effects
of the delay slot in a conditional branch can be nullified for forward of the delay slot in a conditional branch can be nullified for forward
taken branches, or for untaken backward branches. This means taken branches, or for untaken backward branches. This means
we can hoist insns from the fall-through path for forward branches or we can hoist insns from the fall-through path for forward branches or
...@@ -140,7 +140,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -140,7 +140,6 @@ Boston, MA 02111-1307, USA. */
#include "insn-attr.h" #include "insn-attr.h"
#include "resource.h" #include "resource.h"
#ifdef DELAY_SLOTS #ifdef DELAY_SLOTS
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
...@@ -353,7 +352,7 @@ find_end_label () ...@@ -353,7 +352,7 @@ find_end_label ()
|| GET_CODE (PATTERN (insn)) == CLOBBER))) || GET_CODE (PATTERN (insn)) == CLOBBER)))
insn = PREV_INSN (insn); insn = PREV_INSN (insn);
/* When a target threads its epilogue we might already have a /* When a target threads its epilogue we might already have a
suitable return insn. If so put a label before it for the suitable return insn. If so put a label before it for the
end_of_function_label. */ end_of_function_label. */
if (GET_CODE (insn) == BARRIER if (GET_CODE (insn) == BARRIER
...@@ -387,27 +386,27 @@ find_end_label () ...@@ -387,27 +386,27 @@ find_end_label ()
{ {
insn = PREV_INSN (insn); insn = PREV_INSN (insn);
/* Put the label before an USE insns that may proceed the /* Put the label before an USE insns that may proceed the
RETURN insn. */ RETURN insn. */
while (GET_CODE (insn) == USE) while (GET_CODE (insn) == USE)
insn = PREV_INSN (insn); insn = PREV_INSN (insn);
emit_label_after (end_of_function_label, insn); emit_label_after (end_of_function_label, insn);
} }
else else
{ {
/* Otherwise, make a new label and emit a RETURN and BARRIER, /* Otherwise, make a new label and emit a RETURN and BARRIER,
if needed. */ if needed. */
emit_label (end_of_function_label); emit_label (end_of_function_label);
#ifdef HAVE_return #ifdef HAVE_return
if (HAVE_return) if (HAVE_return)
{ {
/* The return we make may have delay slots too. */ /* The return we make may have delay slots too. */
rtx insn = gen_return (); rtx insn = gen_return ();
insn = emit_jump_insn (insn); insn = emit_jump_insn (insn);
emit_barrier (); emit_barrier ();
if (num_delay_slots (insn) > 0) if (num_delay_slots (insn) > 0)
obstack_ptr_grow (&unfilled_slots_obstack, insn); obstack_ptr_grow (&unfilled_slots_obstack, insn);
} }
#endif #endif
} }
...@@ -451,7 +450,7 @@ emit_delay_sequence (insn, list, length) ...@@ -451,7 +450,7 @@ emit_delay_sequence (insn, list, length)
rtx delay_insn = copy_rtx (insn); rtx delay_insn = copy_rtx (insn);
/* If INSN is followed by a BARRIER, delete the BARRIER since it will only /* If INSN is followed by a BARRIER, delete the BARRIER since it will only
confuse further processing. Update LAST in case it was the last insn. confuse further processing. Update LAST in case it was the last insn.
We will put the BARRIER back in later. */ We will put the BARRIER back in later. */
if (NEXT_INSN (insn) && GET_CODE (NEXT_INSN (insn)) == BARRIER) if (NEXT_INSN (insn) && GET_CODE (NEXT_INSN (insn)) == BARRIER)
{ {
...@@ -520,7 +519,7 @@ emit_delay_sequence (insn, list, length) ...@@ -520,7 +519,7 @@ emit_delay_sequence (insn, list, length)
if (NEXT_INSN (seq_insn) && GET_CODE (NEXT_INSN (seq_insn)) == INSN if (NEXT_INSN (seq_insn) && GET_CODE (NEXT_INSN (seq_insn)) == INSN
&& GET_CODE (PATTERN (NEXT_INSN (seq_insn))) == SEQUENCE) && GET_CODE (PATTERN (NEXT_INSN (seq_insn))) == SEQUENCE)
PREV_INSN (XVECEXP (PATTERN (NEXT_INSN (seq_insn)), 0, 0)) = seq_insn; PREV_INSN (XVECEXP (PATTERN (NEXT_INSN (seq_insn)), 0, 0)) = seq_insn;
/* If there used to be a BARRIER, put it back. */ /* If there used to be a BARRIER, put it back. */
if (had_barrier) if (had_barrier)
emit_barrier_after (seq_insn); emit_barrier_after (seq_insn);
...@@ -554,7 +553,7 @@ add_to_delay_list (insn, delay_list) ...@@ -554,7 +553,7 @@ add_to_delay_list (insn, delay_list)
XEXP (delay_list, 1) = add_to_delay_list (insn, XEXP (delay_list, 1)); XEXP (delay_list, 1) = add_to_delay_list (insn, XEXP (delay_list, 1));
return delay_list; return delay_list;
} }
/* Delete INSN from the delay slot of the insn that it is in, which may /* Delete INSN from the delay slot of the insn that it is in, which may
produce an insn with no delay slots. Return the new insn. */ produce an insn with no delay slots. Return the new insn. */
...@@ -792,7 +791,6 @@ optimize_skip (insn) ...@@ -792,7 +791,6 @@ optimize_skip (insn)
} }
#endif #endif
/* Encode and return branch direction and prediction information for /* Encode and return branch direction and prediction information for
INSN assuming it will jump to LABEL. INSN assuming it will jump to LABEL.
...@@ -816,15 +814,15 @@ get_jump_flags (insn, label) ...@@ -816,15 +814,15 @@ get_jump_flags (insn, label)
&& INSN_UID (insn) <= max_uid && INSN_UID (insn) <= max_uid
&& label != 0 && label != 0
&& INSN_UID (label) <= max_uid) && INSN_UID (label) <= max_uid)
flags flags
= (uid_to_ruid[INSN_UID (label)] > uid_to_ruid[INSN_UID (insn)]) = (uid_to_ruid[INSN_UID (label)] > uid_to_ruid[INSN_UID (insn)])
? ATTR_FLAG_forward : ATTR_FLAG_backward; ? ATTR_FLAG_forward : ATTR_FLAG_backward;
/* No valid direction information. */ /* No valid direction information. */
else else
flags = 0; flags = 0;
/* If insn is a conditional branch call mostly_true_jump to get /* If insn is a conditional branch call mostly_true_jump to get
determine the branch prediction. determine the branch prediction.
Non conditional branches are predicted as very likely taken. */ Non conditional branches are predicted as very likely taken. */
if (GET_CODE (insn) == JUMP_INSN if (GET_CODE (insn) == JUMP_INSN
...@@ -835,21 +833,21 @@ get_jump_flags (insn, label) ...@@ -835,21 +833,21 @@ get_jump_flags (insn, label)
prediction = mostly_true_jump (insn, get_branch_condition (insn, label)); prediction = mostly_true_jump (insn, get_branch_condition (insn, label));
switch (prediction) switch (prediction)
{ {
case 2: case 2:
flags |= (ATTR_FLAG_very_likely | ATTR_FLAG_likely); flags |= (ATTR_FLAG_very_likely | ATTR_FLAG_likely);
break; break;
case 1: case 1:
flags |= ATTR_FLAG_likely; flags |= ATTR_FLAG_likely;
break; break;
case 0: case 0:
flags |= ATTR_FLAG_unlikely; flags |= ATTR_FLAG_unlikely;
break; break;
case -1: case -1:
flags |= (ATTR_FLAG_very_unlikely | ATTR_FLAG_unlikely); flags |= (ATTR_FLAG_very_unlikely | ATTR_FLAG_unlikely);
break; break;
default: default:
abort(); abort ();
} }
} }
else else
...@@ -882,7 +880,7 @@ rare_destination (insn) ...@@ -882,7 +880,7 @@ rare_destination (insn)
case CODE_LABEL: case CODE_LABEL:
return 0; return 0;
case BARRIER: case BARRIER:
/* A BARRIER can either be after a JUMP_INSN or a CALL_INSN. We /* A BARRIER can either be after a JUMP_INSN or a CALL_INSN. We
don't scan past JUMP_INSNs, so any barrier we find here must don't scan past JUMP_INSNs, so any barrier we find here must
have been after a CALL_INSN and hence mean the call doesn't have been after a CALL_INSN and hence mean the call doesn't
return. */ return. */
...@@ -932,13 +930,13 @@ mostly_true_jump (jump_insn, condition) ...@@ -932,13 +930,13 @@ mostly_true_jump (jump_insn, condition)
int prob = INTVAL (XEXP (note, 0)); int prob = INTVAL (XEXP (note, 0));
if (prob >= REG_BR_PROB_BASE * 9 / 10) if (prob >= REG_BR_PROB_BASE * 9 / 10)
return 2; return 2;
else if (prob >= REG_BR_PROB_BASE / 2) else if (prob >= REG_BR_PROB_BASE / 2)
return 1; return 1;
else if (prob >= REG_BR_PROB_BASE / 10) else if (prob >= REG_BR_PROB_BASE / 10)
return 0; return 0;
else else
return -1; return -1;
} }
/* ??? Ought to use estimate_probability instead. */ /* ??? Ought to use estimate_probability instead. */
...@@ -956,7 +954,7 @@ mostly_true_jump (jump_insn, condition) ...@@ -956,7 +954,7 @@ mostly_true_jump (jump_insn, condition)
{ {
/* If this is the test of a loop, it is very likely true. We scan /* If this is the test of a loop, it is very likely true. We scan
backwards from the target label. If we find a NOTE_INSN_LOOP_BEG backwards from the target label. If we find a NOTE_INSN_LOOP_BEG
before the next real insn, we assume the branch is to the top of before the next real insn, we assume the branch is to the top of
the loop. */ the loop. */
for (insn = PREV_INSN (target_label); for (insn = PREV_INSN (target_label);
insn && GET_CODE (insn) == NOTE; insn && GET_CODE (insn) == NOTE;
...@@ -992,7 +990,7 @@ mostly_true_jump (jump_insn, condition) ...@@ -992,7 +990,7 @@ mostly_true_jump (jump_insn, condition)
return 2; return 2;
} }
/* If we couldn't figure out what this jump was, assume it won't be /* If we couldn't figure out what this jump was, assume it won't be
taken. This should be rare. */ taken. This should be rare. */
if (condition == 0) if (condition == 0)
return 0; return 0;
...@@ -1012,7 +1010,7 @@ mostly_true_jump (jump_insn, condition) ...@@ -1012,7 +1010,7 @@ mostly_true_jump (jump_insn, condition)
case LE: case LE:
case LT: case LT:
if (XEXP (condition, 1) == const0_rtx) if (XEXP (condition, 1) == const0_rtx)
return 0; return 0;
break; break;
case GE: case GE:
case GT: case GT:
...@@ -1045,7 +1043,7 @@ get_branch_condition (insn, target) ...@@ -1045,7 +1043,7 @@ get_branch_condition (insn, target)
{ {
rtx pat = PATTERN (insn); rtx pat = PATTERN (insn);
rtx src; rtx src;
if (condjump_in_parallel_p (insn)) if (condjump_in_parallel_p (insn))
pat = XVECEXP (pat, 0, 0); pat = XVECEXP (pat, 0, 0);
...@@ -1135,7 +1133,7 @@ redirect_with_delay_slots_safe_p (jump, newlabel, seq) ...@@ -1135,7 +1133,7 @@ redirect_with_delay_slots_safe_p (jump, newlabel, seq)
? eligible_for_annul_true (jump, i - 1, ? eligible_for_annul_true (jump, i - 1,
XVECEXP (pat, 0, i), flags) : XVECEXP (pat, 0, i), flags) :
#endif #endif
eligible_for_delay (jump, i -1, XVECEXP (pat, 0, i), flags))) eligible_for_delay (jump, i - 1, XVECEXP (pat, 0, i), flags)))
break; break;
return (i == XVECLEN (pat, 0)); return (i == XVECLEN (pat, 0));
...@@ -1188,18 +1186,17 @@ check_annul_list_true_false (annul_true_p, delay_list) ...@@ -1188,18 +1186,17 @@ check_annul_list_true_false (annul_true_p, delay_list)
if (delay_list) if (delay_list)
{ {
for (temp = delay_list; temp; temp = XEXP (temp, 1)) for (temp = delay_list; temp; temp = XEXP (temp, 1))
{ {
rtx trial = XEXP (temp, 0); rtx trial = XEXP (temp, 0);
if ((annul_true_p && INSN_FROM_TARGET_P (trial)) if ((annul_true_p && INSN_FROM_TARGET_P (trial))
|| (!annul_true_p && !INSN_FROM_TARGET_P (trial))) || (!annul_true_p && !INSN_FROM_TARGET_P (trial)))
return 0; return 0;
} }
} }
return 1; return 1;
} }
/* INSN branches to an insn whose pattern SEQ is a SEQUENCE. Given that /* INSN branches to an insn whose pattern SEQ is a SEQUENCE. Given that
the condition tested by INSN is CONDITION and the resources shown in the condition tested by INSN is CONDITION and the resources shown in
...@@ -1255,10 +1252,10 @@ steal_delay_list_from_target (insn, condition, seq, delay_list, ...@@ -1255,10 +1252,10 @@ steal_delay_list_from_target (insn, condition, seq, delay_list,
moving the instructions in the delay slots. moving the instructions in the delay slots.
We can not steal the delay list if one of the instructions in the We can not steal the delay list if one of the instructions in the
current delay_list modifies the condition codes and the jump in the current delay_list modifies the condition codes and the jump in the
sequence is a conditional jump. We can not do this because we can sequence is a conditional jump. We can not do this because we can
not change the direction of the jump because the condition codes not change the direction of the jump because the condition codes
will effect the direction of the jump in the sequence. */ will effect the direction of the jump in the sequence. */
CLEAR_RESOURCE (&cc_set); CLEAR_RESOURCE (&cc_set);
for (temp = delay_list; temp; temp = XEXP (temp, 1)) for (temp = delay_list; temp; temp = XEXP (temp, 1))
...@@ -1267,7 +1264,7 @@ steal_delay_list_from_target (insn, condition, seq, delay_list, ...@@ -1267,7 +1264,7 @@ steal_delay_list_from_target (insn, condition, seq, delay_list,
mark_set_resources (trial, &cc_set, 0, MARK_SRC_DEST_CALL); mark_set_resources (trial, &cc_set, 0, MARK_SRC_DEST_CALL);
if (insn_references_resource_p (XVECEXP (seq , 0, 0), &cc_set, 0)) if (insn_references_resource_p (XVECEXP (seq , 0, 0), &cc_set, 0))
return delay_list; return delay_list;
} }
if (XVECLEN (seq, 0) - 1 > slots_remaining if (XVECLEN (seq, 0) - 1 > slots_remaining
...@@ -1347,13 +1344,13 @@ steal_delay_list_from_target (insn, condition, seq, delay_list, ...@@ -1347,13 +1344,13 @@ steal_delay_list_from_target (insn, condition, seq, delay_list,
return delay_list; return delay_list;
} }
/* Similar to steal_delay_list_from_target except that SEQ is on the /* Similar to steal_delay_list_from_target except that SEQ is on the
fallthrough path of INSN. Here we only do something if the delay insn fallthrough path of INSN. Here we only do something if the delay insn
of SEQ is an unconditional branch. In that case we steal its delay slot of SEQ is an unconditional branch. In that case we steal its delay slot
for INSN since unconditional branches are much easier to fill. */ for INSN since unconditional branches are much easier to fill. */
static rtx static rtx
steal_delay_list_from_fallthrough (insn, condition, seq, steal_delay_list_from_fallthrough (insn, condition, seq,
delay_list, sets, needed, other_needed, delay_list, sets, needed, other_needed,
slots_to_fill, pslots_filled, pannul_p) slots_to_fill, pslots_filled, pannul_p)
rtx insn, condition; rtx insn, condition;
...@@ -1426,7 +1423,6 @@ steal_delay_list_from_fallthrough (insn, condition, seq, ...@@ -1426,7 +1423,6 @@ steal_delay_list_from_fallthrough (insn, condition, seq,
*pannul_p = 1; *pannul_p = 1;
return delay_list; return delay_list;
} }
/* Try merging insns starting at THREAD which match exactly the insns in /* Try merging insns starting at THREAD which match exactly the insns in
INSN's delay list. INSN's delay list.
...@@ -1464,9 +1460,9 @@ try_merge_delay_insns (insn, thread) ...@@ -1464,9 +1460,9 @@ try_merge_delay_insns (insn, thread)
will essentially disable this optimization. This method is somewhat of will essentially disable this optimization. This method is somewhat of
a kludge, but I don't see a better way.) */ a kludge, but I don't see a better way.) */
if (! annul_p) if (! annul_p)
for (i = 1 ; i < num_slots ; i++) for (i = 1 ; i < num_slots; i++)
if (XVECEXP (PATTERN (insn), 0, i)) if (XVECEXP (PATTERN (insn), 0, i))
mark_referenced_resources (XVECEXP (PATTERN (insn), 0, i), &needed, 1); mark_referenced_resources (XVECEXP (PATTERN (insn), 0, i), &needed, 1);
for (trial = thread; !stop_search_p (trial, 1); trial = next_trial) for (trial = thread; !stop_search_p (trial, 1); trial = next_trial)
{ {
...@@ -1571,8 +1567,8 @@ try_merge_delay_insns (insn, thread) ...@@ -1571,8 +1567,8 @@ try_merge_delay_insns (insn, thread)
{ {
/* Keep track of the set/referenced resources for the delay /* Keep track of the set/referenced resources for the delay
slots of any trial insns we encounter. */ slots of any trial insns we encounter. */
mark_set_resources (dtrial, &set, 0, MARK_SRC_DEST_CALL); mark_set_resources (dtrial, &set, 0, MARK_SRC_DEST_CALL);
mark_referenced_resources (dtrial, &needed, 1); mark_referenced_resources (dtrial, &needed, 1);
} }
} }
} }
...@@ -1666,17 +1662,17 @@ redundant_insn (insn, target, delay_list) ...@@ -1666,17 +1662,17 @@ redundant_insn (insn, target, delay_list)
return 0; return 0;
/* Stop for an INSN or JUMP_INSN with delayed effects and its delay /* Stop for an INSN or JUMP_INSN with delayed effects and its delay
slots because it is difficult to track its resource needs slots because it is difficult to track its resource needs
correctly. */ correctly. */
#ifdef INSN_SETS_ARE_DELAYED #ifdef INSN_SETS_ARE_DELAYED
if (INSN_SETS_ARE_DELAYED (XVECEXP (pat, 0, 0))) if (INSN_SETS_ARE_DELAYED (XVECEXP (pat, 0, 0)))
return 0; return 0;
#endif #endif
#ifdef INSN_REFERENCES_ARE_DELAYED #ifdef INSN_REFERENCES_ARE_DELAYED
if (INSN_REFERENCES_ARE_DELAYED (XVECEXP (pat, 0, 0))) if (INSN_REFERENCES_ARE_DELAYED (XVECEXP (pat, 0, 0)))
return 0; return 0;
#endif #endif
/* See if any of the insns in the delay slot match, updating /* See if any of the insns in the delay slot match, updating
...@@ -1771,12 +1767,12 @@ redundant_insn (insn, target, delay_list) ...@@ -1771,12 +1767,12 @@ redundant_insn (insn, target, delay_list)
#ifdef INSN_SETS_ARE_DELAYED #ifdef INSN_SETS_ARE_DELAYED
if (INSN_SETS_ARE_DELAYED (XVECEXP (pat, 0, 0))) if (INSN_SETS_ARE_DELAYED (XVECEXP (pat, 0, 0)))
return 0; return 0;
#endif #endif
#ifdef INSN_REFERENCES_ARE_DELAYED #ifdef INSN_REFERENCES_ARE_DELAYED
if (INSN_REFERENCES_ARE_DELAYED (XVECEXP (pat, 0, 0))) if (INSN_REFERENCES_ARE_DELAYED (XVECEXP (pat, 0, 0)))
return 0; return 0;
#endif #endif
/* See if any of the insns in the delay slot match, updating /* See if any of the insns in the delay slot match, updating
...@@ -1804,8 +1800,7 @@ redundant_insn (insn, target, delay_list) ...@@ -1804,8 +1800,7 @@ redundant_insn (insn, target, delay_list)
return 0; return 0;
} }
/* If the insn requiring the delay slot conflicts with INSN, we
/* If the insn requiring the delay slot conflicts with INSN, we
must stop. */ must stop. */
if (insn_sets_resource_p (XVECEXP (pat, 0, 0), &needed, 1)) if (insn_sets_resource_p (XVECEXP (pat, 0, 0), &needed, 1))
return 0; return 0;
...@@ -1886,7 +1881,7 @@ update_block (insn, where) ...@@ -1886,7 +1881,7 @@ update_block (insn, where)
rtx insn; rtx insn;
rtx where; rtx where;
{ {
/* Ignore if this was in a delay slot and it came from the target of /* Ignore if this was in a delay slot and it came from the target of
a branch. */ a branch. */
if (INSN_FROM_TARGET_P (insn)) if (INSN_FROM_TARGET_P (insn))
return; return;
...@@ -2046,7 +2041,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2046,7 +2041,7 @@ fill_simple_delay_slots (non_jumps_p)
|| (GET_CODE (insn) == JUMP_INSN && non_jumps_p) || (GET_CODE (insn) == JUMP_INSN && non_jumps_p)
|| (GET_CODE (insn) != JUMP_INSN && ! non_jumps_p)) || (GET_CODE (insn) != JUMP_INSN && ! non_jumps_p))
continue; continue;
/* It may have been that this insn used to need delay slots, but /* It may have been that this insn used to need delay slots, but
now doesn't; ignore in that case. This can happen, for example, now doesn't; ignore in that case. This can happen, for example,
on the HP PA RISC, where the number of delay slots depends on on the HP PA RISC, where the number of delay slots depends on
...@@ -2082,7 +2077,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2082,7 +2077,7 @@ fill_simple_delay_slots (non_jumps_p)
insn must exist when it is subsequently scanned. insn must exist when it is subsequently scanned.
This is tried on each insn with delay slots as some machines This is tried on each insn with delay slots as some machines
have insns which perform calls, but are not represented as have insns which perform calls, but are not represented as
CALL_INSNs. */ CALL_INSNs. */
slots_filled = 0; slots_filled = 0;
...@@ -2134,7 +2129,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2134,7 +2129,7 @@ fill_simple_delay_slots (non_jumps_p)
forward in execution sequence), it must not need or set any resources forward in execution sequence), it must not need or set any resources
that were set by later insns and must not set any resources that that were set by later insns and must not set any resources that
are needed for those insns. are needed for those insns.
The delay slot insn itself sets resources unless it is a call The delay slot insn itself sets resources unless it is a call
(in which case the called routine, not the insn itself, is doing (in which case the called routine, not the insn itself, is doing
the setting). */ the setting). */
...@@ -2158,7 +2153,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2158,7 +2153,7 @@ fill_simple_delay_slots (non_jumps_p)
if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER) if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER)
continue; continue;
/* Check for resource conflict first, to avoid unnecessary /* Check for resource conflict first, to avoid unnecessary
splitting. */ splitting. */
if (! insn_references_resource_p (trial, &set, 1) if (! insn_references_resource_p (trial, &set, 1)
&& ! insn_sets_resource_p (trial, &set, 1) && ! insn_sets_resource_p (trial, &set, 1)
...@@ -2200,7 +2195,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2200,7 +2195,7 @@ fill_simple_delay_slots (non_jumps_p)
#if defined(ANNUL_IFFALSE_SLOTS) || defined(ANNUL_IFTRUE_SLOTS) #if defined(ANNUL_IFFALSE_SLOTS) || defined(ANNUL_IFTRUE_SLOTS)
if (slots_filled != slots_to_fill if (slots_filled != slots_to_fill
&& delay_list == 0 && delay_list == 0
&& GET_CODE (insn) == JUMP_INSN && GET_CODE (insn) == JUMP_INSN
&& (condjump_p (insn) || condjump_in_parallel_p (insn))) && (condjump_p (insn) || condjump_in_parallel_p (insn)))
{ {
delay_list = optimize_skip (insn); delay_list = optimize_skip (insn);
...@@ -2223,10 +2218,10 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2223,10 +2218,10 @@ fill_simple_delay_slots (non_jumps_p)
fill_eager_delay_slots anyways, it was just deleted. */ fill_eager_delay_slots anyways, it was just deleted. */
if (slots_filled != slots_to_fill if (slots_filled != slots_to_fill
&& (GET_CODE (insn) != JUMP_INSN && (GET_CODE (insn) != JUMP_INSN
|| ((condjump_p (insn) || condjump_in_parallel_p (insn)) || ((condjump_p (insn) || condjump_in_parallel_p (insn))
&& ! simplejump_p (insn) && ! simplejump_p (insn)
&& JUMP_LABEL (insn) != 0))) && JUMP_LABEL (insn) != 0)))
{ {
rtx target = 0; rtx target = 0;
int maybe_never = 0; int maybe_never = 0;
...@@ -2241,7 +2236,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2241,7 +2236,7 @@ fill_simple_delay_slots (non_jumps_p)
mark_referenced_resources (insn, &needed, 1); mark_referenced_resources (insn, &needed, 1);
maybe_never = 1; maybe_never = 1;
} }
else else
{ {
mark_set_resources (insn, &set, 0, MARK_SRC_DEST_CALL); mark_set_resources (insn, &set, 0, MARK_SRC_DEST_CALL);
mark_referenced_resources (insn, &needed, 1); mark_referenced_resources (insn, &needed, 1);
...@@ -2283,7 +2278,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2283,7 +2278,7 @@ fill_simple_delay_slots (non_jumps_p)
break; break;
else if (JUMP_LABEL (trial_delay) != target) else if (JUMP_LABEL (trial_delay) != target)
{ {
rtx ninsn = rtx ninsn =
next_active_insn (JUMP_LABEL (trial_delay)); next_active_insn (JUMP_LABEL (trial_delay));
mark_target_live_regs (get_insns (), ninsn, mark_target_live_regs (get_insns (), ninsn,
...@@ -2338,7 +2333,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2338,7 +2333,7 @@ fill_simple_delay_slots (non_jumps_p)
/* If there are slots left to fill and our search was stopped by an /* If there are slots left to fill and our search was stopped by an
unconditional branch, try the insn at the branch target. We can unconditional branch, try the insn at the branch target. We can
redirect the branch if it works. redirect the branch if it works.
Don't do this if the insn at the branch target is a branch. */ Don't do this if the insn at the branch target is a branch. */
if (slots_to_fill != slots_filled if (slots_to_fill != slots_filled
...@@ -2367,7 +2362,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2367,7 +2362,7 @@ fill_simple_delay_slots (non_jumps_p)
else else
new_label = find_end_label (); new_label = find_end_label ();
delay_list delay_list
= add_to_delay_list (copy_rtx (next_trial), delay_list); = add_to_delay_list (copy_rtx (next_trial), delay_list);
slots_filled++; slots_filled++;
reorg_redirect_jump (trial, new_label); reorg_redirect_jump (trial, new_label);
...@@ -2405,7 +2400,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2405,7 +2400,7 @@ fill_simple_delay_slots (non_jumps_p)
#ifdef DELAY_SLOTS_FOR_EPILOGUE #ifdef DELAY_SLOTS_FOR_EPILOGUE
/* See if the epilogue needs any delay slots. Try to fill them if so. /* See if the epilogue needs any delay slots. Try to fill them if so.
The only thing we can do is scan backwards from the end of the The only thing we can do is scan backwards from the end of the
function. If we did this in a previous pass, it is incorrect to do it function. If we did this in a previous pass, it is incorrect to do it
again. */ again. */
if (current_function_epilogue_delay_list) if (current_function_epilogue_delay_list)
...@@ -2439,7 +2434,7 @@ fill_simple_delay_slots (non_jumps_p) ...@@ -2439,7 +2434,7 @@ fill_simple_delay_slots (non_jumps_p)
SET_HARD_REG_BIT (needed.regs, STACK_POINTER_REGNUM); SET_HARD_REG_BIT (needed.regs, STACK_POINTER_REGNUM);
#ifdef EPILOGUE_USES #ifdef EPILOGUE_USES
for (i = 0; i <FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{ {
if (EPILOGUE_USES (i)) if (EPILOGUE_USES (i))
SET_HARD_REG_BIT (needed.regs, i); SET_HARD_REG_BIT (needed.regs, i);
...@@ -2548,7 +2543,7 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely, ...@@ -2548,7 +2543,7 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely,
/* If our thread is the end of subroutine, we can't get any delay /* If our thread is the end of subroutine, we can't get any delay
insns from that. */ insns from that. */
if (thread == 0) if (thread == 0)
return delay_list; return delay_list;
/* If this is an unconditional branch, nothing is needed at the /* If this is an unconditional branch, nothing is needed at the
opposite thread. Otherwise, compute what is needed there. */ opposite thread. Otherwise, compute what is needed there. */
...@@ -3122,7 +3117,7 @@ relax_delay_slots (first) ...@@ -3122,7 +3117,7 @@ relax_delay_slots (first)
continue; continue;
} }
} }
/* If this is an unconditional jump and the previous insn is a /* If this is an unconditional jump and the previous insn is a
conditional jump, try reversing the condition of the previous conditional jump, try reversing the condition of the previous
insn and swapping our targets. The next pass might be able to insn and swapping our targets. The next pass might be able to
...@@ -3221,7 +3216,7 @@ relax_delay_slots (first) ...@@ -3221,7 +3216,7 @@ relax_delay_slots (first)
if (trial == 0 && target_label != 0) if (trial == 0 && target_label != 0)
trial = find_end_label (); trial = find_end_label ();
if (trial != target_label if (trial != target_label
&& redirect_with_delay_slots_safe_p (delay_insn, trial, insn)) && redirect_with_delay_slots_safe_p (delay_insn, trial, insn))
{ {
reorg_redirect_jump (delay_insn, trial); reorg_redirect_jump (delay_insn, trial);
...@@ -3243,10 +3238,10 @@ relax_delay_slots (first) ...@@ -3243,10 +3238,10 @@ relax_delay_slots (first)
tmp = find_end_label (); tmp = find_end_label ();
/* Insert the special USE insn and update dataflow info. */ /* Insert the special USE insn and update dataflow info. */
update_block (trial, tmp); update_block (trial, tmp);
/* Now emit a label before the special USE insn, and /* Now emit a label before the special USE insn, and
redirect our jump to the new label. */ redirect our jump to the new label. */
target_label = get_label_before (PREV_INSN (tmp)); target_label = get_label_before (PREV_INSN (tmp));
reorg_redirect_jump (delay_insn, target_label); reorg_redirect_jump (delay_insn, target_label);
next = insn; next = insn;
...@@ -3266,7 +3261,7 @@ relax_delay_slots (first) ...@@ -3266,7 +3261,7 @@ relax_delay_slots (first)
if (target_label == 0) if (target_label == 0)
target_label = find_end_label (); target_label = find_end_label ();
if (redirect_with_delay_slots_safe_p (delay_insn, target_label, if (redirect_with_delay_slots_safe_p (delay_insn, target_label,
insn)) insn))
{ {
reorg_redirect_jump (delay_insn, target_label); reorg_redirect_jump (delay_insn, target_label);
...@@ -3413,7 +3408,7 @@ make_return_insns (first) ...@@ -3413,7 +3408,7 @@ make_return_insns (first)
real_return_label = get_label_before (insn); real_return_label = get_label_before (insn);
break; break;
} }
/* Show an extra usage of REAL_RETURN_LABEL so it won't go away if it /* Show an extra usage of REAL_RETURN_LABEL so it won't go away if it
was equal to END_OF_FUNCTION_LABEL. */ was equal to END_OF_FUNCTION_LABEL. */
LABEL_NUSES (real_return_label)++; LABEL_NUSES (real_return_label)++;
...@@ -3471,7 +3466,8 @@ make_return_insns (first) ...@@ -3471,7 +3466,8 @@ make_return_insns (first)
? eligible_for_annul_true (jump_insn, i - 1, ? eligible_for_annul_true (jump_insn, i - 1,
XVECEXP (pat, 0, i), flags) : XVECEXP (pat, 0, i), flags) :
#endif #endif
eligible_for_delay (jump_insn, i -1, XVECEXP (pat, 0, i), flags))) eligible_for_delay (jump_insn, i - 1,
XVECEXP (pat, 0, i), flags)))
break; break;
} }
else else
...@@ -3535,7 +3531,7 @@ dbr_schedule (first, file) ...@@ -3535,7 +3531,7 @@ dbr_schedule (first, file)
flag_no_peephole = old_flag_no_peephole; flag_no_peephole = old_flag_no_peephole;
#endif #endif
/* If the current function has no insns other than the prologue and /* If the current function has no insns other than the prologue and
epilogue, then do not try to fill any delay slots. */ epilogue, then do not try to fill any delay slots. */
if (n_basic_blocks == 0) if (n_basic_blocks == 0)
return; return;
...@@ -3554,7 +3550,7 @@ dbr_schedule (first, file) ...@@ -3554,7 +3550,7 @@ dbr_schedule (first, file)
uid_to_ruid = (int *) xmalloc ((max_uid + 1) * sizeof (int)); uid_to_ruid = (int *) xmalloc ((max_uid + 1) * sizeof (int));
for (i = 0, insn = first; insn; i++, insn = NEXT_INSN (insn)) for (i = 0, insn = first; insn; i++, insn = NEXT_INSN (insn))
uid_to_ruid[INSN_UID (insn)] = i; uid_to_ruid[INSN_UID (insn)] = i;
/* Initialize the list of insns that need filling. */ /* Initialize the list of insns that need filling. */
if (unfilled_firstobj == 0) if (unfilled_firstobj == 0)
{ {
...@@ -3574,12 +3570,12 @@ dbr_schedule (first, file) ...@@ -3574,12 +3570,12 @@ dbr_schedule (first, file)
&& (GET_CODE (PATTERN (insn)) == ADDR_VEC && (GET_CODE (PATTERN (insn)) == ADDR_VEC
|| GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)) || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC))
continue; continue;
if (num_delay_slots (insn) > 0) if (num_delay_slots (insn) > 0)
obstack_ptr_grow (&unfilled_slots_obstack, insn); obstack_ptr_grow (&unfilled_slots_obstack, insn);
/* Ensure all jumps go to the last of a set of consecutive labels. */ /* Ensure all jumps go to the last of a set of consecutive labels. */
if (GET_CODE (insn) == JUMP_INSN if (GET_CODE (insn) == JUMP_INSN
&& (condjump_p (insn) || condjump_in_parallel_p (insn)) && (condjump_p (insn) || condjump_in_parallel_p (insn))
&& 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))))
...@@ -3690,7 +3686,7 @@ dbr_schedule (first, file) ...@@ -3690,7 +3686,7 @@ dbr_schedule (first, file)
else else
total_delay_slots[j]++; total_delay_slots[j]++;
} }
else if (num_delay_slots (insn) > 0) else if (num_delay_slots (insn) > 0)
total_delay_slots[0]++; total_delay_slots[0]++;
} }
} }
...@@ -3735,7 +3731,7 @@ dbr_schedule (first, file) ...@@ -3735,7 +3731,7 @@ dbr_schedule (first, file)
int pred_flags; int pred_flags;
if (GET_CODE (insn) == INSN) if (GET_CODE (insn) == INSN)
{ {
rtx pat = PATTERN (insn); rtx pat = PATTERN (insn);
if (GET_CODE (pat) == SEQUENCE) if (GET_CODE (pat) == SEQUENCE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment