Commit 06d7e8e7 by Bernd Schmidt Committed by Bernd Schmidt

haifa-sched.c (modulo_ii, [...]): New static variables.

	* haifa-sched.c (modulo_ii, modulo_max_states, modulo_n_insns,
	modulo_insns_scheduled, modulo_iter0_max_uid, modulo_backtracks_left,
	modulo_last_stage): New static variables.
	(set_modulo_params, discard_delay_pairs_above): New functions.
	(struct delay_pair): New member stages.
	(htab_i2_traverse, htab_i1_traverse): New static functions.
	(record_delay_slot_pair): New arg stages.  All callers changed.
	Record it.
	(pair_delay): Take stages into account.
	(add_delay_dependencies): Don't do so for stage pairs.
	(struct sched_block_state): New member modulo_epilogue.
	(save_backtrack_point): Don't set SHADOW_P for stage pairs.
	(unschedule_insns_until): Decrease modulo_insns_scheduled.
	Set HARD_DEP without using or.
	(resolve_dependencies): New static function.
	(prune_ready_list): New arg modulo_epilogue_p.  All callers changed.
	If it is true, allow only insns with INSN_EXACT_TICK set.
	(schedule_block): Return bool, always true for normal scheduling,
	true or false depending on modulo scheduling success otherwise.
	Add bookkeeping for modulo scheduling, and call resolve_dependencies
	on everything left over after a modulo schedule.
	(haifa_sched_init): Remove check_cfg call.  Clear modulo_ii.
	* sched-int.h (schedule_block, record_delay_slot_pair): Adjust
	declarations.
	(set_modulo_params, discard_delay_pairs_above): Declare.
	* params.def (PARAM_MAX_MODULO_BACKTRACK_ATTEMPS): New.
	* doc/invoke.texi (--param): Document it.

From-SVN: r179383
parent ccb3dd5a
2011-09-30 Bernd Schmidt <bernds@codesourcery.com>
* haifa-sched.c (modulo_ii, modulo_max_states, modulo_n_insns,
modulo_insns_scheduled, modulo_iter0_max_uid, modulo_backtracks_left,
modulo_last_stage): New static variables.
(set_modulo_params, discard_delay_pairs_above): New functions.
(struct delay_pair): New member stages.
(htab_i2_traverse, htab_i1_traverse): New static functions.
(record_delay_slot_pair): New arg stages. All callers changed.
Record it.
(pair_delay): Take stages into account.
(add_delay_dependencies): Don't do so for stage pairs.
(struct sched_block_state): New member modulo_epilogue.
(save_backtrack_point): Don't set SHADOW_P for stage pairs.
(unschedule_insns_until): Decrease modulo_insns_scheduled.
Set HARD_DEP without using or.
(resolve_dependencies): New static function.
(prune_ready_list): New arg modulo_epilogue_p. All callers changed.
If it is true, allow only insns with INSN_EXACT_TICK set.
(schedule_block): Return bool, always true for normal scheduling,
true or false depending on modulo scheduling success otherwise.
Add bookkeeping for modulo scheduling, and call resolve_dependencies
on everything left over after a modulo schedule.
(haifa_sched_init): Remove check_cfg call. Clear modulo_ii.
* sched-int.h (schedule_block, record_delay_slot_pair): Adjust
declarations.
(set_modulo_params, discard_delay_pairs_above): Declare.
* params.def (PARAM_MAX_MODULO_BACKTRACK_ATTEMPS): New.
* doc/invoke.texi (--param): Document it.
2011-09-30 Richard Guenther <rguenther@suse.de>
PR middle-end/50574
......@@ -4810,7 +4810,7 @@ split_delayed_branch (rtx insn)
i1 = emit_insn_before (pat, insn);
PATTERN (insn) = newpat;
INSN_CODE (insn) = -1;
record_delay_slot_pair (i1, insn, 5);
record_delay_slot_pair (i1, insn, 5, 0);
}
/* Split every insn (i.e. jumps and calls) which can have delay slots into
......
......@@ -8474,6 +8474,11 @@ before flushing the current state and starting over. Large functions
with few branches or calls can create excessively large lists which
needlessly consume memory and resources.
@item max-modulo-backtrack-attempts
The maximum number of backtrack attempts the scheduler should make
when modulo scheduling a loop. Larger values can exponentially increase
compile time.
@item max-inline-insns-single
Several parameters control the tree inliner used in gcc.
This number sets the maximum number of instructions (counted in GCC's
......
......@@ -165,6 +165,13 @@ DEFPARAM(PARAM_MAX_PENDING_LIST_LENGTH,
"The maximum length of scheduling's pending operations list",
32, 0, 0)
/* This parameter limits the number of backtracking attempts when using the
haifa scheduler for modulo scheduling. */
DEFPARAM(PARAM_MAX_MODULO_BACKTRACK_ATTEMPTS,
"max-modulo-backtrack-attempts",
"The maximum number of backtrack attempts the scheduler should make when modulo scheduling a loop",
40, 0, 0)
DEFPARAM(PARAM_LARGE_FUNCTION_INSNS,
"large-function-insns",
"The size of function body to be considered large",
......
......@@ -1257,7 +1257,7 @@ extern int dep_cost (dep_t);
extern int set_priorities (rtx, rtx);
extern void sched_setup_bb_reg_pressure_info (basic_block, rtx);
extern void schedule_block (basic_block *);
extern bool schedule_block (basic_block *);
extern int cycle_issued_insns;
extern int issue_rate;
......@@ -1330,7 +1330,9 @@ extern int current_blocks;
extern int target_bb;
extern bool sched_no_dce;
extern void record_delay_slot_pair (rtx, rtx, int);
extern void set_modulo_params (int, int, int, int);
extern void record_delay_slot_pair (rtx, rtx, int, int);
extern void discard_delay_pairs_above (int);
extern void free_delay_pairs (void);
extern void add_delay_dependencies (rtx);
extern bool sched_is_disabled_for_current_region_p (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