aboutsummaryrefslogtreecommitdiff
path: root/gcc/sched-rgn.c
diff options
context:
space:
mode:
authorMostafa Hagog <mustafa@il.ibm.com>2004-08-08 21:35:53 +0000
committerMostafa Hagog <hagog@gcc.gnu.org>2004-08-08 21:35:53 +0000
commitd72372e46ac06b4db61143f91367a777089cc6f6 (patch)
treed4a4dc1d2fd739eff16c75b3bbf87780df96f926 /gcc/sched-rgn.c
parent94538bd12ae8ffa02164399a616ef806e77f797b (diff)
downloadgcc-d72372e46ac06b4db61143f91367a777089cc6f6.zip
gcc-d72372e46ac06b4db61143f91367a777089cc6f6.tar.gz
gcc-d72372e46ac06b4db61143f91367a777089cc6f6.tar.bz2
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
Diffstat (limited to 'gcc/sched-rgn.c')
-rw-r--r--gcc/sched-rgn.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 325e169..62d2f23 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -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. */