Commit 66fcd40c by David Malcolm Committed by David Malcolm

sched-ebb.c: Use rtx_insn (requires touching sched-int.h and config/c6x/c6x.c)

gcc/
2014-08-22  David Malcolm  <dmalcolm@redhat.com>

	* sched-int.h (schedule_ebb): Strengthen params "head", "tail"
	from rtx to rtx_insn *.

	* sched-ebb.c (earliest_block_with_similiar_load): Strengthen
	locals "insn1", "insn2" from rtx to rtx_insn *.
	(add_deps_for_risky_insns): Likewise for params "head", "tail" and
	locals "insn", "prev", "last_jump", "next_tail".
	(schedule_ebb): Likewise for params "head", "tail".
	(schedule_ebbs): Likewise for locals "tail", "head".

	* config/c6x/c6x.c (hwloop_optimize): For now, add a checked cast
	to rtx_insn on "last_insn" in one of the invocations of
	schedule_ebb.

From-SVN: r214375
parent 974c43e9
2014-08-22 David Malcolm <dmalcolm@redhat.com> 2014-08-22 David Malcolm <dmalcolm@redhat.com>
* sched-int.h (schedule_ebb): Strengthen params "head", "tail"
from rtx to rtx_insn *.
* sched-ebb.c (earliest_block_with_similiar_load): Strengthen
locals "insn1", "insn2" from rtx to rtx_insn *.
(add_deps_for_risky_insns): Likewise for params "head", "tail" and
locals "insn", "prev", "last_jump", "next_tail".
(schedule_ebb): Likewise for params "head", "tail".
(schedule_ebbs): Likewise for locals "tail", "head".
* config/c6x/c6x.c (hwloop_optimize): For now, add a checked cast
to rtx_insn on "last_insn" in one of the invocations of
schedule_ebb.
2014-08-22 David Malcolm <dmalcolm@redhat.com>
* sched-deps.c (maybe_add_or_update_dep_1): Strengthen locals * sched-deps.c (maybe_add_or_update_dep_1): Strengthen locals
"elem", "insn" from rtx to rtx_insn *. "elem", "insn" from rtx to rtx_insn *.
(change_spec_dep_to_hard): Likewise. (change_spec_dep_to_hard): Likewise.
......
...@@ -5669,7 +5669,9 @@ hwloop_optimize (hwloop_info loop) ...@@ -5669,7 +5669,9 @@ hwloop_optimize (hwloop_info loop)
schedule_ebbs_init (); schedule_ebbs_init ();
set_modulo_params (sp_ii, max_parallel, n_real_insns, set_modulo_params (sp_ii, max_parallel, n_real_insns,
sploop_max_uid_iter0); sploop_max_uid_iter0);
tmp_bb = schedule_ebb (BB_HEAD (bb), last_insn, true); tmp_bb = schedule_ebb (BB_HEAD (bb),
safe_as_a <rtx_insn *> (last_insn),
true);
schedule_ebbs_finish (); schedule_ebbs_finish ();
if (tmp_bb) if (tmp_bb)
......
...@@ -61,7 +61,7 @@ static const char *ebb_print_insn (const_rtx, int); ...@@ -61,7 +61,7 @@ static const char *ebb_print_insn (const_rtx, int);
static int rank (rtx, rtx); static int rank (rtx, rtx);
static int ebb_contributes_to_priority (rtx, rtx); static int ebb_contributes_to_priority (rtx, rtx);
static basic_block earliest_block_with_similiar_load (basic_block, rtx); static basic_block earliest_block_with_similiar_load (basic_block, rtx);
static void add_deps_for_risky_insns (rtx, rtx); static void add_deps_for_risky_insns (rtx_insn *, rtx_insn *);
static void debug_ebb_dependencies (rtx, rtx); static void debug_ebb_dependencies (rtx, rtx);
static void ebb_add_remove_insn (rtx, int); static void ebb_add_remove_insn (rtx, int);
...@@ -338,7 +338,7 @@ earliest_block_with_similiar_load (basic_block last_block, rtx load_insn) ...@@ -338,7 +338,7 @@ earliest_block_with_similiar_load (basic_block last_block, rtx load_insn)
FOR_EACH_DEP (load_insn, SD_LIST_BACK, back_sd_it, back_dep) FOR_EACH_DEP (load_insn, SD_LIST_BACK, back_sd_it, back_dep)
{ {
rtx insn1 = DEP_PRO (back_dep); rtx_insn *insn1 = DEP_PRO (back_dep);
if (DEP_TYPE (back_dep) == REG_DEP_TRUE) if (DEP_TYPE (back_dep) == REG_DEP_TRUE)
/* Found a DEF-USE dependence (insn1, load_insn). */ /* Found a DEF-USE dependence (insn1, load_insn). */
...@@ -348,7 +348,7 @@ earliest_block_with_similiar_load (basic_block last_block, rtx load_insn) ...@@ -348,7 +348,7 @@ earliest_block_with_similiar_load (basic_block last_block, rtx load_insn)
FOR_EACH_DEP (insn1, SD_LIST_FORW, fore_sd_it, fore_dep) FOR_EACH_DEP (insn1, SD_LIST_FORW, fore_sd_it, fore_dep)
{ {
rtx insn2 = DEP_CON (fore_dep); rtx_insn *insn2 = DEP_CON (fore_dep);
basic_block insn2_block = BLOCK_FOR_INSN (insn2); basic_block insn2_block = BLOCK_FOR_INSN (insn2);
if (DEP_TYPE (fore_dep) == REG_DEP_TRUE) if (DEP_TYPE (fore_dep) == REG_DEP_TRUE)
...@@ -381,12 +381,12 @@ earliest_block_with_similiar_load (basic_block last_block, rtx load_insn) ...@@ -381,12 +381,12 @@ earliest_block_with_similiar_load (basic_block last_block, rtx load_insn)
insns in given ebb. */ insns in given ebb. */
static void static void
add_deps_for_risky_insns (rtx head, rtx tail) add_deps_for_risky_insns (rtx_insn *head, rtx_insn *tail)
{ {
rtx insn, prev; rtx_insn *insn, *prev;
int classification; int classification;
rtx last_jump = NULL_RTX; rtx_insn *last_jump = NULL;
rtx next_tail = NEXT_INSN (tail); rtx_insn *next_tail = NEXT_INSN (tail);
basic_block last_block = NULL, bb; basic_block last_block = NULL, bb;
for (insn = head; insn != next_tail; insn = NEXT_INSN (insn)) for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
...@@ -477,7 +477,7 @@ add_deps_for_risky_insns (rtx head, rtx tail) ...@@ -477,7 +477,7 @@ add_deps_for_risky_insns (rtx head, rtx tail)
NULL_RTX. */ NULL_RTX. */
basic_block basic_block
schedule_ebb (rtx head, rtx tail, bool modulo_scheduling) schedule_ebb (rtx_insn *head, rtx_insn *tail, bool modulo_scheduling)
{ {
basic_block first_bb, target_bb; basic_block first_bb, target_bb;
struct deps_desc tmp_deps; struct deps_desc tmp_deps;
...@@ -621,7 +621,7 @@ schedule_ebbs (void) ...@@ -621,7 +621,7 @@ schedule_ebbs (void)
{ {
basic_block bb; basic_block bb;
int probability_cutoff; int probability_cutoff;
rtx tail; rtx_insn *tail;
/* Taking care of this degenerate case makes the rest of /* Taking care of this degenerate case makes the rest of
this code simpler. */ this code simpler. */
...@@ -639,7 +639,7 @@ schedule_ebbs (void) ...@@ -639,7 +639,7 @@ schedule_ebbs (void)
/* Schedule every region in the subroutine. */ /* Schedule every region in the subroutine. */
FOR_EACH_BB_FN (bb, cfun) FOR_EACH_BB_FN (bb, cfun)
{ {
rtx head = BB_HEAD (bb); rtx_insn *head = BB_HEAD (bb);
if (bb->flags & BB_DISABLE_SCHEDULE) if (bb->flags & BB_DISABLE_SCHEDULE)
continue; continue;
......
...@@ -1377,7 +1377,7 @@ extern int number_in_ready (void); ...@@ -1377,7 +1377,7 @@ extern int number_in_ready (void);
/* Types and functions in sched-ebb.c. */ /* Types and functions in sched-ebb.c. */
extern basic_block schedule_ebb (rtx, rtx, bool); extern basic_block schedule_ebb (rtx_insn *, rtx_insn *, bool);
extern void schedule_ebbs_init (void); extern void schedule_ebbs_init (void);
extern void schedule_ebbs_finish (void); extern void schedule_ebbs_finish (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