Commit f57aa6b0 by David Malcolm Committed by David Malcolm

Various scheduling strengthenings

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

	* sched-int.h (sched_init_insn_luid): Strengthen param 1 from rtx
	to rtx_insn *.
	(struct reg_use_data): Likewise for field "insn".
	(insn_cost): Likewise for param.
	(real_insn_for_shadow): Likewise for return type and param.
	(increase_insn_priority): Likewise for param 1.
	(debug_dependencies): Likewise for both params.

	* haifa-sched.c (insn_delay): Likewise for param "insn".
	(real_insn_for_shadow): Likewise for return type and param "insn".
	(update_insn_after_change): Likewise for param "insn".
	(recompute_todo_spec): Likewise for param "next" and locals "pro",
	"other".
	(insn_cost): Likewise for param "insn".
	(increase_insn_priority): Likewise.
	(calculate_reg_deaths): Likewise.
	(setup_insn_reg_pressure_info): Likewise.
	(model_schedule): Strengthen from vec<rtx> to vec<rtx_insn *>.
	(model_index): Strengthen param "insn" from rtx to rtx_insn *.
	(model_recompute): Likewise.
	(must_restore_pattern_p): Likewise for param "next".
	(model_excess_cost): Likewise for param "insn".
	(queue_remove): Likewise.
	(adjust_priority): Likewise for param "prev".
	(update_register_pressure): Likewise for param "insn".
	(setup_insn_max_reg_pressure): Likewise for local "insn".
	(update_reg_and_insn_max_reg_pressure): Likewise for param "insn".
	(model_add_to_schedule): Likewise.
	(model_reset_queue_indices): Likewise for local "insn".
	(unschedule_insns_until): Strengthen local "recompute_vec" from
	auto_vec<rtx> to auto_vec<rtx_insn *>.  Strengthen locals "last",
	"con" from rtx to rtx_insn *.
	(restore_last_backtrack_point): Likewise for both locals "x". Add
	checked casts.
	(estimate_insn_tick): Likewise for param "insn".
	(commit_schedule): Likewise for params "prev_head", "tail" and
	local "x".
	(verify_shadows): Likewise for locals "i1", "i2".
	(dump_insn_stream): Likewise for params "head", "tail" and locals
	"next_tail", "insn".
	(schedule_block): Likewise for locals "insn", "x".  Add a checked
	cast.
	(fix_inter_tick): Likewise for params "head", "tail".
	(create_check_block_twin): Likewise for local "jump".
	(haifa_change_pattern): Likewise for param "insn".
	(haifa_speculate_insn): Likewise.
	(dump_new_block_header): Likewise for params "head", "tail".
	(fix_jump_move): Likewise for param "jump".
	(move_block_after_check): Likewise.
	(sched_init_insn_luid): Likewise for param "insn".
	(sched_init_luids): Likewise for local "insn".
	(insn_luid): Likewise for param "insn".
	(init_h_i_d): Likewise.
	(haifa_init_h_i_d): Likewise for local "insn".
	(haifa_init_insn): Likewise for param "insn".
	* sched-deps.c (add_dependence): Likewise for local "real_pro",
	"other".
	(create_insn_reg_use): Likewise for param "insn".
	(setup_insn_reg_uses): Likewise.  Add a checked cast.
	* sched-ebb.c (debug_ebb_dependencies): Strengthen params "head",
	"tail" from rtx to rtx_insn *.
	* sched-rgn.c (void debug_dependencies): Likewise, also for locals
	"insn", "next_tail".

