Commit d72372e4 by Mostafa Hagog Committed by Mostafa Hagog

common.opt (freschedule-modulo-scheduled-loops): New flag.

2004-08-08  Mostafa Hagog  <mustafa@il.ibm.com>
	Ayal Zaks <zaks@il.ibm.com>

	* common.opt (freschedule-modulo-scheduled-loops): New flag.
	* final.c (final_scan_insn): Handle NOTE_DISABLE_SCHED_OF_BLOCK.
	* modulo-sched.c (sms_schedule): Emit a note to disable scheduling
	when -freschedule-modulo-scheduled-loops flag is not specified.
	(sms_schedule_by_order, ps_insn_advance_column, add_node_to_ps,
	add_node_to_ps, ps_has_conflicts, ps_add_node_check_conflicts):
	More accurate placing of insn in row of partial schedule.
	(ps_insn_find_column): New function.
	* rtl.h (NOTE_DISABLE_SCHED_OF_BLOCK): New note.
	* sched-rgn.c (sched_is_disabled_for_current_region_p): New.
	(schedule_region): Use sched_is_disabled_for_current_region_p.
	* docs/invoke.texi: Document -freschedule-modulo-scheduled-loops.

Co-Authored-By: Ayal Zaks <zaks@il.ibm.com>

From-SVN: r85696
parent 94538bd1
2004-08-08 Mostafa Hagog <mustafa@il.ibm.com>
Ayal Zaks <zaks@il.ibm.com>
* common.opt (freschedule-modulo-scheduled-loops): New flag.
* final.c (final_scan_insn): Handle NOTE_DISABLE_SCHED_OF_BLOCK.
* modulo-sched.c (sms_schedule): Emit a note to disable scheduling
when -freschedule-modulo-scheduled-loops flag is not specified.
(sms_schedule_by_order, ps_insn_advance_column, add_node_to_ps,
add_node_to_ps, ps_has_conflicts, ps_add_node_check_conflicts):
More accurate placing of insn in row of partial schedule.
(ps_insn_find_column): New function.
* rtl.h (NOTE_DISABLE_SCHED_OF_BLOCK): New note.
* sched-rgn.c (sched_is_disabled_for_current_region_p): New.
(schedule_region): Use sched_is_disabled_for_current_region_p.
* docs/invoke.texi: Document -freschedule-modulo-scheduled-loops.
2004-08-07 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (ix86_expand_clrmem): Revert the last
......
......@@ -543,6 +543,10 @@ fnew-ra
Common Report Var(flag_new_regalloc)
Use graph-coloring register allocation
freschedule-modulo-scheduled-loops
Common Report Var(flag_resched_modulo_sched)
Enable/Disable the traditional scheduling in loops that already passed modulo scheduling
fnon-call-exceptions
Common Report Var(flag_non_call_exceptions)
Support synchronous non-call exceptions
......
......@@ -308,8 +308,8 @@ in the following sections.
-fsched-spec-load-dangerous @gol
-fsched-stalled-insns=@var{n} -sched-stalled-insns-dep=@var{n} @gol
-fsched2-use-superblocks @gol
-fsched2-use-traces -fsignaling-nans @gol
-fsingle-precision-constant @gol
-fsched2-use-traces -freschedule-modulo-scheduled-loops @gol
-fsignaling-nans -fsingle-precision-constant @gol
-fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol
-funroll-all-loops -funroll-loops -fpeel-loops @gol
-funswitch-loops -fold-unroll-loops -fold-unroll-all-loops @gol
......@@ -4393,6 +4393,12 @@ reality and hurt the performance. This only makes
sense when scheduling after register allocation, i.e.@: with
@option{-fschedule-insns2} or at @option{-O2} or higher.
@item -freschedule-modulo-scheduled-loops
@opindex fscheduling-in-modulo-scheduled-loops
The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled
we may want to prevent the later scheduling passes from changing its schedule, we use this
option to control that.
@item -fcaller-saves
@opindex fcaller-saves
Enable values to be allocated in registers that will be clobbered by
......
......@@ -1704,6 +1704,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
case NOTE_INSN_FUNCTION_END:
case NOTE_INSN_REPEATED_LINE_NUMBER:
case NOTE_INSN_EXPECTED_VALUE:
case NOTE_DISABLE_SCHED_OF_BLOCK:
break;
case NOTE_INSN_UNLIKELY_EXECUTED_CODE:
......
......@@ -983,6 +983,12 @@ enum insn_note
/* Generated at the start of a duplicated exit test. */
NOTE_INSN_LOOP_VTOP,
/* Mark that a block shouldn't be scheduled. This is currently
used in modulo scheduling. Modulo scheduling adds this note
to the blocks of the modulo-scheduled loops to disable scheduling
them in the later traditional scheduling passes. */
NOTE_DISABLE_SCHED_OF_BLOCK,
/* This kind of note is generated at the end of the function body,
just before the return insn or return label. In an optimizing
compilation it is deleted by the first jump optimization, after
......
......@@ -117,6 +117,7 @@ static int *out_edges;
static int is_cfg_nonregular (void);
static int build_control_flow (struct edge_list *);
static void new_edge (int, int);
static bool sched_is_disabled_for_current_region_p (void);
/* A region is the main entity for interblock scheduling: insns
are allowed to move between blocks in the same region, along
......@@ -2332,6 +2333,37 @@ debug_dependencies (void)
fprintf (sched_dump, "\n");
}
/* Returns true if all the basic blocks of the current region have
NOTE_DISABLE_SCHED_OF_BLOCK which means not to schedule that region. */
static bool
sched_is_disabled_for_current_region_p (void)
{
rtx first_bb_insn, last_bb_insn, insn;
int bb;
for (bb = 0; bb < current_nr_blocks; bb++)
{
bool disable_sched = false;
/* Searching for NOTE_DISABLE_SCHED_OF_BLOCK note between the
start and end of the basic block. */
get_block_head_tail (BB_TO_BLOCK (bb), &first_bb_insn,
&last_bb_insn);
for (insn = last_bb_insn; insn != NULL && insn != first_bb_insn;
insn = PREV_INSN (insn))
if (GET_CODE (insn) == NOTE
&& (NOTE_LINE_NUMBER (insn)
== NOTE_DISABLE_SCHED_OF_BLOCK))
{
disable_sched = true;
break;
}
if (! disable_sched)
return false;
}
return true;
}
/* Schedule a region. A region is either an inner loop, a loop-free
subroutine, or a single basic block. Each bb in the region is
scheduled after its flow predecessors. */
......@@ -2347,6 +2379,11 @@ schedule_region (int rgn)
current_nr_blocks = RGN_NR_BLOCKS (rgn);
current_blocks = RGN_BLOCKS (rgn);
/* Don't schedule region that is marked by
NOTE_DISABLE_SCHED_OF_BLOCK. */
if (sched_is_disabled_for_current_region_p ())
return;
init_deps_global ();
/* Initializations for region data dependence analysis. */
......
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