+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.
+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"
\f
/* Forward declarations. */
-static int priority (rtx);
+static int priority (rtx_insn *);
static int rank_for_schedule (const void *, const void *);
static void swap_sort (rtx_insn **, int);
static void queue_insn (rtx_insn *, int, const char *);
static void init_h_i_d (rtx);
static int haifa_speculate_insn (rtx, ds_t, rtx *);
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 add_to_speculative_block (rtx_insn *);
static void init_before_recovery (basic_block *);
static void sched_remove_insn (rtx_insn *);
static void clear_priorities (rtx_insn *, 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 */
\f
/* Compute the priority number for INSN. */
static int
-priority (rtx insn)
+priority (rtx_insn *insn)
{
if (! INSN_P (insn))
return 0;
FOR_EACH_DEP (twin, SD_LIST_FORW, sd_it, dep)
{
- rtx next;
+ rtx_insn *next;
int next_priority;
next = DEP_CON (dep);
/* Set_priorities: compute priority of each insn in the block. */
int
-set_priorities (rtx head, rtx tail)
+set_priorities (rtx_insn *head, rtx_insn *tail)
{
- rtx insn;
+ rtx_insn *insn;
int n_insn;
int sched_max_insns_priority =
current_sched_info->sched_max_insns_priority;
Tries to add speculative dependencies of type FS between instructions
in deps_list L and TWIN. */
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;
dep_t dep;
FOR_EACH_DEP (insn, SD_LIST_FORW, sd_it, dep)
{
ds_t ds;
- rtx consumer;
+ rtx_insn *consumer;
consumer = DEP_CON (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);
}
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);
}
}
/* Add dependences between JUMP and other instructions in the recovery
block. INSN is the first insn the recovery block. */
static void
-add_jump_dependencies (rtx insn, rtx jump)
+add_jump_dependencies (rtx_insn *insn, rtx_insn *jump)
{
do
{
/* Init DEP with the arguments. */
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;
- SET_DEP_CON (dep) = con;
+ DEP_PRO (dep) = pro;
+ DEP_CON (dep) = con;
DEP_TYPE (dep) = type;
DEP_STATUS (dep) = ds;
DEP_COST (dep) = UNKNOWN_DEP_COST;
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. */
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;
/* Make TO depend on all the FROM's producers.
If RESOLVED_P is true add dependencies to the resolved lists. */
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_iterator_def sd_it;
dep_def _new_dep, *new_dep = &_new_dep;
copy_dep (new_dep, dep);
- SET_DEP_CON (new_dep) = to;
+ DEP_CON (new_dep) = to;
sd_add_dep (new_dep, resolved_p);
}
}
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 */
struct _dep
{
/* Producer. */
- rtx pro;
+ rtx_insn *pro;
/* Consumer. */
- rtx con;
+ rtx_insn *con;
/* If nonnull, holds a pointer to information about how to break the
dependency by making a replacement in one of the insns. There is
typedef struct _dep dep_def;
typedef dep_def *dep_t;
-extern rtx_insn *DEP_PRO (dep_t dep);
-extern rtx_insn *DEP_CON (dep_t dep);
-extern rtx& SET_DEP_PRO (dep_t dep);
-extern rtx& SET_DEP_CON (dep_t dep);
+#define DEP_PRO(D) ((D)->pro)
+#define DEP_CON(D) ((D)->con)
#define DEP_TYPE(D) ((D)->type)
#define DEP_STATUS(D) ((D)->status)
#define DEP_COST(D) ((D)->cost)
/* Functions to work with dep. */
-extern void init_dep_1 (dep_t, rtx, rtx, enum reg_note, ds_t);
-extern void init_dep (dep_t, rtx, rtx, enum reg_note);
+extern void init_dep_1 (dep_t, rtx_insn *, rtx_insn *, enum reg_note, ds_t);
+extern void init_dep (dep_t, rtx_insn *, rtx_insn *, enum reg_note);
extern void sd_debug_dep (dep_t);
extern int insn_cost (rtx);
extern int dep_cost_1 (dep_t, dw_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 bool schedule_block (basic_block *, state_t);
extern enum DEPS_ADJUST_RESULT sd_add_or_update_dep (dep_t, bool);
extern void sd_resolve_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_debug_lists (rtx, sd_list_types_def);
=================================
* DF_REF_INSN
* SET_BB_HEAD, SET_BB_END, SET_BB_HEADER
-* SET_DEP_PRO, SET_DEP_CON
* SET_NEXT_INSN, SET_PREV_INSN