From-SVN: r214547
parent 40a243d4
2014-08-26 David Malcolm <dmalcolm@redhat.com>
* sched-int.h (sched_init_insn_luid): Strengthen param 1 from rtx
to rtx_insn *.
(struct reg_use_data): Likewise for field "insn".
(insn_cost): Likewise for param.
(real_insn_for_shadow): Likewise for return type and param.
(increase_insn_priority): Likewise for param 1.
(debug_dependencies): Likewise for both params.
* haifa-sched.c (insn_delay): Likewise for param "insn".
(real_insn_for_shadow): Likewise for return type and param "insn".
(update_insn_after_change): Likewise for param "insn".
(recompute_todo_spec): Likewise for param "next" and locals "pro",
"other".
(insn_cost): Likewise for param "insn".
(increase_insn_priority): Likewise.
(calculate_reg_deaths): Likewise.
(setup_insn_reg_pressure_info): Likewise.
(model_schedule): Strengthen from vec<rtx> to vec<rtx_insn *>.
(model_index): Strengthen param "insn" from rtx to rtx_insn *.
(model_recompute): Likewise.
(must_restore_pattern_p): Likewise for param "next".
(model_excess_cost): Likewise for param "insn".
(queue_remove): Likewise.
(adjust_priority): Likewise for param "prev".
(update_register_pressure): Likewise for param "insn".
(setup_insn_max_reg_pressure): Likewise for local "insn".
(update_reg_and_insn_max_reg_pressure): Likewise for param "insn".
(model_add_to_schedule): Likewise.
(model_reset_queue_indices): Likewise for local "insn".
(unschedule_insns_until): Strengthen local "recompute_vec" from
auto_vec<rtx> to auto_vec<rtx_insn *>. Strengthen locals "last",
"con" from rtx to rtx_insn *.
(restore_last_backtrack_point): Likewise for both locals "x". Add
checked casts.
(estimate_insn_tick): Likewise for param "insn".
(commit_schedule): Likewise for params "prev_head", "tail" and
local "x".
(verify_shadows): Likewise for locals "i1", "i2".
(dump_insn_stream): Likewise for params "head", "tail" and locals
"next_tail", "insn".
(schedule_block): Likewise for locals "insn", "x". Add a checked
cast.
(fix_inter_tick): Likewise for params "head", "tail".
(create_check_block_twin): Likewise for local "jump".
(haifa_change_pattern): Likewise for param "insn".
(haifa_speculate_insn): Likewise.
(dump_new_block_header): Likewise for params "head", "tail".
(fix_jump_move): Likewise for param "jump".
(move_block_after_check): Likewise.
(sched_init_insn_luid): Likewise for param "insn".
(sched_init_luids): Likewise for local "insn".
(insn_luid): Likewise for param "insn".
(init_h_i_d): Likewise.
(haifa_init_h_i_d): Likewise for local "insn".
(haifa_init_insn): Likewise for param "insn".
* sched-deps.c (add_dependence): Likewise for local "real_pro",
"other".
(create_insn_reg_use): Likewise for param "insn".
(setup_insn_reg_uses): Likewise. Add a checked cast.
* sched-ebb.c (debug_ebb_dependencies): Strengthen params "head",
"tail" from rtx to rtx_insn *.
* sched-rgn.c (void debug_dependencies): Likewise, also for locals
"insn", "next_tail".
2014-08-26 David Malcolm <dmalcolm@redhat.com>
* haifa-sched.c (struct model_insn_info): Strengthen field "insn"
from rtx to rtx_insn *.
(model_add_to_schedule): Likewise for locals "start", "end",
......
......@@ -1524,8 +1524,8 @@ add_dependence (rtx_insn *con, rtx_insn *pro, enum reg_note dep_type)
condition. */
if (dep_type == REG_DEP_CONTROL)
{
rtx real_pro = pro;
rtx other = real_insn_for_shadow (real_pro);
rtx_insn *real_pro = pro;
rtx_insn *other = real_insn_for_shadow (real_pro);
rtx cond;
if (other != NULL_RTX)
......@@ -1926,7 +1926,7 @@ ds_to_dt (ds_t ds)
/* Allocate and return reg_use_data structure for REGNO and INSN. */
static struct reg_use_data *
create_insn_reg_use (int regno, rtx insn)
create_insn_reg_use (int regno, rtx_insn *insn)
{
struct reg_use_data *use;
......@@ -1953,7 +1953,7 @@ create_insn_reg_set (int regno, rtx insn)
/* Set up insn register uses for INSN and dependency context DEPS. */
static void
setup_insn_reg_uses (struct deps_desc *deps, rtx insn)
setup_insn_reg_uses (struct deps_desc *deps, rtx_insn *insn)
{
unsigned i;
reg_set_iterator rsi;
......@@ -1980,7 +1980,7 @@ setup_insn_reg_uses (struct deps_desc *deps, rtx insn)
/* Create the cycle list of uses. */
for (list = reg_last->uses; list; list = XEXP (list, 1))
{
use2 = create_insn_reg_use (i, XEXP (list, 0));
use2 = create_insn_reg_use (i, as_a <rtx_insn *> (XEXP (list, 0)));
next = use->next_regno_use;
use->next_regno_use = use2;
use2->next_regno_use = next;
......
......@@ -62,7 +62,7 @@ static int rank (rtx_insn *, rtx_insn *);
static int ebb_contributes_to_priority (rtx_insn *, rtx_insn *);
static basic_block earliest_block_with_similiar_load (basic_block, 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_insn *, rtx_insn *);
static void ebb_add_remove_insn (rtx_insn *, int);
static void ebb_add_block (basic_block, basic_block);
......@@ -98,7 +98,7 @@ schedule_more_p (void)
/* Print dependency information about ebb between HEAD and TAIL. */
static void
debug_ebb_dependencies (rtx head, rtx tail)
debug_ebb_dependencies (rtx_insn *head, rtx_insn *tail)
{
fprintf (sched_dump,
";; --------------- forward dependences: ------------ \n");
......
......@@ -47,7 +47,7 @@ typedef vec<rtx_insn *> rtx_vec_t;
extern void sched_init_bbs (void);
extern void sched_extend_luids (void);
extern void sched_init_insn_luid (rtx);
extern void sched_init_insn_luid (rtx_insn *);
extern void sched_init_luids (bb_vec_t);
extern void sched_finish_luids (void);
......@@ -774,7 +774,7 @@ struct reg_use_data
/* Regno used in the insn. */
int regno;
/* Insn using the regno. */
rtx insn;
rtx_insn *insn;
/* Cyclic list of elements with the same regno. */
struct reg_use_data *next_regno_use;
/* List of elements with the same insn. */
......@@ -1344,7 +1344,7 @@ extern void get_ebb_head_tail (basic_block, basic_block,
rtx_insn **, rtx_insn **);
extern int no_real_insns_p (const_rtx, const_rtx);
extern int insn_cost (rtx);
extern int insn_cost (rtx_insn *);
extern int dep_cost_1 (dep_t, dw_t);
extern int dep_cost (dep_t);
extern int set_priorities (rtx_insn *, rtx_insn *);
......@@ -1430,7 +1430,7 @@ extern bool sched_no_dce;
extern void set_modulo_params (int, int, int, int);
extern void record_delay_slot_pair (rtx_insn *, rtx_insn *, int, int);
extern rtx real_insn_for_shadow (rtx);
extern rtx_insn *real_insn_for_shadow (rtx_insn *);
extern void discard_delay_pairs_above (int);
extern void free_delay_pairs (void);
extern void add_delay_dependencies (rtx_insn *);
......@@ -1446,9 +1446,9 @@ extern void extend_regions (void);
extern void rgn_make_new_region_out_of_new_block (basic_block);
extern void compute_priorities (void);
extern void increase_insn_priority (rtx, int);
extern void increase_insn_priority (rtx_insn *, int);
extern void debug_rgn_dependencies (int);
extern void debug_dependencies (rtx, rtx);
extern void debug_dependencies (rtx_insn *, rtx_insn *);
extern void free_rgn_deps (void);
extern int contributes_to_priority (rtx_insn *, rtx_insn *);
extern void extend_rgns (int *, int *, sbitmap, int *);
......
......@@ -2806,10 +2806,10 @@ debug_rgn_dependencies (int from_bb)
/* Print dependencies information for instructions between HEAD and TAIL.
??? This function would probably fit best in haifa-sched.c. */
void debug_dependencies (rtx head, rtx tail)
void debug_dependencies (rtx_insn *head, rtx_insn *tail)
{
rtx insn;
rtx next_tail = NEXT_INSN (tail);
rtx_insn *insn;
rtx_insn *next_tail = NEXT_INSN (tail);
fprintf (sched_dump, ";; %7s%6s%6s%6s%6s%6s%14s\n",
"insn", "code", "bb", "dep", "prio", "cost",
......
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