Commit 58565a33 by Sanjiv Kumar Gupta Committed by Vladimir Makarov

target-def.h (TARGET_SCHED_INIT_GLOBAL, [...]): New macros.

2003-02-24  Sanjiv Kumar Gupta  <sanjivg@noida.hcltech.com>

	* target-def.h (TARGET_SCHED_INIT_GLOBAL,
	TARGET_SCHED_FINISH_GLOBAL): New macros.

	* target.h (md_init_global, md_finish_global): Function
	declarations corresponding to new target macros.

	* haifa-sched.c (sched_init, sched_finish): Allow target to
	call the new schedular hooks.

	* flow.c (recompute_reg_usage): Add PROP_DEATH_NOTES flag in
	call to update_life_info.

	* config/sh/sh.h (OVERRIDE_OPTIONS): Re-enable
	flag_schedule_insns for SH4.

	* config/sh/sh.c (sh_md_init_global, sh_md_finish_global,
	find_set_regmode_weight, find_insn_regmode_weight,
	find_regmode_weight), sh_md_init, sh_dfa_new_cycle,
	sh_variable_issue, high_pressure, ready_reorder,
	rank_for_reorder, swap_reorder, sh_reorder, sh_reorder2): New
	functions used to throttle the insn movement in first
	scheduling pass for SH.

	* gcc/doc/tm.texi: Document TARGET_SCHED_INIT_GLOBAL and
	TARGET_SCHED_FINISH_GLOBAL.

From-SVN: r78374
parent 34208acf
2003-02-24 Sanjiv Kumar Gupta <sanjivg@noida.hcltech.com>
* target-def.h (TARGET_SCHED_INIT_GLOBAL,
TARGET_SCHED_FINISH_GLOBAL): New macros.
* target.h (md_init_global, md_finish_global): Function
declarations corresponding to new target macros.
* haifa-sched.c (sched_init, sched_finish): Allow target to
call the new schedular hooks.
* flow.c (recompute_reg_usage): Add PROP_DEATH_NOTES flag in
call to update_life_info.
* config/sh/sh.h (OVERRIDE_OPTIONS): Re-enable
flag_schedule_insns for SH4.
* config/sh/sh.c (sh_md_init_global, sh_md_finish_global,
find_set_regmode_weight, find_insn_regmode_weight,
find_regmode_weight), sh_md_init, sh_dfa_new_cycle,
sh_variable_issue, high_pressure, ready_reorder,
rank_for_reorder, swap_reorder, sh_reorder, sh_reorder2): New
functions used to throttle the insn movement in first
scheduling pass for SH.
* gcc/doc/tm.texi: Document TARGET_SCHED_INIT_GLOBAL and
TARGET_SCHED_FINISH_GLOBAL.
2004-02-24 Alexandre Oliva <aoliva@redhat.com>
Implement FR-V FDPIC ABI support for frv-uclinux and frv-linux.
......
......@@ -516,7 +516,11 @@ do { \
/* Never run scheduling before reload, since that can \
break global alloc, and generates slower code anyway due \
to the pressure on R0. */ \
flag_schedule_insns = 0; \
/* Enable sched1 for SH4; ready queue will be reordered by \
the target hooks when pressure is high. We can not do this for \
SH3 and lower as they give spill failures for R0. */ \
if (!TARGET_HARD_SH4) \
flag_schedule_insns = 0; \
} \
\
if (align_loops == 0) \
......
......@@ -5571,6 +5571,19 @@ to. @var{verbose} is the verbose level provided by
@option{-fsched-verbose-@var{n}}.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_INIT_GLOBAL (FILE *@var{file}, int @var{verbose}, int @var{old_max_uid})
This hook is executed by the scheduler after function level initializations.
@var{file} is either a null pointer, or a stdio stream to write any debug output to.
@var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}.
@var{old_max_uid} is the maximum insn uid when scheduling begins.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_FINISH_GLOBAL (FILE *@var{file}, int @var{verbose})
This is the cleanup hook corresponding to TARGET_SCHED_INIT_GLOBAL.
@var{file} is either a null pointer, or a stdio stream to write any debug output to.
@var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}.
@end deftypefn
@deftypefn {Target Hook} int TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE (void)
This hook is called many times during insn scheduling. If the hook
returns nonzero, the automaton based pipeline description is used for
......
......@@ -4260,7 +4260,10 @@ void
recompute_reg_usage (rtx f ATTRIBUTE_UNUSED, int loop_step ATTRIBUTE_UNUSED)
{
allocate_reg_life_data ();
update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_REG_INFO);
/* distribute_notes in combiner fails to convert some of the REG_UNUSED notes
to REG_DEAD notes. This causes CHECK_DEAD_NOTES in sched1 to abort. To
solve this update the DEATH_NOTES here. */
update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_REG_INFO | PROP_DEATH_NOTES);
}
/* Optionally removes all the REG_DEAD and REG_UNUSED notes from a set of
......
......@@ -2856,6 +2856,9 @@ sched_init (FILE *dump_file)
removing death notes. */
FOR_EACH_BB_REVERSE (b)
find_insn_reg_weight (b->index);
if (targetm.sched.md_init_global)
(*targetm.sched.md_init_global) (sched_dump, sched_verbose, old_max_uid);
}
/* Free global data used during insn scheduling. */
......@@ -2875,5 +2878,8 @@ sched_finish (void)
end_alias_analysis ();
if (write_symbols != NO_DEBUG)
free (line_note_head);
if (targetm.sched.md_finish_global)
(*targetm.sched.md_finish_global) (sched_dump, sched_verbose);
}
#endif /* INSN_SCHEDULING */
......@@ -217,6 +217,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_SCHED_VARIABLE_ISSUE 0
#define TARGET_SCHED_INIT 0
#define TARGET_SCHED_FINISH 0
#define TARGET_SCHED_INIT_GLOBAL 0
#define TARGET_SCHED_FINISH_GLOBAL 0
#define TARGET_SCHED_REORDER 0
#define TARGET_SCHED_REORDER2 0
#define TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK 0
......@@ -239,6 +241,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_SCHED_VARIABLE_ISSUE, \
TARGET_SCHED_INIT, \
TARGET_SCHED_FINISH, \
TARGET_SCHED_INIT_GLOBAL, \
TARGET_SCHED_FINISH_GLOBAL, \
TARGET_SCHED_REORDER, \
TARGET_SCHED_REORDER2, \
TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK, \
......
......@@ -183,6 +183,12 @@ struct gcc_target
/* Finalize machine-dependent scheduling code. */
void (* md_finish) (FILE *, int);
/* Initialize machine-dependent function while scheduling code. */
void (* md_init_global) (FILE *, int, int);
/* Finalize machine-dependent function wide scheduling code. */
void (* md_finish_global) (FILE *, int);
/* Reorder insns in a machine-dependent fashion, in two different
places. Default does nothing. */
int (* reorder) (FILE *, int, rtx *, int *, int);
......
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