Commit 675f99c9 by Ian Lance Taylor Committed by Ian Lance Taylor

resource.c (mark_referenced_resources): Change include_delayed_effects parameter to bool.

	* resource.c (mark_referenced_resources): Change
	include_delayed_effects parameter to bool.  Change all callers.
	(mark_end_of_function_resources): Likewise.
	* reorg.c (insn_references_resource_p): Likewise.
	(insn_sets_resource_p): Likewise.
	* resource.h (mark_referenced_resources): Update declaration.
	(mark_end_of_function_resources): Update declaration.

From-SVN: r148547
parent a322799d
2009-06-16 Ian Lance Taylor <iant@google.com>
* resource.c (mark_referenced_resources): Change
include_delayed_effects parameter to bool. Change all callers.
(mark_end_of_function_resources): Likewise.
* reorg.c (insn_references_resource_p): Likewise.
(insn_sets_resource_p): Likewise.
* resource.h (mark_referenced_resources): Update declaration.
(mark_end_of_function_resources): Update declaration.
2009-06-16 David Edelsohn <edelsohn@gnu.org> 2009-06-16 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/aix.h (LIBSTDCXX_STATIC): Remove -lstdc++. * config/rs6000/aix.h (LIBSTDCXX_STATIC): Remove -lstdc++.
......
...@@ -173,8 +173,8 @@ static int max_uid; ...@@ -173,8 +173,8 @@ static int max_uid;
static int stop_search_p (rtx, int); static int stop_search_p (rtx, int);
static int resource_conflicts_p (struct resources *, struct resources *); static int resource_conflicts_p (struct resources *, struct resources *);
static int insn_references_resource_p (rtx, struct resources *, int); static int insn_references_resource_p (rtx, struct resources *, bool);
static int insn_sets_resource_p (rtx, struct resources *, int); static int insn_sets_resource_p (rtx, struct resources *, bool);
static rtx find_end_label (void); static rtx find_end_label (void);
static rtx emit_delay_sequence (rtx, rtx, int); static rtx emit_delay_sequence (rtx, rtx, int);
static rtx add_to_delay_list (rtx, rtx); static rtx add_to_delay_list (rtx, rtx);
...@@ -297,7 +297,7 @@ resource_conflicts_p (struct resources *res1, struct resources *res2) ...@@ -297,7 +297,7 @@ resource_conflicts_p (struct resources *res1, struct resources *res2)
static int static int
insn_references_resource_p (rtx insn, struct resources *res, insn_references_resource_p (rtx insn, struct resources *res,
int include_delayed_effects) bool include_delayed_effects)
{ {
struct resources insn_res; struct resources insn_res;
...@@ -313,7 +313,7 @@ insn_references_resource_p (rtx insn, struct resources *res, ...@@ -313,7 +313,7 @@ insn_references_resource_p (rtx insn, struct resources *res,
static int static int
insn_sets_resource_p (rtx insn, struct resources *res, insn_sets_resource_p (rtx insn, struct resources *res,
int include_delayed_effects) bool include_delayed_effects)
{ {
struct resources insn_sets; struct resources insn_sets;
...@@ -1246,7 +1246,7 @@ steal_delay_list_from_target (rtx insn, rtx condition, rtx seq, ...@@ -1246,7 +1246,7 @@ steal_delay_list_from_target (rtx insn, rtx condition, rtx seq,
rtx trial = XEXP (temp, 0); rtx trial = XEXP (temp, 0);
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, false))
return delay_list; return delay_list;
} }
...@@ -1268,9 +1268,9 @@ steal_delay_list_from_target (rtx insn, rtx condition, rtx seq, ...@@ -1268,9 +1268,9 @@ steal_delay_list_from_target (rtx insn, rtx condition, rtx seq,
rtx trial = XVECEXP (seq, 0, i); rtx trial = XVECEXP (seq, 0, i);
int flags; int flags;
if (insn_references_resource_p (trial, sets, 0) if (insn_references_resource_p (trial, sets, false)
|| insn_sets_resource_p (trial, needed, 0) || insn_sets_resource_p (trial, needed, false)
|| insn_sets_resource_p (trial, sets, 0) || insn_sets_resource_p (trial, sets, false)
#ifdef HAVE_cc0 #ifdef HAVE_cc0
/* If TRIAL sets CC0, we can't copy it, so we can't steal this /* If TRIAL sets CC0, we can't copy it, so we can't steal this
delay list. */ delay list. */
...@@ -1293,7 +1293,7 @@ steal_delay_list_from_target (rtx insn, rtx condition, rtx seq, ...@@ -1293,7 +1293,7 @@ steal_delay_list_from_target (rtx insn, rtx condition, rtx seq,
if (! must_annul if (! must_annul
&& ((condition == const_true_rtx && ((condition == const_true_rtx
|| (! insn_sets_resource_p (trial, other_needed, 0) || (! insn_sets_resource_p (trial, other_needed, false)
&& ! may_trap_or_fault_p (PATTERN (trial))))) && ! may_trap_or_fault_p (PATTERN (trial)))))
? eligible_for_delay (insn, total_slots_filled, trial, flags) ? eligible_for_delay (insn, total_slots_filled, trial, flags)
: (must_annul || (delay_list == NULL && new_delay_list == NULL)) : (must_annul || (delay_list == NULL && new_delay_list == NULL))
...@@ -1368,9 +1368,9 @@ steal_delay_list_from_fallthrough (rtx insn, rtx condition, rtx seq, ...@@ -1368,9 +1368,9 @@ steal_delay_list_from_fallthrough (rtx insn, rtx condition, rtx seq,
/* If TRIAL sets CC0, stealing it will move it too far from the use /* If TRIAL sets CC0, stealing it will move it too far from the use
of CC0. */ of CC0. */
if (insn_references_resource_p (trial, sets, 0) if (insn_references_resource_p (trial, sets, false)
|| insn_sets_resource_p (trial, needed, 0) || insn_sets_resource_p (trial, needed, false)
|| insn_sets_resource_p (trial, sets, 0) || insn_sets_resource_p (trial, sets, false)
#ifdef HAVE_cc0 #ifdef HAVE_cc0
|| sets_cc0_p (PATTERN (trial)) || sets_cc0_p (PATTERN (trial))
#endif #endif
...@@ -1387,7 +1387,7 @@ steal_delay_list_from_fallthrough (rtx insn, rtx condition, rtx seq, ...@@ -1387,7 +1387,7 @@ steal_delay_list_from_fallthrough (rtx insn, rtx condition, rtx seq,
if (! must_annul if (! must_annul
&& ((condition == const_true_rtx && ((condition == const_true_rtx
|| (! insn_sets_resource_p (trial, other_needed, 0) || (! insn_sets_resource_p (trial, other_needed, false)
&& ! may_trap_or_fault_p (PATTERN (trial))))) && ! may_trap_or_fault_p (PATTERN (trial)))))
? eligible_for_delay (insn, *pslots_filled, trial, flags) ? eligible_for_delay (insn, *pslots_filled, trial, flags)
: (must_annul || delay_list == NULL) && (must_annul = 1, : (must_annul || delay_list == NULL) && (must_annul = 1,
...@@ -1448,7 +1448,8 @@ try_merge_delay_insns (rtx insn, rtx thread) ...@@ -1448,7 +1448,8 @@ try_merge_delay_insns (rtx insn, rtx thread)
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,
true);
for (trial = thread; !stop_search_p (trial, 1); trial = next_trial) for (trial = thread; !stop_search_p (trial, 1); trial = next_trial)
{ {
...@@ -1467,9 +1468,9 @@ try_merge_delay_insns (rtx insn, rtx thread) ...@@ -1467,9 +1468,9 @@ try_merge_delay_insns (rtx insn, rtx thread)
/* We can't share an insn that sets cc0. */ /* We can't share an insn that sets cc0. */
&& ! sets_cc0_p (pat) && ! sets_cc0_p (pat)
#endif #endif
&& ! insn_references_resource_p (trial, &set, 1) && ! insn_references_resource_p (trial, &set, true)
&& ! insn_sets_resource_p (trial, &set, 1) && ! insn_sets_resource_p (trial, &set, true)
&& ! insn_sets_resource_p (trial, &needed, 1) && ! insn_sets_resource_p (trial, &needed, true)
&& (trial = try_split (pat, trial, 0)) != 0 && (trial = try_split (pat, trial, 0)) != 0
/* Update next_trial, in case try_split succeeded. */ /* Update next_trial, in case try_split succeeded. */
&& (next_trial = next_nonnote_insn (trial)) && (next_trial = next_nonnote_insn (trial))
...@@ -1500,7 +1501,7 @@ try_merge_delay_insns (rtx insn, rtx thread) ...@@ -1500,7 +1501,7 @@ try_merge_delay_insns (rtx insn, rtx thread)
} }
mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL); mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL);
mark_referenced_resources (trial, &needed, 1); mark_referenced_resources (trial, &needed, true);
} }
/* See if we stopped on a filled insn. If we did, try to see if its /* See if we stopped on a filled insn. If we did, try to see if its
...@@ -1515,15 +1516,15 @@ try_merge_delay_insns (rtx insn, rtx thread) ...@@ -1515,15 +1516,15 @@ try_merge_delay_insns (rtx insn, rtx thread)
/* Account for resources set/needed by the filled insn. */ /* Account for resources set/needed by the filled insn. */
mark_set_resources (filled_insn, &set, 0, MARK_SRC_DEST_CALL); mark_set_resources (filled_insn, &set, 0, MARK_SRC_DEST_CALL);
mark_referenced_resources (filled_insn, &needed, 1); mark_referenced_resources (filled_insn, &needed, true);
for (i = 1; i < XVECLEN (pat, 0); i++) for (i = 1; i < XVECLEN (pat, 0); i++)
{ {
rtx dtrial = XVECEXP (pat, 0, i); rtx dtrial = XVECEXP (pat, 0, i);
if (! insn_references_resource_p (dtrial, &set, 1) if (! insn_references_resource_p (dtrial, &set, true)
&& ! insn_sets_resource_p (dtrial, &set, 1) && ! insn_sets_resource_p (dtrial, &set, true)
&& ! insn_sets_resource_p (dtrial, &needed, 1) && ! insn_sets_resource_p (dtrial, &needed, true)
#ifdef HAVE_cc0 #ifdef HAVE_cc0
&& ! sets_cc0_p (PATTERN (dtrial)) && ! sets_cc0_p (PATTERN (dtrial))
#endif #endif
...@@ -1554,7 +1555,7 @@ try_merge_delay_insns (rtx insn, rtx thread) ...@@ -1554,7 +1555,7 @@ try_merge_delay_insns (rtx insn, rtx 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, true);
} }
} }
} }
...@@ -1690,7 +1691,7 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) ...@@ -1690,7 +1691,7 @@ redundant_insn (rtx insn, rtx target, rtx delay_list)
CLEAR_RESOURCE (&needed); CLEAR_RESOURCE (&needed);
CLEAR_RESOURCE (&set); CLEAR_RESOURCE (&set);
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, true);
/* If TARGET is a SEQUENCE, get the main insn. */ /* If TARGET is a SEQUENCE, get the main insn. */
if (NONJUMP_INSN_P (target) && GET_CODE (PATTERN (target)) == SEQUENCE) if (NONJUMP_INSN_P (target) && GET_CODE (PATTERN (target)) == SEQUENCE)
...@@ -1702,8 +1703,8 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) ...@@ -1702,8 +1703,8 @@ redundant_insn (rtx insn, rtx target, rtx delay_list)
#endif #endif
/* The insn requiring the delay may not set anything needed or set by /* The insn requiring the delay may not set anything needed or set by
INSN. */ INSN. */
|| insn_sets_resource_p (target_main, &needed, 1) || insn_sets_resource_p (target_main, &needed, true)
|| insn_sets_resource_p (target_main, &set, 1)) || insn_sets_resource_p (target_main, &set, true))
return 0; return 0;
/* Insns we pass may not set either NEEDED or SET, so merge them for /* Insns we pass may not set either NEEDED or SET, so merge them for
...@@ -1717,14 +1718,15 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) ...@@ -1717,14 +1718,15 @@ redundant_insn (rtx insn, rtx target, rtx delay_list)
while (delay_list) while (delay_list)
{ {
if (insn_sets_resource_p (XEXP (delay_list, 0), &needed, 1)) if (insn_sets_resource_p (XEXP (delay_list, 0), &needed, true))
return 0; return 0;
delay_list = XEXP (delay_list, 1); delay_list = XEXP (delay_list, 1);
} }
if (NONJUMP_INSN_P (target) && GET_CODE (PATTERN (target)) == SEQUENCE) if (NONJUMP_INSN_P (target) && GET_CODE (PATTERN (target)) == SEQUENCE)
for (i = 1; i < XVECLEN (PATTERN (target), 0); i++) for (i = 1; i < XVECLEN (PATTERN (target), 0); i++)
if (insn_sets_resource_p (XVECEXP (PATTERN (target), 0, i), &needed, 1)) if (insn_sets_resource_p (XVECEXP (PATTERN (target), 0, i), &needed,
true))
return 0; return 0;
/* Scan backwards until we reach a label or an insn that uses something /* Scan backwards until we reach a label or an insn that uses something
...@@ -1783,13 +1785,13 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) ...@@ -1783,13 +1785,13 @@ redundant_insn (rtx insn, rtx target, rtx delay_list)
we must stop if it sets anything needed or set by INSN. */ we must stop if it sets anything needed or set by INSN. */
if ((! INSN_ANNULLED_BRANCH_P (XVECEXP (pat, 0, 0)) if ((! INSN_ANNULLED_BRANCH_P (XVECEXP (pat, 0, 0))
|| ! INSN_FROM_TARGET_P (candidate)) || ! INSN_FROM_TARGET_P (candidate))
&& insn_sets_resource_p (candidate, &needed, 1)) && insn_sets_resource_p (candidate, &needed, true))
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, true))
return 0; return 0;
} }
else else
...@@ -1800,7 +1802,7 @@ redundant_insn (rtx insn, rtx target, rtx delay_list) ...@@ -1800,7 +1802,7 @@ redundant_insn (rtx insn, rtx target, rtx delay_list)
return trial; return trial;
/* Can't go any further if TRIAL conflicts with INSN. */ /* Can't go any further if TRIAL conflicts with INSN. */
if (insn_sets_resource_p (trial, &needed, 1)) if (insn_sets_resource_p (trial, &needed, true))
return 0; return 0;
} }
} }
...@@ -2138,7 +2140,7 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2138,7 +2140,7 @@ fill_simple_delay_slots (int non_jumps_p)
CLEAR_RESOURCE (&needed); CLEAR_RESOURCE (&needed);
CLEAR_RESOURCE (&set); CLEAR_RESOURCE (&set);
mark_set_resources (insn, &set, 0, MARK_SRC_DEST); mark_set_resources (insn, &set, 0, MARK_SRC_DEST);
mark_referenced_resources (insn, &needed, 0); mark_referenced_resources (insn, &needed, false);
for (trial = prev_nonnote_insn (insn); ! stop_search_p (trial, 1); for (trial = prev_nonnote_insn (insn); ! stop_search_p (trial, 1);
trial = next_trial) trial = next_trial)
...@@ -2154,9 +2156,9 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2154,9 +2156,9 @@ fill_simple_delay_slots (int non_jumps_p)
/* 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, true)
&& ! insn_sets_resource_p (trial, &set, 1) && ! insn_sets_resource_p (trial, &set, true)
&& ! insn_sets_resource_p (trial, &needed, 1) && ! insn_sets_resource_p (trial, &needed, true)
#ifdef HAVE_cc0 #ifdef HAVE_cc0
/* Can't separate set of cc0 from its use. */ /* Can't separate set of cc0 from its use. */
&& ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat)) && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat))
...@@ -2184,7 +2186,7 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2184,7 +2186,7 @@ fill_simple_delay_slots (int non_jumps_p)
} }
mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL); mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL);
mark_referenced_resources (trial, &needed, 1); mark_referenced_resources (trial, &needed, true);
} }
} }
...@@ -2255,13 +2257,13 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2255,13 +2257,13 @@ fill_simple_delay_slots (int non_jumps_p)
if (CALL_P (insn)) if (CALL_P (insn))
{ {
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, true);
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, true);
if (JUMP_P (insn)) if (JUMP_P (insn))
target = JUMP_LABEL (insn); target = JUMP_LABEL (insn);
} }
...@@ -2296,9 +2298,9 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2296,9 +2298,9 @@ fill_simple_delay_slots (int non_jumps_p)
/* See if we have a resource problem before we try to /* See if we have a resource problem before we try to
split. */ split. */
if (GET_CODE (pat) != SEQUENCE if (GET_CODE (pat) != SEQUENCE
&& ! insn_references_resource_p (trial, &set, 1) && ! insn_references_resource_p (trial, &set, true)
&& ! insn_sets_resource_p (trial, &set, 1) && ! insn_sets_resource_p (trial, &set, true)
&& ! insn_sets_resource_p (trial, &needed, 1) && ! insn_sets_resource_p (trial, &needed, true)
#ifdef HAVE_cc0 #ifdef HAVE_cc0
&& ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat)) && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat))
#endif #endif
...@@ -2322,7 +2324,7 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2322,7 +2324,7 @@ fill_simple_delay_slots (int non_jumps_p)
} }
mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL); mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL);
mark_referenced_resources (trial, &needed, 1); mark_referenced_resources (trial, &needed, true);
/* Ensure we don't put insns between the setting of cc and the /* Ensure we don't put insns between the setting of cc and the
comparison by moving a setting of cc into an earlier delay comparison by moving a setting of cc into an earlier delay
...@@ -2349,9 +2351,9 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2349,9 +2351,9 @@ fill_simple_delay_slots (int non_jumps_p)
&& ! (NONJUMP_INSN_P (next_trial) && ! (NONJUMP_INSN_P (next_trial)
&& GET_CODE (PATTERN (next_trial)) == SEQUENCE) && GET_CODE (PATTERN (next_trial)) == SEQUENCE)
&& !JUMP_P (next_trial) && !JUMP_P (next_trial)
&& ! insn_references_resource_p (next_trial, &set, 1) && ! insn_references_resource_p (next_trial, &set, true)
&& ! insn_sets_resource_p (next_trial, &set, 1) && ! insn_sets_resource_p (next_trial, &set, true)
&& ! insn_sets_resource_p (next_trial, &needed, 1) && ! insn_sets_resource_p (next_trial, &needed, true)
#ifdef HAVE_cc0 #ifdef HAVE_cc0
&& ! reg_mentioned_p (cc0_rtx, PATTERN (next_trial)) && ! reg_mentioned_p (cc0_rtx, PATTERN (next_trial))
#endif #endif
...@@ -2458,9 +2460,9 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2458,9 +2460,9 @@ fill_simple_delay_slots (int non_jumps_p)
if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER) if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER)
continue; continue;
if (! insn_references_resource_p (trial, &set, 1) if (! insn_references_resource_p (trial, &set, true)
&& ! insn_sets_resource_p (trial, &needed, 1) && ! insn_sets_resource_p (trial, &needed, true)
&& ! insn_sets_resource_p (trial, &set, 1) && ! insn_sets_resource_p (trial, &set, true)
#ifdef HAVE_cc0 #ifdef HAVE_cc0
/* Don't want to mess with cc0 here. */ /* Don't want to mess with cc0 here. */
&& ! reg_mentioned_p (cc0_rtx, pat) && ! reg_mentioned_p (cc0_rtx, pat)
...@@ -2476,7 +2478,7 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2476,7 +2478,7 @@ fill_simple_delay_slots (int non_jumps_p)
crtl->epilogue_delay_list crtl->epilogue_delay_list
= gen_rtx_INSN_LIST (VOIDmode, trial, = gen_rtx_INSN_LIST (VOIDmode, trial,
crtl->epilogue_delay_list); crtl->epilogue_delay_list);
mark_end_of_function_resources (trial, 1); mark_end_of_function_resources (trial, true);
update_block (trial, trial); update_block (trial, trial);
delete_related_insns (trial); delete_related_insns (trial);
...@@ -2490,7 +2492,7 @@ fill_simple_delay_slots (int non_jumps_p) ...@@ -2490,7 +2492,7 @@ fill_simple_delay_slots (int non_jumps_p)
} }
mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL); mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL);
mark_referenced_resources (trial, &needed, 1); mark_referenced_resources (trial, &needed, true);
} }
note_delay_statistics (slots_filled, 0); note_delay_statistics (slots_filled, 0);
...@@ -2635,9 +2637,9 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread, ...@@ -2635,9 +2637,9 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
/* If TRIAL conflicts with the insns ahead of it, we lose. Also, /* If TRIAL conflicts with the insns ahead of it, we lose. Also,
don't separate or copy insns that set and use CC0. */ don't separate or copy insns that set and use CC0. */
if (! insn_references_resource_p (trial, &set, 1) if (! insn_references_resource_p (trial, &set, true)
&& ! insn_sets_resource_p (trial, &set, 1) && ! insn_sets_resource_p (trial, &set, true)
&& ! insn_sets_resource_p (trial, &needed, 1) && ! insn_sets_resource_p (trial, &needed, true)
#ifdef HAVE_cc0 #ifdef HAVE_cc0
&& ! (reg_mentioned_p (cc0_rtx, pat) && ! (reg_mentioned_p (cc0_rtx, pat)
&& (! own_thread || ! sets_cc0_p (pat))) && (! own_thread || ! sets_cc0_p (pat)))
...@@ -2678,7 +2680,7 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread, ...@@ -2678,7 +2680,7 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
go into an annulled delay slot. */ go into an annulled delay slot. */
if (!must_annul if (!must_annul
&& (condition == const_true_rtx && (condition == const_true_rtx
|| (! insn_sets_resource_p (trial, &opposite_needed, 1) || (! insn_sets_resource_p (trial, &opposite_needed, true)
&& ! may_trap_or_fault_p (pat)))) && ! may_trap_or_fault_p (pat))))
{ {
old_trial = trial; old_trial = trial;
...@@ -2793,10 +2795,11 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread, ...@@ -2793,10 +2795,11 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
may be branching to a location that has a may be branching to a location that has a
redundant insn. Skip any if so. */ redundant insn. Skip any if so. */
while (new_thread && ! own_thread while (new_thread && ! own_thread
&& ! insn_sets_resource_p (new_thread, &set, 1) && ! insn_sets_resource_p (new_thread, &set, true)
&& ! insn_sets_resource_p (new_thread, &needed, 1) && ! insn_sets_resource_p (new_thread, &needed,
true)
&& ! insn_references_resource_p (new_thread, && ! insn_references_resource_p (new_thread,
&set, 1) &set, true)
&& (prior_insn && (prior_insn
= redundant_insn (new_thread, insn, = redundant_insn (new_thread, insn,
delay_list))) delay_list)))
...@@ -2818,7 +2821,7 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread, ...@@ -2818,7 +2821,7 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
/* This insn can't go into a delay slot. */ /* This insn can't go into a delay slot. */
lose = 1; lose = 1;
mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL); mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL);
mark_referenced_resources (trial, &needed, 1); mark_referenced_resources (trial, &needed, true);
/* Ensure we don't put insns between the setting of cc and the comparison /* Ensure we don't put insns between the setting of cc and the comparison
by moving a setting of cc into an earlier delay slot since these insns by moving a setting of cc into an earlier delay slot since these insns
......
/* Definitions for computing resource usage of specific insns. /* Definitions for computing resource usage of specific insns.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
Free Software Foundation, Inc. 2009 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -203,7 +203,7 @@ next_insn_no_annul (rtx insn) ...@@ -203,7 +203,7 @@ next_insn_no_annul (rtx insn)
void void
mark_referenced_resources (rtx x, struct resources *res, mark_referenced_resources (rtx x, struct resources *res,
int include_delayed_effects) bool include_delayed_effects)
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
int i, j; int i, j;
...@@ -226,7 +226,7 @@ mark_referenced_resources (rtx x, struct resources *res, ...@@ -226,7 +226,7 @@ mark_referenced_resources (rtx x, struct resources *res,
case SUBREG: case SUBREG:
if (!REG_P (SUBREG_REG (x))) if (!REG_P (SUBREG_REG (x)))
mark_referenced_resources (SUBREG_REG (x), res, 0); mark_referenced_resources (SUBREG_REG (x), res, false);
else else
{ {
unsigned int regno = subreg_regno (x); unsigned int regno = subreg_regno (x);
...@@ -253,7 +253,7 @@ mark_referenced_resources (rtx x, struct resources *res, ...@@ -253,7 +253,7 @@ mark_referenced_resources (rtx x, struct resources *res,
res->volatil |= MEM_VOLATILE_P (x); res->volatil |= MEM_VOLATILE_P (x);
/* Mark registers used to access memory. */ /* Mark registers used to access memory. */
mark_referenced_resources (XEXP (x, 0), res, 0); mark_referenced_resources (XEXP (x, 0), res, false);
return; return;
case CC0: case CC0:
...@@ -276,14 +276,14 @@ mark_referenced_resources (rtx x, struct resources *res, ...@@ -276,14 +276,14 @@ mark_referenced_resources (rtx x, struct resources *res,
traditional asms unlike their normal usage. */ traditional asms unlike their normal usage. */
for (i = 0; i < ASM_OPERANDS_INPUT_LENGTH (x); i++) for (i = 0; i < ASM_OPERANDS_INPUT_LENGTH (x); i++)
mark_referenced_resources (ASM_OPERANDS_INPUT (x, i), res, 0); mark_referenced_resources (ASM_OPERANDS_INPUT (x, i), res, false);
return; return;
case CALL: case CALL:
/* The first operand will be a (MEM (xxx)) but doesn't really reference /* The first operand will be a (MEM (xxx)) but doesn't really reference
memory. The second operand may be referenced, though. */ memory. The second operand may be referenced, though. */
mark_referenced_resources (XEXP (XEXP (x, 0), 0), res, 0); mark_referenced_resources (XEXP (XEXP (x, 0), 0), res, false);
mark_referenced_resources (XEXP (x, 1), res, 0); mark_referenced_resources (XEXP (x, 1), res, false);
return; return;
case SET: case SET:
...@@ -291,16 +291,16 @@ mark_referenced_resources (rtx x, struct resources *res, ...@@ -291,16 +291,16 @@ mark_referenced_resources (rtx x, struct resources *res,
registers used to access memory are referenced. SET_DEST is registers used to access memory are referenced. SET_DEST is
also referenced if it is a ZERO_EXTRACT. */ also referenced if it is a ZERO_EXTRACT. */
mark_referenced_resources (SET_SRC (x), res, 0); mark_referenced_resources (SET_SRC (x), res, false);
x = SET_DEST (x); x = SET_DEST (x);
if (GET_CODE (x) == ZERO_EXTRACT if (GET_CODE (x) == ZERO_EXTRACT
|| GET_CODE (x) == STRICT_LOW_PART) || GET_CODE (x) == STRICT_LOW_PART)
mark_referenced_resources (x, res, 0); mark_referenced_resources (x, res, false);
else if (GET_CODE (x) == SUBREG) else if (GET_CODE (x) == SUBREG)
x = SUBREG_REG (x); x = SUBREG_REG (x);
if (MEM_P (x)) if (MEM_P (x))
mark_referenced_resources (XEXP (x, 0), res, 0); mark_referenced_resources (XEXP (x, 0), res, false);
return; return;
case CLOBBER: case CLOBBER:
...@@ -372,7 +372,7 @@ mark_referenced_resources (rtx x, struct resources *res, ...@@ -372,7 +372,7 @@ mark_referenced_resources (rtx x, struct resources *res,
} }
if (i >= seq_size) if (i >= seq_size)
mark_referenced_resources (XEXP (XEXP (link, 0), 0), mark_referenced_resources (XEXP (XEXP (link, 0), 0),
res, 0); res, false);
} }
} }
} }
...@@ -519,7 +519,7 @@ find_dead_or_set_registers (rtx target, struct resources *res, ...@@ -519,7 +519,7 @@ find_dead_or_set_registers (rtx target, struct resources *res,
if (jump_count >= 10) if (jump_count >= 10)
break; break;
mark_referenced_resources (insn, &needed, 1); mark_referenced_resources (insn, &needed, true);
/* For an annulled branch, mark_set_resources ignores slots /* For an annulled branch, mark_set_resources ignores slots
filled by instructions from the target. This is correct filled by instructions from the target. This is correct
...@@ -585,7 +585,7 @@ find_dead_or_set_registers (rtx target, struct resources *res, ...@@ -585,7 +585,7 @@ find_dead_or_set_registers (rtx target, struct resources *res,
} }
} }
mark_referenced_resources (insn, &needed, 1); mark_referenced_resources (insn, &needed, true);
mark_set_resources (insn, &set, 0, MARK_SRC_DEST_CALL); mark_set_resources (insn, &set, 0, MARK_SRC_DEST_CALL);
COPY_HARD_REG_SET (scratch, set.regs); COPY_HARD_REG_SET (scratch, set.regs);
...@@ -888,7 +888,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res) ...@@ -888,7 +888,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
else if (return_insn_p (target)) else if (return_insn_p (target))
{ {
*res = end_of_function_needs; *res = end_of_function_needs;
mark_referenced_resources (target, res, 0); mark_referenced_resources (target, res, false);
return; return;
} }
...@@ -1101,7 +1101,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res) ...@@ -1101,7 +1101,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
/* Include JUMP_INSN in the needed registers. */ /* Include JUMP_INSN in the needed registers. */
for (insn = target; insn != stop_insn; insn = next_active_insn (insn)) for (insn = target; insn != stop_insn; insn = next_active_insn (insn))
{ {
mark_referenced_resources (insn, &needed, 1); mark_referenced_resources (insn, &needed, true);
COPY_HARD_REG_SET (scratch, needed.regs); COPY_HARD_REG_SET (scratch, needed.regs);
AND_COMPL_HARD_REG_SET (scratch, set.regs); AND_COMPL_HARD_REG_SET (scratch, set.regs);
...@@ -1155,7 +1155,7 @@ init_resource_info (rtx epilogue_insn) ...@@ -1155,7 +1155,7 @@ init_resource_info (rtx epilogue_insn)
if (crtl->return_rtx != 0) if (crtl->return_rtx != 0)
mark_referenced_resources (crtl->return_rtx, mark_referenced_resources (crtl->return_rtx,
&end_of_function_needs, 1); &end_of_function_needs, true);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (global_regs[i] if (global_regs[i]
...@@ -1274,7 +1274,7 @@ incr_ticks_for_insn (rtx insn) ...@@ -1274,7 +1274,7 @@ incr_ticks_for_insn (rtx insn)
/* Add TRIAL to the set of resources used at the end of the current /* Add TRIAL to the set of resources used at the end of the current
function. */ function. */
void void
mark_end_of_function_resources (rtx trial, int include_delayed_effects) mark_end_of_function_resources (rtx trial, bool include_delayed_effects)
{ {
mark_referenced_resources (trial, &end_of_function_needs, mark_referenced_resources (trial, &end_of_function_needs,
include_delayed_effects); include_delayed_effects);
......
/* Definitions for computing resource usage of specific insns. /* Definitions for computing resource usage of specific insns.
Copyright (C) 1999, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Copyright (C) 1999, 2003, 2004, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -48,10 +49,10 @@ enum mark_resource_type ...@@ -48,10 +49,10 @@ enum mark_resource_type
extern void mark_target_live_regs (rtx, rtx, struct resources *); extern void mark_target_live_regs (rtx, rtx, struct resources *);
extern void mark_set_resources (rtx, struct resources *, int, extern void mark_set_resources (rtx, struct resources *, int,
enum mark_resource_type); enum mark_resource_type);
extern void mark_referenced_resources (rtx, struct resources *, int); extern void mark_referenced_resources (rtx, struct resources *, bool);
extern void clear_hashed_info_for_insn (rtx); extern void clear_hashed_info_for_insn (rtx);
extern void incr_ticks_for_insn (rtx); extern void incr_ticks_for_insn (rtx);
extern void mark_end_of_function_resources (rtx, int); extern void mark_end_of_function_resources (rtx, bool);
extern void init_resource_info (rtx); extern void init_resource_info (rtx);
extern void free_resource_info (void); extern void free_resource_info (void);
......
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