Commit 0e0ce50d by David Malcolm Committed by David Malcolm

Remove DEP_PRO/CON scaffolding

gcc/
	* sched-int.h (struct _dep): Strengthen fields "pro" and "con"
	from rtx to rtx_insn *.
	(DEP_PRO): Delete this function and...
	(SET_DEP_PRO): ...this function in favor of...
	(DEP_PRO): ...reinstate this macro.
	(DEP_CON): Delete this function and...
	(SET_DEP_CON): ...this function in favor of...
	(DEP_CON): ...reinstate this old macro.
	(init_dep_1): Strengthen params 2 and 3 from rtx to rtx_insn *.
	(init_dep): Likewise.
	(set_priorities): Likewise for both params.
	(sd_copy_back_deps): Likewise for params 1 and 2.

	* haifa-sched.c (priority): Likewise for param "insn" and local
	"next".
	(set_priorities): Likewise for params "head" and "tail" and local
	"insn".
	(process_insn_forw_deps_be_in_spec): Likewise for param "twin" and
	local "consumer".
	(add_to_speculative_block): Add a checked cast.
	(create_check_block_twin): Drop use of SET_DEP_CON.
	(add_jump_dependencies): Strengthen params "insn" and "jump" from
	rtx to rtx_insn *.

	* sched-deps.c (init_dep_1): Likewise for params "pro" and "con".
	Drop use of SET_DEP_PRO
	(init_dep): Strengthen params "pro" and "con" from rtx to
	rtx_insn *.
	(sd_copy_back_deps): Likewise for params "to" and "from".  Drop
	use of SET_DEP_CON.
	(DEP_PRO): Delete.
	(DEP_CON): Delete.
	(SET_DEP_PRO): Delete.
	(SET_DEP_CON): Delete.

/
	* rtx-classes-status.txt (TODO): SET_DEP_PRO and SET_DEP_CON are
	done.

