summaryrefslogtreecommitdiff
path: root/gcc/sched-rgn.c
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-25 21:19:23 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-25 21:19:23 +0000
commitb24ef46757e17dd94014b0f55d1ba3bd050dbea0 (patch)
treebf674dc0104d0e2f8915243f6f3e9e1b4acc1d1b /gcc/sched-rgn.c
parent2007d20f2f233f642e76d60039a96651dff52294 (diff)
downloadgcc-b24ef46757e17dd94014b0f55d1ba3bd050dbea0.tar.gz
Strengthen haifa_sched_info callbacks and 3 scheduler hooks
gcc/ * target.def (reorder): Strengthen param "ready" of this DEFHOOK from rtx * to rtx_insn **. (reorder2): Likewise. (dependencies_evaluation_hook): Strengthen params "head", "tail" from rtx to rtx_insn *. * doc/tm.texi: Update mechanically for above change to target.def. * sched-int.h (note_list): Strengthen this variable from rtx to rtx_insn *. (remove_notes): Likewise for both params. (restore_other_notes): Likewise for return type and first param. (struct ready_list): Strengthen field "vec" from rtx * to rtx_insn **. (struct dep_replacement): Strenghten field "insn" from rtx to rtx_insn *. (struct deps_desc): Likewise for fields "last_debug_insn", "last_args_size". (struct haifa_sched_info): Likewise for callback field "can_schedule_ready_p"'s param, for first param of "new_ready" callback field, for both params of "rank" callback field, for first field of "print_insn" callback field (with a const), for both params of "contributes_to_priority" callback, for param of "insn_finishes_block_p" callback, for fields "prev_head", "next_tail", "head", "tail", for first param of "add_remove_insn" callback, for first param of "begin_schedule_ready" callback, for both params of "begin_move_insn" callback, and for second param of "advance_target_bb" callback. (add_dependence): Likewise for params 1 and 2. (sched_analyze): Likewise for params 2 and 3. (deps_analyze_insn): Likewise for param 2. (ready_element): Likewise for return type. (ready_lastpos): Strengthen return type from rtx * to rtx_insn **. (try_ready): Strenghten param from rtx to rtx_insn *. (sched_emit_insn): Likewise for return type. (record_delay_slot_pair): Likewise for params 1 and 2. (add_delay_dependencies): Likewise for param. (contributes_to_priority): Likewise for both params. (find_modifiable_mems): Likewise. * config/arm/arm.c (cortexa7_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "insn", "first_older_only_insn" from rtx to rtx_insn *. (arm_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. * config/c6x/c6x.c (struct c6x_sched_context): Strengthen field "last_scheduled_iter0" from rtx to rtx_insn *. (init_sched_state): Replace use of NULL_RTX with NULL for insn. (c6x_sched_reorder_1): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (c6x_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (c6x_sched_reorder2): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (c6x_variable_issue): Add a checked cast when assigning from insn to ss.last_scheduled_iter0. (split_delayed_branch): Strengthen param "insn" and local "i1" from rtx to rtx_insn *. (split_delayed_nonbranch): Likewise. (undo_split_delayed_nonbranch): Likewise for local "insn". (hwloop_optimize): Likewise for locals "seq", "insn", "prev", "entry_after", "end_packet", "head_insn", "tail_insn", "new_insns", "last_insn", "this_iter", "prev_stage_insn". Strengthen locals "orig_vec", "copies", "insn_copies" from rtx * to rtx_insn **. Remove now-redundant checked cast on last_insn, but add a checked cast on loop->start_label. Consolidate calls to avoid assigning result of gen_spkernel to "insn", now an rtx_insn *. * config/i386/i386.c (do_reorder_for_imul): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (swap_top_of_ready_list): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "top", "next" from rtx to rtx_insn *. (ix86_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (add_parameter_dependencies): Strengthen params "call", "head" and locals "insn", "last", "first_arg" from rtx to rtx_insn *. (avoid_func_arg_motion): Likewise for params "first_arg", "insn". (add_dependee_for_func_arg): Likewise for param "arg" and local "insn". (ix86_dependencies_evaluation_hook): Likewise for params "head", "tail" and locals "insn", "first_arg". * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Likewise for params "head", "tail" and locals "insn", "next", "next_tail". (ia64_dfa_sched_reorder): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen locals "insn", "lowest", "highest" from rtx to rtx_insn *. (ia64_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (ia64_sched_reorder2): Likewise. * config/mep/mep.c (mep_find_ready_insn): Strengthen return type and local "insn" from rtx to rtx_insn *. Strengthen param "ready" from rtx * to rtx_insn **. (mep_move_ready_insn): Strengthen param "ready" from rtx * to rtx_insn **. (mep_print_sched_insn): Strengthen param "insn" from rtx to rtx_insn *. (mep_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "core_insn", "cop_insn" from rtx to rtx_insn *. * config/mips/mips.c (mips_promote_ready): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "new_head" from rtx to rtx_insn *. (mips_maybe_swap_ready): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "temp" from rtx to rtx_insn *. (mips_macc_chains_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (vr4130_reorder): Likewise. (mips_74k_agen_reorder): Likewise. Strengthen local "insn" from rtx to rtx_insn *. (mips_sched_reorder_1): Strengthen param "ready" from rtx * to rtx_insn **. (mips_sched_reorder): Likewise. (mips_sched_reorder2): Likewise. * config/picochip/picochip.c (picochip_sched_reorder): Likewise. * config/rs6000/rs6000.c (rs6000_sched_reorder): Likewise. Strengthen local "tmp" from rtx to rtx_insn *. (rs6000_sched_reorder2): Likewise. * config/s390/s390.c (s390_z10_prevent_earlyload_conflicts): Likewise. Update sizeof(rtx) to sizeof(rtx_insn *) in memmove. (s390_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "tmp" from rtx to rtx_insn *. * config/sh/sh.c (rank_for_reorder): Strengthen locals "tmp", "tmp2" from rtx to rtx_insn *. (swap_reorder): Strengthen param "a" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (ready_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Update sizeof(rtx) to sizeof(rtx_insn *) in qsort. (sh_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (sh_reorder2): Likewise. * config/spu/spu.c (spu_sched_reorder): Likewise. Strengthen local "insn" from rtx to rtx_insn *. * haifa-sched.c (note_list): Strengthen this variable from rtx to rtx_insn *. (scheduled_insns): Strengthen this variable from vec<rtx> to vec<rtx_insn *>. (set_modulo_params): Likewise for locals "i1", "i2". (record_delay_slot_pair): Likewise for params "i1", "i2". (add_delay_dependencies): Likewise for param "insn". (cond_clobbered_p): Likewise. (recompute_todo_spec): Likewise for local "prev". (last_scheduled_insn): Likewise for this variable. (nonscheduled_insns_begin): Likewise. (model_set_excess_costs): Strengthen param "insns" from rtx * to rtx_insn **. (rank_for_schedule): Strengthen locals "tmp", "tmp2" from rtx to rtx_insn *. (swap_sort): Strengthen param "a" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (queue_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_lastpos): Strengthen return type from rtx * to rtx_insn **. (ready_add): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first): Likewise for return type and local "t". (ready_element): Likewise for return type. (ready_remove): Likewise for return type and local "t". (ready_sort): Strengthen local "first" from rtx * to rtx_insn **. (check_clobbered_conditions): Strengthen local "x" from rtx to rtx_insn *, adding a checked cast. (schedule_insn): Likewise for param "insn". (remove_notes): Likewise for params "head", "tail" and locals "next_tail", "insn", "next". (struct haifa_saved_data): Likewise for fields "last_scheduled_insn", "nonscheduled_insns_begin". (save_backtrack_point): Update for change to field "vec" of struct ready_list. (toggle_cancelled_flags): Strengthen local "first" from rtx * to rtx_insn **. (restore_last_backtrack_point): Likewise. Strengthen local "insn" from rtx to rtx_insn * (resolve_dependencies): Strengthen param "insn" from rtx to rtx_insn * (restore_other_notes): Likewise for return type, for param "head" and local "note_head". (undo_all_replacements): Likewise for local "insn". (first_nonscheduled_insn): Likewise for return type and local "insn". (queue_to_ready): Likewise for local "insn", adding checked casts. (early_queue_to_ready): Likewise for local "insn". (debug_ready_list_1): Strengthen local "p" from rtx * to rtx_insn **. (move_insn): Strengthen param "insn" and local "note" from rtx to rtx_insn * (insn_finishes_cycle_p): Likewise for param "insn". (max_issue): Likewise for local "insn". (choose_ready): Likewise. Strengthen param "insn_ptr" from rtx * to rtx_insn **. (commit_schedule): Strengthen param "prev_head" and local "insn" from rtx to rtx_insn * (prune_ready_list): Likewise for local "insn". (schedule_block): Likewise for locals "prev_head", "head", "tail", "skip_insn", "insn", "failed_insn", "x", adding a checked cast. (set_priorities): Likewise for local "prev_head". (try_ready): Likewise for param "next". (fix_tick_ready): Likewise. (change_queue_index): Likewise. (sched_extend_ready_list): Update for change to field "vec" of struct ready_list. (generate_recovery_code): Strengthen param "insn" from rtx to rtx_insn *. (begin_speculative_block): Likewise. (create_check_block_twin): Likewise for param "insn" and locals "label", "check", "twin". Introduce local "check_pat" to avoid "check" being used as a plain rtx before being used as an insn. (fix_recovery_deps): Add a checked cast to rtx_insn * when extracting elements from ready_list. (sched_remove_insn): Strengthen param "insn" from rtx to rtx_insn *. (sched_emit_insn): Likewise for return type. (ready_remove_first_dispatch): Likewise for return type and local "insn". * hw-doloop.c (discover_loop): Add a checked cast to rtx_insn *. * modulo-sched.c (sms_print_insn): Strengthen from const_rtx to const rtx_insn *. * sched-deps.c (add_dependence): Strengthen params "con", "pro" from rtx to rtx_insn *. (add_dependence_list): Likewise for param "insn". Add a checked cast. (add_dependence_list_and_free): Strengthen param "insn" from rtx to rtx_insn *. Strengthen param "list_p" from rtx * to rtx_insn **. (chain_to_prev_insn): Strengthen param "insn" and locals "prec_nonnote", "i" from rtx to rtx_insn *. (flush_pending_lists): Likewise for param "insn". (cur_insn): Likewise for this variable. (haifa_start_insn): Add a checked cast. (note_dep): Strengthen param "e" from rtx to rtx_insn *. (sched_analyze_reg): Likewise for param "insn". (sched_analyze_1): Likewise. (sched_analyze_2): Likewise. Add checked casts. (sched_analyze_insn): Likewise. Also for local "prev". (deps_analyze_insn): Likewise for param "insn". (sched_analyze): Likewise for params "head", "tail" and local "insn". (add_dependence_1): Likewise for params "insn", "elem". (struct mem_inc_info): Likewise for fields "inc_insn", "mem_insn". (parse_add_or_inc): Likewise for param "insn". (find_inc): Likewise for local "inc_cand". (find_modifiable_mems): Likewise for params "head", "tail" and locals "insn", "next_tail". * sched-ebb.c (init_ready_list): Likewise for local "insn". (begin_schedule_ready): Likewise for param "insn". (begin_move_insn): Likewise for params "insn" and "last". (ebb_print_insn): Strengthen param "insn" from const_rtx to const rtx_insn *. (rank): Strengthen params "insn1", "insn2" from rtx to rtx_insn *. (ebb_contributes_to_priority): Likewise for params "next", "insn". (ebb_add_remove_insn): Likewise for param "insn". (advance_target_bb): Likewise. * sched-rgn.c (rgn_estimate_number_of_insns): Likewise for local "insn". (check_live): Likewise for param "insn". (init_ready_list): Likewise for local "insn". (can_schedule_ready_p): Likewise for param "insn". (begin_schedule_ready): Likewise. (new_ready): Likewise for param "next". (rgn_print_insn): Likewise for param "insn". (rgn_rank): Likewise for params "insn1", "insn2". (contributes_to_priority): Likewise for params "next", "insn". (rgn_insn_finishes_block_p): Likewise for param "insn". (add_branch_dependences): Likewise for params "head", "tail" and locals "insn", "last". (rgn_add_remove_insn): Likewise for param "insn". (advance_target_bb): Likewise. * sel-sched-dump.c (sel_print_insn): Strengthen param "insn" from const_rtx to const rtx_insn *. * sel-sched-dump.h (sel_print_insn): Likewise. * sel-sched-ir.c (advance_deps_context): Add a checked cast. (deps_init_id): Likewise. * sel-sched.c (convert_vec_av_set_to_ready): Likewise. (invoke_reorder_hooks): Strengthen local "arr" from rtx * to rtx_insn **. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214481 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-rgn.c')
-rw-r--r--gcc/sched-rgn.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index fc8378b97f6..f346816ef92 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -236,7 +236,7 @@ static int is_exception_free (rtx, int, int);
static bool sets_likely_spilled (rtx);
static void sets_likely_spilled_1 (rtx, const_rtx, void *);
-static void add_branch_dependences (rtx, rtx);
+static void add_branch_dependences (rtx_insn *, rtx_insn *);
static void compute_block_dependences (int);
static void schedule_region (int);
@@ -540,7 +540,7 @@ rgn_estimate_number_of_insns (basic_block bb)
if (MAY_HAVE_DEBUG_INSNS)
{
- rtx insn;
+ rtx_insn *insn;
FOR_BB_INSNS (bb, insn)
if (DEBUG_INSN_P (insn))
@@ -1804,7 +1804,7 @@ update_live_1 (int src, rtx x)
ready-list or before the scheduling. */
static int
-check_live (rtx insn, int src)
+check_live (rtx_insn *insn, int src)
{
/* Find the registers set by instruction. */
if (GET_CODE (PATTERN (insn)) == SET
@@ -2078,19 +2078,19 @@ static int sched_n_insns;
/* Implementations of the sched_info functions for region scheduling. */
static void init_ready_list (void);
-static int can_schedule_ready_p (rtx);
-static void begin_schedule_ready (rtx);
-static ds_t new_ready (rtx, ds_t);
+static int can_schedule_ready_p (rtx_insn *);
+static void begin_schedule_ready (rtx_insn *);
+static ds_t new_ready (rtx_insn *, ds_t);
static int schedule_more_p (void);
-static const char *rgn_print_insn (const_rtx, int);
-static int rgn_rank (rtx, rtx);
+static const char *rgn_print_insn (const rtx_insn *, int);
+static int rgn_rank (rtx_insn *, rtx_insn *);
static void compute_jump_reg_dependencies (rtx, regset);
/* Functions for speculative scheduling. */
-static void rgn_add_remove_insn (rtx, int);
+static void rgn_add_remove_insn (rtx_insn *, int);
static void rgn_add_block (basic_block, basic_block);
static void rgn_fix_recovery_cfg (int, int, int);
-static basic_block advance_target_bb (basic_block, rtx);
+static basic_block advance_target_bb (basic_block, rtx_insn *);
/* Return nonzero if there are more insns that should be scheduled. */
@@ -2109,7 +2109,7 @@ init_ready_list (void)
rtx prev_head = current_sched_info->prev_head;
rtx next_tail = current_sched_info->next_tail;
int bb_src;
- rtx insn;
+ rtx_insn *insn;
target_n_insns = 0;
sched_target_n_insns = 0;
@@ -2164,7 +2164,7 @@ init_ready_list (void)
insn can be scheduled, nonzero if we should silently discard it. */
static int
-can_schedule_ready_p (rtx insn)
+can_schedule_ready_p (rtx_insn *insn)
{
/* An interblock motion? */
if (INSN_BB (insn) != target_bb
@@ -2180,7 +2180,7 @@ can_schedule_ready_p (rtx insn)
can_schedule_ready_p () differs from the one passed to
begin_schedule_ready (). */
static void
-begin_schedule_ready (rtx insn)
+begin_schedule_ready (rtx_insn *insn)
{
/* An interblock motion? */
if (INSN_BB (insn) != target_bb)
@@ -2212,7 +2212,7 @@ begin_schedule_ready (rtx insn)
Return nonzero if it should be moved to the ready list or the queue, or zero
if we should silently discard it. */
static ds_t
-new_ready (rtx next, ds_t ts)
+new_ready (rtx_insn *next, ds_t ts)
{
if (INSN_BB (next) != target_bb)
{
@@ -2265,7 +2265,7 @@ new_ready (rtx next, ds_t ts)
to be formatted so that multiple output lines will line up nicely. */
static const char *
-rgn_print_insn (const_rtx insn, int aligned)
+rgn_print_insn (const rtx_insn *insn, int aligned)
{
static char tmp[80];
@@ -2286,7 +2286,7 @@ rgn_print_insn (const_rtx insn, int aligned)
is to be preferred. Zero if they are equally good. */
static int
-rgn_rank (rtx insn1, rtx insn2)
+rgn_rank (rtx_insn *insn1, rtx_insn *insn2)
{
/* Some comparison make sense in interblock scheduling only. */
if (INSN_BB (insn1) != INSN_BB (insn2))
@@ -2317,7 +2317,7 @@ rgn_rank (rtx insn1, rtx insn2)
calculations. */
int
-contributes_to_priority (rtx next, rtx insn)
+contributes_to_priority (rtx_insn *next, rtx_insn *insn)
{
/* NEXT and INSN reside in one ebb. */
return BLOCK_TO_BB (BLOCK_NUM (next)) == BLOCK_TO_BB (BLOCK_NUM (insn));
@@ -2363,7 +2363,7 @@ static const struct sched_deps_info_def rgn_const_sel_sched_deps_info =
/* Return true if scheduling INSN will trigger finish of scheduling
current block. */
static bool
-rgn_insn_finishes_block_p (rtx insn)
+rgn_insn_finishes_block_p (rtx_insn *insn)
{
if (INSN_BB (insn) == target_bb
&& sched_target_n_insns + 1 == target_n_insns)
@@ -2440,9 +2440,9 @@ static sbitmap insn_referenced;
/* Add dependences so that branches are scheduled to run last in their
block. */
static void
-add_branch_dependences (rtx head, rtx tail)
+add_branch_dependences (rtx_insn *head, rtx_insn *tail)
{
- rtx insn, last;
+ rtx_insn *insn, *last;
/* For all branches, calls, uses, clobbers, cc0 setters, and instructions
that can throw exceptions, force them to remain in order at the end of
@@ -3425,7 +3425,7 @@ schedule_insns (void)
/* INSN has been added to/removed from current region. */
static void
-rgn_add_remove_insn (rtx insn, int remove_p)
+rgn_add_remove_insn (rtx_insn *insn, int remove_p)
{
if (!remove_p)
rgn_n_insns++;
@@ -3580,7 +3580,7 @@ rgn_fix_recovery_cfg (int bbi, int check_bbi, int check_bb_nexti)
/* Return next block in ebb chain. For parameter meaning please refer to
sched-int.h: struct sched_info: advance_target_bb. */
static basic_block
-advance_target_bb (basic_block bb, rtx insn)
+advance_target_bb (basic_block bb, rtx_insn *insn)
{
if (insn)
return 0;