From: David Malcolm Date: Fri, 5 Sep 2014 14:55:53 +0000 (+0000) Subject: Use rtx_insn_list within haifa-sched.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96b7041496d08ec15ac4eec2632738023cfc7452;p=gcc.git Use rtx_insn_list within haifa-sched.c gcc/ChangeLog: 2014-09-05 David Malcolm * haifa-sched.c (check_clobbered_conditions): Strengthen local "link" from rtx to rtx_insn_list *, and use its methods for clarity and type-safety. (toggle_cancelled_flags): Likewise. (restore_last_backtrack_point): Likewise. (queue_to_ready): Use insn method of "link" in one place. (schedule_block): Strengthen local "link" from rtx to rtx_insn_list *, and use its methods for clarity and type-safety. From-SVN: r214968 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2e48eb76b91..e0eca46494b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2014-09-05 David Malcolm + + * haifa-sched.c (check_clobbered_conditions): Strengthen local + "link" from rtx to rtx_insn_list *, and use its methods for + clarity and type-safety. + (toggle_cancelled_flags): Likewise. + (restore_last_backtrack_point): Likewise. + (queue_to_ready): Use insn method of "link" in one place. + (schedule_block): Strengthen local "link" from rtx to + rtx_insn_list *, and use its methods for clarity and type-safety. + 2014-09-05 David Malcolm * sched-deps.c (sched_get_condition_with_rev_uncached): Strengthen diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 83ea5bd158f..fb92bb21739 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -3148,13 +3148,13 @@ check_clobbered_conditions (rtx insn) } for (i = 0; i <= max_insn_queue_index; i++) { - rtx link; + rtx_insn_list *link; int q = NEXT_Q_AFTER (q_ptr, i); restart_queue: - for (link = insn_queue[q]; link; link = XEXP (link, 1)) + for (link = insn_queue[q]; link; link = link->next ()) { - rtx_insn *x = as_a (XEXP (link, 0)); + rtx_insn *x = link->insn (); if (TODO_SPEC (x) == DEP_CONTROL && cond_clobbered_p (x, t)) { queue_remove (x); @@ -4239,10 +4239,10 @@ toggle_cancelled_flags (bool set) for (i = 0; i <= max_insn_queue_index; i++) { int q = NEXT_Q_AFTER (q_ptr, i); - rtx link; - for (link = insn_queue[q]; link; link = XEXP (link, 1)) + rtx_insn_list *link; + for (link = insn_queue[q]; link; link = link->next ()) { - rtx insn = XEXP (link, 0); + rtx_insn *insn = link->insn (); FOR_EACH_DEP (insn, SD_LIST_BACK, sd_it, dep) if (!DEBUG_INSN_P (DEP_PRO (dep))) { @@ -4349,7 +4349,6 @@ unschedule_insns_until (rtx insn) static void restore_last_backtrack_point (struct sched_block_state *psched_block) { - rtx link; int i; struct haifa_saved_data *save = backtrack_queue; @@ -4384,9 +4383,9 @@ restore_last_backtrack_point (struct sched_block_state *psched_block) { int q = NEXT_Q_AFTER (q_ptr, i); - for (link = insn_queue[q]; link; link = XEXP (link, 1)) + for (rtx_insn_list *link = insn_queue[q]; link; link = link->next ()) { - rtx_insn *x = as_a (XEXP (link, 0)); + rtx_insn *x = link->insn (); QUEUE_INDEX (x) = QUEUE_NOWHERE; INSN_TICK (x) = INVALID_TICK; } @@ -4416,9 +4415,9 @@ restore_last_backtrack_point (struct sched_block_state *psched_block) insn_queue[q] = save->insn_queue[q]; - for (link = insn_queue[q]; link; link = XEXP (link, 1)) + for (rtx_insn_list *link = insn_queue[q]; link; link = link->next ()) { - rtx_insn *x = as_a (XEXP (link, 0)); + rtx_insn *x = link->insn (); QUEUE_INDEX (x) = i; TODO_SPEC (x) = recompute_todo_spec (x, true); INSN_TICK (x) = save->clock_var + i; @@ -4991,7 +4990,7 @@ queue_to_ready (struct ready_list *ready) { for (; link; link = link->next ()) { - insn = as_a (XEXP (link, 0)); + insn = link->insn (); q_size -= 1; if (sched_verbose >= 2) @@ -6545,12 +6544,12 @@ schedule_block (basic_block *target_bb, state_t init_state) if (q_size) for (i = 0; i <= max_insn_queue_index; i++) { - rtx link; - for (link = insn_queue[i]; link; link = XEXP (link, 1)) + rtx_insn_list *link; + for (link = insn_queue[i]; link; link = link->next ()) { rtx_insn *x; - x = as_a (XEXP (link, 0)); + x = link->insn (); QUEUE_INDEX (x) = QUEUE_NOWHERE; TODO_SPEC (x) = HARD_DEP; }