From-SVN: r214530
parent 3d30f4e8
2014-08-26 David Malcolm <dmalcolm@redhat.com> 2014-08-26 David Malcolm <dmalcolm@redhat.com>
* rtx-classes-status.txt (TODO): SET_DEP_PRO and SET_DEP_CON are
done.
2014-08-26 David Malcolm <dmalcolm@redhat.com>
* rtx-classes-status.txt (TODO): Remove SET_VINSN_INSN_RTX. * rtx-classes-status.txt (TODO): Remove SET_VINSN_INSN_RTX.
2014-08-26 David Malcolm <dmalcolm@redhat.com> 2014-08-26 David Malcolm <dmalcolm@redhat.com>
......
2014-08-26 David Malcolm <dmalcolm@redhat.com> 2014-08-26 David Malcolm <dmalcolm@redhat.com>
* sched-int.h (struct _dep): Strengthen fields "pro" and "con"
from rtx to rtx_insn *.
(DEP_PRO): Delete this function and...
(SET_DEP_PRO): ...this function in favor of...
(DEP_PRO): ...reinstate this macro.
(DEP_CON): Delete this function and...
(SET_DEP_CON): ...this function in favor of...
(DEP_CON): ...reinstate this old macro.
(init_dep_1): Strengthen params 2 and 3 from rtx to rtx_insn *.
(init_dep): Likewise.
(set_priorities): Likewise for both params.
(sd_copy_back_deps): Likewise for params 1 and 2.
* haifa-sched.c (priority): Likewise for param "insn" and local
"next".
(set_priorities): Likewise for params "head" and "tail" and local
"insn".
(process_insn_forw_deps_be_in_spec): Likewise for param "twin" and
local "consumer".
(add_to_speculative_block): Add a checked cast.
(create_check_block_twin): Drop use of SET_DEP_CON.
(add_jump_dependencies): Strengthen params "insn" and "jump" from
rtx to rtx_insn *.
* sched-deps.c (init_dep_1): Likewise for params "pro" and "con".
Drop use of SET_DEP_PRO
(init_dep): Strengthen params "pro" and "con" from rtx to
rtx_insn *.
(sd_copy_back_deps): Likewise for params "to" and "from". Drop
use of SET_DEP_CON.
(DEP_PRO): Delete.
(DEP_CON): Delete.
(SET_DEP_PRO): Delete.
(SET_DEP_CON): Delete.
2014-08-26 David Malcolm <dmalcolm@redhat.com>
* sel-sched-ir.h (struct vinsn_def): Strengthen field "insn_rtx" * sel-sched-ir.h (struct vinsn_def): Strengthen field "insn_rtx"
from rtx to rtx_insn *. from rtx to rtx_insn *.
(VINSN_INSN_RTX): Eliminate rvalue function and... (VINSN_INSN_RTX): Eliminate rvalue function and...
......
...@@ -826,7 +826,7 @@ add_delay_dependencies (rtx_insn *insn) ...@@ -826,7 +826,7 @@ add_delay_dependencies (rtx_insn *insn)
/* Forward declarations. */ /* Forward declarations. */
static int priority (rtx); static int priority (rtx_insn *);
static int rank_for_schedule (const void *, const void *); static int rank_for_schedule (const void *, const void *);
static void swap_sort (rtx_insn **, int); static void swap_sort (rtx_insn **, int);
static void queue_insn (rtx_insn *, int, const char *); static void queue_insn (rtx_insn *, int, const char *);
...@@ -875,7 +875,7 @@ static void extend_h_i_d (void); ...@@ -875,7 +875,7 @@ static void extend_h_i_d (void);
static void init_h_i_d (rtx); static void init_h_i_d (rtx);
static int haifa_speculate_insn (rtx, ds_t, rtx *); static int haifa_speculate_insn (rtx, ds_t, rtx *);
static void generate_recovery_code (rtx_insn *); static void generate_recovery_code (rtx_insn *);
static void process_insn_forw_deps_be_in_spec (rtx, rtx, ds_t); static void process_insn_forw_deps_be_in_spec (rtx, rtx_insn *, ds_t);
static void begin_speculative_block (rtx_insn *); static void begin_speculative_block (rtx_insn *);
static void add_to_speculative_block (rtx_insn *); static void add_to_speculative_block (rtx_insn *);
static void init_before_recovery (basic_block *); static void init_before_recovery (basic_block *);
...@@ -890,7 +890,7 @@ static void move_succs (vec<edge, va_gc> **, basic_block); ...@@ -890,7 +890,7 @@ static void move_succs (vec<edge, va_gc> **, basic_block);
static void sched_remove_insn (rtx_insn *); static void sched_remove_insn (rtx_insn *);
static void clear_priorities (rtx_insn *, rtx_vec_t *); static void clear_priorities (rtx_insn *, rtx_vec_t *);
static void calc_priorities (rtx_vec_t); static void calc_priorities (rtx_vec_t);
static void add_jump_dependencies (rtx, rtx); static void add_jump_dependencies (rtx_insn *, rtx_insn *);
#endif /* INSN_SCHEDULING */ #endif /* INSN_SCHEDULING */
...@@ -1582,7 +1582,7 @@ dep_list_size (rtx insn, sd_list_types_def list) ...@@ -1582,7 +1582,7 @@ dep_list_size (rtx insn, sd_list_types_def list)
/* Compute the priority number for INSN. */ /* Compute the priority number for INSN. */
static int static int
priority (rtx insn) priority (rtx_insn *insn)
{ {
if (! INSN_P (insn)) if (! INSN_P (insn))
return 0; return 0;
...@@ -1631,7 +1631,7 @@ priority (rtx insn) ...@@ -1631,7 +1631,7 @@ priority (rtx insn)
FOR_EACH_DEP (twin, SD_LIST_FORW, sd_it, dep) FOR_EACH_DEP (twin, SD_LIST_FORW, sd_it, dep)
{ {
rtx next; rtx_insn *next;
int next_priority; int next_priority;
next = DEP_CON (dep); next = DEP_CON (dep);
...@@ -6622,9 +6622,9 @@ schedule_block (basic_block *target_bb, state_t init_state) ...@@ -6622,9 +6622,9 @@ schedule_block (basic_block *target_bb, state_t init_state)
/* Set_priorities: compute priority of each insn in the block. */ /* Set_priorities: compute priority of each insn in the block. */
int int
set_priorities (rtx head, rtx tail) set_priorities (rtx_insn *head, rtx_insn *tail)
{ {
rtx insn; rtx_insn *insn;
int n_insn; int n_insn;
int sched_max_insns_priority = int sched_max_insns_priority =
current_sched_info->sched_max_insns_priority; current_sched_info->sched_max_insns_priority;
...@@ -7342,7 +7342,7 @@ generate_recovery_code (rtx_insn *insn) ...@@ -7342,7 +7342,7 @@ generate_recovery_code (rtx_insn *insn)
Tries to add speculative dependencies of type FS between instructions Tries to add speculative dependencies of type FS between instructions
in deps_list L and TWIN. */ in deps_list L and TWIN. */
static void static void
process_insn_forw_deps_be_in_spec (rtx insn, rtx twin, ds_t fs) process_insn_forw_deps_be_in_spec (rtx insn, rtx_insn *twin, ds_t fs)
{ {
sd_iterator_def sd_it; sd_iterator_def sd_it;
dep_t dep; dep_t dep;
...@@ -7350,7 +7350,7 @@ process_insn_forw_deps_be_in_spec (rtx insn, rtx twin, ds_t fs) ...@@ -7350,7 +7350,7 @@ process_insn_forw_deps_be_in_spec (rtx insn, rtx twin, ds_t fs)
FOR_EACH_DEP (insn, SD_LIST_FORW, sd_it, dep) FOR_EACH_DEP (insn, SD_LIST_FORW, sd_it, dep)
{ {
ds_t ds; ds_t ds;
rtx consumer; rtx_insn *consumer;
consumer = DEP_CON (dep); consumer = DEP_CON (dep);
...@@ -7540,7 +7540,7 @@ add_to_speculative_block (rtx_insn *insn) ...@@ -7540,7 +7540,7 @@ add_to_speculative_block (rtx_insn *insn)
{ {
dep_def _new_dep, *new_dep = &_new_dep; dep_def _new_dep, *new_dep = &_new_dep;
init_dep (new_dep, insn, twin, REG_DEP_OUTPUT); init_dep (new_dep, insn, as_a <rtx_insn *> (twin), REG_DEP_OUTPUT);
sd_add_dep (new_dep, false); sd_add_dep (new_dep, false);
} }
...@@ -7950,7 +7950,7 @@ create_check_block_twin (rtx_insn *insn, bool mutate_p) ...@@ -7950,7 +7950,7 @@ create_check_block_twin (rtx_insn *insn, bool mutate_p)
if (rec != EXIT_BLOCK_PTR_FOR_FN (cfun)) if (rec != EXIT_BLOCK_PTR_FOR_FN (cfun))
{ {
SET_DEP_CON (new_dep) = twin; DEP_CON (new_dep) = twin;
sd_add_dep (new_dep, false); sd_add_dep (new_dep, false);
} }
} }
...@@ -8429,7 +8429,7 @@ calc_priorities (rtx_vec_t roots) ...@@ -8429,7 +8429,7 @@ calc_priorities (rtx_vec_t roots)
/* Add dependences between JUMP and other instructions in the recovery /* Add dependences between JUMP and other instructions in the recovery
block. INSN is the first insn the recovery block. */ block. INSN is the first insn the recovery block. */
static void static void
add_jump_dependencies (rtx insn, rtx jump) add_jump_dependencies (rtx_insn *insn, rtx_insn *jump)
{ {
do do
{ {
......
...@@ -101,10 +101,10 @@ dk_to_ds (enum reg_note dk) ...@@ -101,10 +101,10 @@ dk_to_ds (enum reg_note dk)
/* Init DEP with the arguments. */ /* Init DEP with the arguments. */
void void
init_dep_1 (dep_t dep, rtx pro, rtx con, enum reg_note type, ds_t ds) init_dep_1 (dep_t dep, rtx_insn *pro, rtx_insn *con, enum reg_note type, ds_t ds)
{ {
SET_DEP_PRO (dep) = pro; DEP_PRO (dep) = pro;
SET_DEP_CON (dep) = con; DEP_CON (dep) = con;
DEP_TYPE (dep) = type; DEP_TYPE (dep) = type;
DEP_STATUS (dep) = ds; DEP_STATUS (dep) = ds;
DEP_COST (dep) = UNKNOWN_DEP_COST; DEP_COST (dep) = UNKNOWN_DEP_COST;
...@@ -117,7 +117,7 @@ init_dep_1 (dep_t dep, rtx pro, rtx con, enum reg_note type, ds_t ds) ...@@ -117,7 +117,7 @@ init_dep_1 (dep_t dep, rtx pro, rtx con, enum reg_note type, ds_t ds)
While most of the scheduler (including targets) only need the major type While most of the scheduler (including targets) only need the major type
of the dependency, it is convenient to hide full dep_status from them. */ of the dependency, it is convenient to hide full dep_status from them. */
void void
init_dep (dep_t dep, rtx pro, rtx con, enum reg_note kind) init_dep (dep_t dep, rtx_insn *pro, rtx_insn *con, enum reg_note kind)
{ {
ds_t ds; ds_t ds;
...@@ -1403,7 +1403,7 @@ sd_unresolve_dep (sd_iterator_def sd_it) ...@@ -1403,7 +1403,7 @@ sd_unresolve_dep (sd_iterator_def sd_it)
/* Make TO depend on all the FROM's producers. /* Make TO depend on all the FROM's producers.
If RESOLVED_P is true add dependencies to the resolved lists. */ If RESOLVED_P is true add dependencies to the resolved lists. */
void void
sd_copy_back_deps (rtx to, rtx from, bool resolved_p) sd_copy_back_deps (rtx_insn *to, rtx_insn *from, bool resolved_p)
{ {
sd_list_types_def list_type; sd_list_types_def list_type;
sd_iterator_def sd_it; sd_iterator_def sd_it;
...@@ -1416,7 +1416,7 @@ sd_copy_back_deps (rtx to, rtx from, bool resolved_p) ...@@ -1416,7 +1416,7 @@ sd_copy_back_deps (rtx to, rtx from, bool resolved_p)
dep_def _new_dep, *new_dep = &_new_dep; dep_def _new_dep, *new_dep = &_new_dep;
copy_dep (new_dep, dep); copy_dep (new_dep, dep);
SET_DEP_CON (new_dep) = to; DEP_CON (new_dep) = to;
sd_add_dep (new_dep, resolved_p); sd_add_dep (new_dep, resolved_p);
} }
} }
...@@ -4922,24 +4922,4 @@ find_modifiable_mems (rtx_insn *head, rtx_insn *tail) ...@@ -4922,24 +4922,4 @@ find_modifiable_mems (rtx_insn *head, rtx_insn *tail)
success_in_block); success_in_block);
} }
rtx_insn *DEP_PRO (dep_t dep)
{
return safe_as_a <rtx_insn *> (dep->pro);
}
rtx_insn *DEP_CON (dep_t dep)
{
return safe_as_a <rtx_insn *> (dep->con);
}
rtx& SET_DEP_PRO (dep_t dep)
{
return dep->pro;
}
rtx& SET_DEP_CON (dep_t dep)
{
return dep->con;
}
#endif /* INSN_SCHEDULING */ #endif /* INSN_SCHEDULING */
...@@ -218,10 +218,10 @@ struct dep_replacement ...@@ -218,10 +218,10 @@ struct dep_replacement
struct _dep struct _dep
{ {
/* Producer. */ /* Producer. */
rtx pro; rtx_insn *pro;
/* Consumer. */ /* Consumer. */
rtx con; rtx_insn *con;
/* If nonnull, holds a pointer to information about how to break the /* If nonnull, holds a pointer to information about how to break the
dependency by making a replacement in one of the insns. There is dependency by making a replacement in one of the insns. There is
...@@ -250,10 +250,8 @@ struct _dep ...@@ -250,10 +250,8 @@ struct _dep
typedef struct _dep dep_def; typedef struct _dep dep_def;
typedef dep_def *dep_t; typedef dep_def *dep_t;
extern rtx_insn *DEP_PRO (dep_t dep); #define DEP_PRO(D) ((D)->pro)
extern rtx_insn *DEP_CON (dep_t dep); #define DEP_CON(D) ((D)->con)
extern rtx& SET_DEP_PRO (dep_t dep);
extern rtx& SET_DEP_CON (dep_t dep);
#define DEP_TYPE(D) ((D)->type) #define DEP_TYPE(D) ((D)->type)
#define DEP_STATUS(D) ((D)->status) #define DEP_STATUS(D) ((D)->status)
#define DEP_COST(D) ((D)->cost) #define DEP_COST(D) ((D)->cost)
...@@ -263,8 +261,8 @@ extern rtx& SET_DEP_CON (dep_t dep); ...@@ -263,8 +261,8 @@ extern rtx& SET_DEP_CON (dep_t dep);
/* Functions to work with dep. */ /* Functions to work with dep. */
extern void init_dep_1 (dep_t, rtx, rtx, enum reg_note, ds_t); extern void init_dep_1 (dep_t, rtx_insn *, rtx_insn *, enum reg_note, ds_t);
extern void init_dep (dep_t, rtx, rtx, enum reg_note); extern void init_dep (dep_t, rtx_insn *, rtx_insn *, enum reg_note);
extern void sd_debug_dep (dep_t); extern void sd_debug_dep (dep_t);
...@@ -1349,7 +1347,7 @@ extern int no_real_insns_p (const_rtx, const_rtx); ...@@ -1349,7 +1347,7 @@ extern int no_real_insns_p (const_rtx, const_rtx);
extern int insn_cost (rtx); extern int insn_cost (rtx);
extern int dep_cost_1 (dep_t, dw_t); extern int dep_cost_1 (dep_t, dw_t);
extern int dep_cost (dep_t); extern int dep_cost (dep_t);
extern int set_priorities (rtx, rtx); extern int set_priorities (rtx_insn *, rtx_insn *);
extern void sched_setup_bb_reg_pressure_info (basic_block, rtx); extern void sched_setup_bb_reg_pressure_info (basic_block, rtx);
extern bool schedule_block (basic_block *, state_t); extern bool schedule_block (basic_block *, state_t);
...@@ -1615,7 +1613,7 @@ extern void sd_add_dep (dep_t, bool); ...@@ -1615,7 +1613,7 @@ extern void sd_add_dep (dep_t, bool);
extern enum DEPS_ADJUST_RESULT sd_add_or_update_dep (dep_t, bool); extern enum DEPS_ADJUST_RESULT sd_add_or_update_dep (dep_t, bool);
extern void sd_resolve_dep (sd_iterator_def); extern void sd_resolve_dep (sd_iterator_def);
extern void sd_unresolve_dep (sd_iterator_def); extern void sd_unresolve_dep (sd_iterator_def);
extern void sd_copy_back_deps (rtx, rtx, bool); extern void sd_copy_back_deps (rtx_insn *, rtx_insn *, bool);
extern void sd_delete_dep (sd_iterator_def); extern void sd_delete_dep (sd_iterator_def);
extern void sd_debug_lists (rtx, sd_list_types_def); extern void sd_debug_lists (rtx, sd_list_types_def);
......
...@@ -16,5 +16,4 @@ TODO: "Scaffolding" to be removed ...@@ -16,5 +16,4 @@ TODO: "Scaffolding" to be removed
================================= =================================
* DF_REF_INSN * DF_REF_INSN
* SET_BB_HEAD, SET_BB_END, SET_BB_HEADER * SET_BB_HEAD, SET_BB_END, SET_BB_HEADER
* SET_DEP_PRO, SET_DEP_CON
* SET_NEXT_INSN, SET_PREV_INSN * SET_NEXT_INSN, SET_PREV_INSN
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