aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@ispras.ru>2008-04-14 14:44:53 +0000
committerAndrey Belevantsev <abel@ispras.ru>2008-04-14 14:44:53 +0000
commit63ae2f4b3e7a62df623dd24a5a13963d22b4d1d1 (patch)
treea260a47a6a7feb23a48e96a0e9f4f3b7b2ecf8fb
parent9523fa139ff00ced6221dab2fcdbb8b250a76356 (diff)
* sched-deps.c (sched_deps_init): Tidy.
* sel-sched-ir.c (init_fence_for_scheduling): New. (flist_add): Use it. (init_fences): Merge ready_ticks_size. (merge_fences): Likewise. (new_fences_add): Rename to add_to_fences. (move_fence_to_fences): New. (new_fences_add_clean): Rename to move_fence_to_fences. (new_fences_add_dirty): Rename to add_dirty_fence_to_fences. (insn_eligible_for_subst_p): Kill. * sel-sched-ir.h (ready_ticks, ready_ticks_size): New. * sel-sched.c (extract_new_fences_from, sel_sched_region_2): Use the new fence functions. (can_substitute_through_p): New. (moveup_expr): Use it. (can_overcome_dep_p): Rename to can_speculate_dep_p. (fill_vec_av_set): Use FENCE_READY_TICKS. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/sel-sched-branch@134269 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.sel-sched21
-rw-r--r--gcc/sched-deps.c1
-rw-r--r--gcc/sel-sched-dump.c2
-rw-r--r--gcc/sel-sched-ir.c246
-rw-r--r--gcc/sel-sched-ir.h33
-rw-r--r--gcc/sel-sched.c276
6 files changed, 322 insertions, 257 deletions
diff --git a/gcc/ChangeLog.sel-sched b/gcc/ChangeLog.sel-sched
index 0efba837089..b21feb1bf64 100644
--- a/gcc/ChangeLog.sel-sched
+++ b/gcc/ChangeLog.sel-sched
@@ -1,3 +1,24 @@
+2008-04-14 Andrey Belevantsev <abel@ispras.ru>
+
+ * sched-deps.c (sched_deps_init): Tidy.
+ * sel-sched-ir.c (init_fence_for_scheduling): New.
+ (flist_add): Use it.
+ (init_fences): Merge ready_ticks_size.
+ (merge_fences): Likewise.
+ (new_fences_add): Rename to add_to_fences.
+ (move_fence_to_fences): New.
+ (new_fences_add_clean): Rename to move_fence_to_fences.
+ (new_fences_add_dirty): Rename to add_dirty_fence_to_fences.
+ (insn_eligible_for_subst_p): Kill.
+
+ * sel-sched-ir.h (ready_ticks, ready_ticks_size): New.
+ * sel-sched.c (extract_new_fences_from,
+ sel_sched_region_2): Use the new fence functions.
+ (can_substitute_through_p): New.
+ (moveup_expr): Use it.
+ (can_overcome_dep_p): Rename to can_speculate_dep_p.
+ (fill_vec_av_set): Use FENCE_READY_TICKS.
+
2008-04-14 Alexander Monakov <amonakov@ispras.ru>
* common.opt (flag_sel_sched_pipelining_outer_loops): Init to 0.
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index e8292fda390..557050ff2bc 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -3045,7 +3045,6 @@ sched_deps_init (bool global_p)
5 producers. */
5 * insns_in_block);
}
-
}
diff --git a/gcc/sel-sched-dump.c b/gcc/sel-sched-dump.c
index b9893fb73b3..dddeac3d425 100644
--- a/gcc/sel-sched-dump.c
+++ b/gcc/sel-sched-dump.c
@@ -711,7 +711,7 @@ sel_dump_cfg_2 (FILE *f, int flags)
if (fence != NULL)
{
- if (!FENCE_SCHEDULED_SOMETHING (fence))
+ if (!FENCE_SCHEDULED_P (fence))
{
if (first_p)
color = "color = red, ";
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index de15a3feb02..578ba745f99 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -132,8 +132,6 @@ bool preheader_removed = false;
/* Forward static declarations. */
-static void fence_init (fence_t, insn_t, state_t, deps_t, void *,
- rtx, VEC(rtx, gc) *, rtx, int, int, bool, bool);
static void fence_clear (fence_t);
static void deps_init_id (idata_t, insn_t, bool);
@@ -232,24 +230,59 @@ flist_lookup (flist_t l, insn_t insn)
return NULL;
}
+/* Init the fields of F before running fill_insns. */
+static void
+init_fence_for_scheduling (fence_t f)
+{
+ FENCE_BNDS (f) = NULL;
+ FENCE_PROCESSED_P (f) = false;
+ FENCE_SCHEDULED_P (f) = false;
+}
+
/* Add new fence consisting of INSN and STATE to the list pointed to by LP. */
-void
+static void
flist_add (flist_t *lp, insn_t insn, state_t state, deps_t dc, void *tc,
insn_t last_scheduled_insn, VEC(rtx,gc) *executing_insns,
- insn_t sched_next, int cycle, int cycle_issued_insns,
+ int *ready_ticks, int ready_ticks_size, insn_t sched_next,
+ int cycle, int cycle_issued_insns,
bool starts_cycle_p, bool after_stall_p)
{
+ fence_t f;
+
_list_add (lp);
- fence_init (FLIST_FENCE (*lp), insn, state, dc, tc, last_scheduled_insn,
- executing_insns, sched_next, cycle, cycle_issued_insns,
- starts_cycle_p, after_stall_p);
+ f = FLIST_FENCE (*lp);
+
+ FENCE_INSN (f) = insn;
+
+ gcc_assert (state != NULL);
+ FENCE_STATE (f) = state;
+
+ FENCE_CYCLE (f) = cycle;
+ FENCE_ISSUED_INSNS (f) = cycle_issued_insns;
+ FENCE_STARTS_CYCLE_P (f) = starts_cycle_p;
+ FENCE_AFTER_STALL_P (f) = after_stall_p;
+
+ gcc_assert (dc != NULL);
+ FENCE_DC (f) = dc;
+
+ gcc_assert (tc != NULL || targetm.sched.alloc_sched_context == NULL);
+ FENCE_TC (f) = tc;
+
+ FENCE_LAST_SCHEDULED_INSN (f) = last_scheduled_insn;
+ FENCE_EXECUTING_INSNS (f) = executing_insns;
+ FENCE_READY_TICKS (f) = ready_ticks;
+ FENCE_READY_TICKS_SIZE (f) = ready_ticks_size;
+ FENCE_SCHED_NEXT (f) = sched_next;
+
+ init_fence_for_scheduling (f);
}
/* Remove the head node of the list pointed to by LP. */
static void
flist_remove (flist_t *lp)
{
- fence_clear (FLIST_FENCE (*lp));
+ if (FENCE_INSN (FLIST_FENCE (*lp)))
+ fence_clear (FLIST_FENCE (*lp));
_list_remove (lp);
}
@@ -515,52 +548,6 @@ state_create_copy (state_t from)
/* Functions to work with fences. */
-/* Initialize the fence. */
-static void
-fence_init (fence_t f, insn_t insn, state_t state, deps_t dc, void *tc,
- rtx last_scheduled_insn, VEC(rtx, gc) *executing_insns,
- rtx sched_next, int cycle, int cycle_issued_insns,
- bool starts_cycle_p, bool after_stall_p)
-{
- FENCE_INSN (f) = insn;
-
- gcc_assert (state != NULL);
- FENCE_STATE (f) = state;
-
- FENCE_CYCLE (f) = cycle;
- FENCE_ISSUED_INSNS (f) = cycle_issued_insns;
- FENCE_STARTS_CYCLE_P (f) = starts_cycle_p;
- FENCE_AFTER_STALL_P (f) = after_stall_p;
-
- FENCE_BNDS (f) = NULL;
- FENCE_SCHEDULED (f) = false;
- FENCE_SCHEDULED_SOMETHING (f) = false;
-
- gcc_assert (dc != NULL);
- FENCE_DC (f) = dc;
-
- gcc_assert (tc != NULL || targetm.sched.alloc_sched_context == NULL);
- FENCE_TC (f) = tc;
-
- FENCE_LAST_SCHEDULED_INSN (f) = last_scheduled_insn;
- FENCE_EXECUTING_INSNS (f) = executing_insns;
- FENCE_SCHED_NEXT (f) = sched_next;
-}
-
-#if 0
-/* Copy the FROM fence to TO. */
-static void
-fence_copy (fence_t to, fence_t from)
-{
- fence_init (to, FENCE_INSN (from), state_create_copy (FENCE_STATE (from)),
- create_copy_of_deps_context (FENCE_DC (from)),
- create_copy_of_target_context (FENCE_TC (from)),
- FENCE_LAST_SCHEDULED_INSN (from), FENCE_SCHED_NEXT (from),
- FENCE_CYCLE (from), FENCE_ISSUED_INSNS (from),
- FENCE_STARTS_CYCLE_P (from), FENCE_AFTER_STALL_P (from));
-}
-#endif
-
/* Clear the fence. */
static void
fence_clear (fence_t f)
@@ -583,6 +570,8 @@ fence_clear (fence_t f)
if (tc != NULL)
delete_target_context (tc);
VEC_free (rtx, gc, FENCE_EXECUTING_INSNS (f));
+ free (FENCE_READY_TICKS (f));
+ FENCE_READY_TICKS (f) = NULL;
}
/* Init a list of fences with successors of OLD_FENCE. */
@@ -592,10 +581,12 @@ init_fences (insn_t old_fence)
insn_t succ;
succ_iterator si;
bool first = true;
-
+ int ready_ticks_size = get_max_uid () + 1;
+
FOR_EACH_SUCC_1 (succ, si, old_fence,
SUCCS_NORMAL | SUCCS_SKIP_TO_LOOP_EXITS)
{
+
if (first)
first = false;
else
@@ -607,6 +598,8 @@ init_fences (insn_t old_fence)
create_target_context (true) /* tc */,
NULL_RTX /* last_scheduled_insn */,
NULL, /* executing_insns */
+ xcalloc (ready_ticks_size, sizeof (int)), /* ready_ticks */
+ ready_ticks_size,
NULL_RTX /* sched_next */,
1 /* cycle */, 0 /* cycle_issued_insns */,
1 /* starts_cycle_p */, 0 /* after_stall_p */);
@@ -622,6 +615,7 @@ static void
merge_fences (fence_t f, insn_t insn,
state_t state, deps_t dc, void *tc,
rtx last_scheduled_insn, VEC(rtx, gc) *executing_insns,
+ int *ready_ticks, int ready_ticks_size,
rtx sched_next, int cycle, bool after_stall_p)
{
insn_t last_scheduled_insn_old = FENCE_LAST_SCHEDULED_INSN (f);
@@ -653,9 +647,12 @@ merge_fences (fence_t f, insn_t insn,
FENCE_LAST_SCHEDULED_INSN (f) = NULL;
VEC_free (rtx, gc, executing_insns);
+ free (ready_ticks);
if (FENCE_EXECUTING_INSNS (f))
VEC_block_remove (rtx, FENCE_EXECUTING_INSNS (f), 0,
VEC_length (rtx, FENCE_EXECUTING_INSNS (f)));
+ if (FENCE_READY_TICKS (f))
+ memset (FENCE_READY_TICKS (f), 0, FENCE_READY_TICKS_SIZE (f));
}
else
{
@@ -701,7 +698,6 @@ merge_fences (fence_t f, insn_t insn,
{
/* Leave STATE, TC and LAST_SCHEDULED_INSN fields untouched. */
state_free (state);
-
delete_target_context (tc);
gcc_assert (BLOCK_FOR_INSN (insn)->prev_bb
@@ -737,11 +733,14 @@ merge_fences (fence_t f, insn_t insn,
reset_deps_context (FENCE_DC (f));
delete_deps_context (dc);
VEC_free (rtx, gc, executing_insns);
+ free (ready_ticks);
FENCE_CYCLE (f) = MAX (FENCE_CYCLE (f), cycle);
if (FENCE_EXECUTING_INSNS (f))
VEC_block_remove (rtx, FENCE_EXECUTING_INSNS (f), 0,
VEC_length (rtx, FENCE_EXECUTING_INSNS (f)));
+ if (FENCE_READY_TICKS (f))
+ memset (FENCE_READY_TICKS (f), 0, FENCE_READY_TICKS_SIZE (f));
}
else
if (edge_new->probability > edge_old->probability)
@@ -750,6 +749,9 @@ merge_fences (fence_t f, insn_t insn,
FENCE_DC (f) = dc;
VEC_free (rtx, gc, FENCE_EXECUTING_INSNS (f));
FENCE_EXECUTING_INSNS (f) = executing_insns;
+ free (FENCE_READY_TICKS (f));
+ FENCE_READY_TICKS (f) = ready_ticks;
+ FENCE_READY_TICKS_SIZE (f) = ready_ticks_size;
FENCE_CYCLE (f) = cycle;
}
else
@@ -757,6 +759,7 @@ merge_fences (fence_t f, insn_t insn,
/* Leave DC and CYCLE untouched. */
delete_deps_context (dc);
VEC_free (rtx, gc, executing_insns);
+ free (ready_ticks);
}
}
@@ -771,19 +774,20 @@ merge_fences (fence_t f, insn_t insn,
/* Add a new fence to NEW_FENCES list, initializing it from all
other parameters. */
-void
-new_fences_add (flist_tail_t new_fences, insn_t insn,
- state_t state, deps_t dc, void *tc, rtx last_scheduled_insn,
- VEC(rtx, gc) *executing_insns, rtx sched_next, int cycle,
- int cycle_issued_insns, bool starts_cycle_p, bool after_stall_p)
+static void
+add_to_fences (flist_tail_t new_fences, insn_t insn,
+ state_t state, deps_t dc, void *tc, rtx last_scheduled_insn,
+ VEC(rtx, gc) *executing_insns, int *ready_ticks,
+ int ready_ticks_size, rtx sched_next, int cycle,
+ int cycle_issued_insns, bool starts_cycle_p, bool after_stall_p)
{
fence_t f = flist_lookup (FLIST_TAIL_HEAD (new_fences), insn);
- if (!f)
+ if (! f)
{
flist_add (FLIST_TAIL_TAILP (new_fences), insn, state, dc, tc,
- last_scheduled_insn, executing_insns,
- sched_next, cycle, cycle_issued_insns,
+ last_scheduled_insn, executing_insns, ready_ticks,
+ ready_ticks_size, sched_next, cycle, cycle_issued_insns,
starts_cycle_p, after_stall_p);
FLIST_TAIL_TAILP (new_fences)
@@ -792,39 +796,78 @@ new_fences_add (flist_tail_t new_fences, insn_t insn,
else
{
merge_fences (f, insn, state, dc, tc, last_scheduled_insn,
- executing_insns, sched_next, cycle, after_stall_p);
+ executing_insns, ready_ticks, ready_ticks_size,
+ sched_next, cycle, after_stall_p);
+ }
+}
+/* Move the first fence in the OLD_FENCES list to NEW_FENCES. */
+void
+move_fence_to_fences (flist_t old_fences, flist_tail_t new_fences)
+{
+ fence_t f, old;
+ flist_t *tailp = FLIST_TAIL_TAILP (new_fences);
+
+ old = FLIST_FENCE (old_fences);
+ f = flist_lookup (FLIST_TAIL_HEAD (new_fences),
+ FENCE_INSN (FLIST_FENCE (old_fences)));
+ if (f)
+ {
+ merge_fences (f, old->insn, old->state, old->dc, old->tc,
+ old->last_scheduled_insn, old->executing_insns,
+ old->ready_ticks, old->ready_ticks_size,
+ old->sched_next, old->cycle,
+ old->after_stall_p);
}
+ else
+ {
+ _list_add (tailp);
+ FLIST_TAIL_TAILP (new_fences) = &FLIST_NEXT (*tailp);
+ *FLIST_FENCE (*tailp) = *old;
+ init_fence_for_scheduling (FLIST_FENCE (*tailp));
+ }
+ FENCE_INSN (old) = NULL;
}
/* Add a new fence to NEW_FENCES list and initialize most of its data
as a clean one. */
void
-new_fences_add_clean (flist_tail_t new_fences, insn_t succ, fence_t fence)
+add_clean_fence_to_fences (flist_tail_t new_fences, insn_t succ, fence_t fence)
{
- new_fences_add (new_fences,
- succ, state_create (), create_deps_context (),
- create_target_context (true),
- NULL_RTX, NULL, NULL_RTX, FENCE_CYCLE (fence) + 1,
- 0, 1, FENCE_AFTER_STALL_P (fence));
+ int ready_ticks_size = get_max_uid () + 1;
+
+ add_to_fences (new_fences,
+ succ, state_create (), create_deps_context (),
+ create_target_context (true),
+ NULL_RTX, NULL, xcalloc (ready_ticks_size, sizeof (int)),
+ ready_ticks_size,
+ NULL_RTX, FENCE_CYCLE (fence) + 1,
+ 0, 1, FENCE_AFTER_STALL_P (fence));
}
/* Add a new fence to NEW_FENCES list and initialize all of its data
from FENCE and SUCC. */
void
-new_fences_add_dirty (flist_tail_t new_fences, insn_t succ, fence_t fence)
-{
- new_fences_add (new_fences,
- succ, state_create_copy (FENCE_STATE (fence)),
- create_copy_of_deps_context (FENCE_DC (fence)),
- create_copy_of_target_context (FENCE_TC (fence)),
- FENCE_LAST_SCHEDULED_INSN (fence),
- VEC_copy (rtx, gc, FENCE_EXECUTING_INSNS (fence)),
- FENCE_SCHED_NEXT (fence),
- FENCE_CYCLE (fence),
- FENCE_ISSUED_INSNS (fence),
- FENCE_STARTS_CYCLE_P (fence),
- FENCE_AFTER_STALL_P (fence));
+add_dirty_fence_to_fences (flist_tail_t new_fences, insn_t succ, fence_t fence)
+{
+ int * new_ready_ticks
+ = xmalloc (FENCE_READY_TICKS_SIZE (fence) * sizeof (int));
+
+ memcpy (new_ready_ticks, FENCE_READY_TICKS (fence),
+ FENCE_READY_TICKS_SIZE (fence) * sizeof (int));
+ add_to_fences (new_fences,
+ succ, state_create_copy (FENCE_STATE (fence)),
+ create_copy_of_deps_context (FENCE_DC (fence)),
+ create_copy_of_target_context (FENCE_TC (fence)),
+ FENCE_LAST_SCHEDULED_INSN (fence),
+ VEC_copy (rtx, gc, FENCE_EXECUTING_INSNS (fence)),
+ new_ready_ticks,
+ FENCE_READY_TICKS_SIZE (fence),
+ FENCE_SCHED_NEXT (fence),
+ FENCE_CYCLE (fence),
+ FENCE_ISSUED_INSNS (fence),
+ FENCE_STARTS_CYCLE_P (fence),
+ FENCE_AFTER_STALL_P (fence));
}
@@ -2464,7 +2507,6 @@ static void
deps_init_id_start_lhs (rtx lhs)
{
gcc_assert (deps_init_id_data.where == DEPS_IN_INSN);
-
gcc_assert (IDATA_LHS (deps_init_id_data.id) == NULL);
if (IDATA_TYPE (deps_init_id_data.id) == SET)
@@ -2537,7 +2579,6 @@ deps_init_id_finish_rhs (void)
{
gcc_assert (deps_init_id_data.where == DEPS_IN_RHS
|| deps_init_id_data.where == DEPS_IN_INSN);
-
deps_init_id_data.where = DEPS_IN_INSN;
}
@@ -2642,15 +2683,15 @@ first_time_insn_init (insn_t insn)
static hashval_t
hash_transformed_insns (const void *p)
{
- return VINSN_HASH_RTX (((struct transformed_insns *) p)->vinsn_old);
+ return VINSN_HASH_RTX (((const struct transformed_insns *) p)->vinsn_old);
}
/* Compare the entries in a transformed_insns hashtable. */
static int
eq_transformed_insns (const void *p, const void *q)
{
- rtx i1 = VINSN_INSN_RTX (((struct transformed_insns *) p)->vinsn_old);
- rtx i2 = VINSN_INSN_RTX (((struct transformed_insns *) q)->vinsn_old);
+ rtx i1 = VINSN_INSN_RTX (((const struct transformed_insns *) p)->vinsn_old);
+ rtx i2 = VINSN_INSN_RTX (((const struct transformed_insns *) q)->vinsn_old);
if (INSN_UID (i1) == INSN_UID (i2))
return 1;
@@ -3357,33 +3398,6 @@ sel_insn_is_speculation_check (rtx insn)
return s_i_d && !! INSN_SPEC_CHECKED_DS (insn);
}
-/* Returns whether INSN is eligible for substitution, i.e. it's a copy
- operation x := y, and RHS that is moved up through this insn should be
- substituted. */
-bool
-insn_eligible_for_subst_p (insn_t insn)
-{
- /* Since we've got INSN_LHS and INSN_RHS it should be the SET insn,
- and it's RHS is free of side effects (like AUTO_INC),
- so we just need to make sure the INSN_RHS consists of only one simple
- REG rtx. */
-
- if (INSN_RHS (insn) && INSN_LHS (insn))
- {
- if (REG_P (INSN_RHS (insn)) && REG_P (INSN_LHS (insn)))
- {
- gcc_assert (GET_MODE (INSN_LHS (insn))
- == GET_MODE (INSN_RHS (insn)));
- }
- if ((REG_P (INSN_LHS (insn))
- && (REG_P (INSN_RHS (insn))
- /* Not supported atm.
- || GET_CODE (INSN_RHS (insn)) == CONST_INT */)))
- return true;
- }
- return false;
-}
-
/* Extracts machine mode MODE and destination location DST_LOC
for given INSN. */
void
diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h
index fda169c302d..18d660a4a95 100644
--- a/gcc/sel-sched-ir.h
+++ b/gcc/sel-sched-ir.h
@@ -249,12 +249,15 @@ typedef _list_t blist_t;
blocks code motion through it when pipelining. */
struct _fence
{
+ /* Insn before which we gather an instruction group.*/
insn_t insn;
+ /* Modeled state of the processor pipeline. */
state_t state;
/* Current cycle that is being scheduled on this fence. */
int cycle;
+
/* Number of insns that were scheduled on the current cycle.
This information has to be local to a fence. */
int cycle_issued_insns;
@@ -263,7 +266,7 @@ struct _fence
that are inner boundaries of the scheduled parallel group. */
ilist_t bnds;
- /* Deps Context at this fence. It is used to model dependencies at the
+ /* Deps context at this fence. It is used to model dependencies at the
fence so that insn ticks can be properly evaluated. */
deps_t dc;
@@ -273,7 +276,14 @@ struct _fence
/* A vector of insns that are scheduled but not yet completed. */
VEC (rtx,gc) *executing_insns;
-
+
+ /* A vector indexed by UIDs that caches the earliest cycle on which
+ an insn can be scheduled on this fence. */
+ int *ready_ticks;
+
+ /* Its size. */
+ int ready_ticks_size;
+
/* Insn, which has been scheduled last on this fence. */
rtx last_scheduled_insn;
@@ -281,10 +291,10 @@ struct _fence
rtx sched_next;
/* True if fill_insns processed this fence. */
- BOOL_BITFIELD scheduled : 1;
+ BOOL_BITFIELD processed_p : 1;
/* True if fill_insns actually scheduled something on this fence. */
- BOOL_BITFIELD scheduled_something : 1;
+ BOOL_BITFIELD scheduled_p : 1;
/* True when the next insn scheduled here would start a cycle. */
BOOL_BITFIELD starts_cycle_p : 1;
@@ -297,8 +307,8 @@ typedef struct _fence *fence_t;
#define FENCE_INSN(F) ((F)->insn)
#define FENCE_STATE(F) ((F)->state)
#define FENCE_BNDS(F) ((F)->bnds)
-#define FENCE_SCHEDULED(F) ((F)->scheduled)
-#define FENCE_SCHEDULED_SOMETHING(F) ((F)->scheduled_something)
+#define FENCE_PROCESSED_P(F) ((F)->processed_p)
+#define FENCE_SCHEDULED_P(F) ((F)->scheduled_p)
#define FENCE_ISSUED_INSNS(F) ((F)->cycle_issued_insns)
#define FENCE_CYCLE(F) ((F)->cycle)
#define FENCE_STARTS_CYCLE_P(F) ((F)->starts_cycle_p)
@@ -307,6 +317,8 @@ typedef struct _fence *fence_t;
#define FENCE_TC(F) ((F)->tc)
#define FENCE_LAST_SCHEDULED_INSN(F) ((F)->last_scheduled_insn)
#define FENCE_EXECUTING_INSNS(F) ((F)->executing_insns)
+#define FENCE_READY_TICKS(F) ((F)->ready_ticks)
+#define FENCE_READY_TICKS_SIZE(F) ((F)->ready_ticks_size)
#define FENCE_SCHED_NEXT(F) ((F)->sched_next)
/* List of fences. */
@@ -1437,8 +1449,6 @@ extern ilist_t ilist_invert (ilist_t);
extern void blist_add (blist_t *, insn_t, ilist_t, deps_t);
extern void blist_remove (blist_t *);
extern void flist_tail_init (flist_tail_t);
-extern void flist_add (flist_t *, insn_t, state_t, deps_t, void *,
- insn_t, VEC(rtx, gc) *, insn_t, int, int, bool, bool);
extern fence_t flist_lookup (flist_t, insn_t);
extern void flist_clear (flist_t *);
@@ -1454,10 +1464,9 @@ extern void advance_deps_context (deps_t, insn_t);
/* Fences functions. */
extern void init_fences (insn_t);
-extern void new_fences_add (flist_tail_t, insn_t, state_t, deps_t, void *, rtx,
- VEC(rtx, gc) *, rtx, int, int, bool, bool);
-extern void new_fences_add_clean (flist_tail_t, insn_t, fence_t);
-extern void new_fences_add_dirty (flist_tail_t, insn_t, fence_t);
+extern void add_clean_fence_to_fences (flist_tail_t, insn_t, fence_t);
+extern void add_dirty_fence_to_fences (flist_tail_t, insn_t, fence_t);
+extern void move_fence_to_fences (flist_t, flist_tail_t);
/* Pool functions. */
extern regset get_regset_from_pool (void);
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 5354b2ef4a5..8eb7cf3a816 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -425,13 +425,17 @@ in_fallthru_bb_p (rtx insn, rtx succ)
When a successor will continue a ebb, transfer all FENCE's parameters
to the new fence. */
static void
-extract_new_fences_from (fence_t fence, flist_tail_t new_fences,
+extract_new_fences_from (flist_t old_fences, flist_tail_t new_fences,
sel_sched_region_2_data_t data)
{
int orig_max_seqno = data->orig_max_seqno;
bool was_here_p = false;
insn_t insn = NULL_RTX;
+ insn_t succ;
+ succ_iterator si;
ilist_iterator ii;
+ fence_t fence = FLIST_FENCE (old_fences);
+ basic_block bb;
/* Get the only element of FENCE_BNDS (fence). */
FOR_EACH_INSN (insn, ii, FENCE_BNDS (fence))
@@ -439,45 +443,73 @@ extract_new_fences_from (fence_t fence, flist_tail_t new_fences,
gcc_assert (!was_here_p);
was_here_p = true;
}
-
gcc_assert (was_here_p && insn != NULL_RTX);
- if (was_here_p /* true */)
+ /* When in the "middle" of the block, just move this fence
+ to the new list. */
+ bb = BLOCK_FOR_INSN (insn);
+ if (single_succ_p (bb)
+ && single_pred_p (single_succ (bb)))
{
- insn_t succ;
- succ_iterator si;
+ FENCE_INSN (fence) = sel_bb_head (single_succ (bb));
+ move_fence_to_fences (old_fences, new_fences);
+ return;
+ }
- FOR_EACH_SUCC_1 (succ, si, insn, SUCCS_NORMAL | SUCCS_SKIP_TO_LOOP_EXITS)
- {
- int seqno = INSN_SEQNO (succ);
+ /* Otherwise copy fence's structures to (possibly) multiple successors. */
+ FOR_EACH_SUCC_1 (succ, si, insn, SUCCS_NORMAL | SUCCS_SKIP_TO_LOOP_EXITS)
+ {
+ int seqno = INSN_SEQNO (succ);
- if (0 < seqno && seqno <= orig_max_seqno
- && (pipelining_p || INSN_SCHED_TIMES (succ) <= 0))
- {
- bool b = in_same_ebb_p (insn, succ)
- || in_fallthru_bb_p (insn, succ);
+ if (0 < seqno && seqno <= orig_max_seqno
+ && (pipelining_p || INSN_SCHED_TIMES (succ) <= 0))
+ {
+ bool b = in_same_ebb_p (insn, succ)
+ || in_fallthru_bb_p (insn, succ);
- if (sched_verbose >= 1)
- sel_print ("Fence %d continues as %d[%d] (state %s)\n",
- INSN_UID (insn), INSN_UID (succ),
- BLOCK_NUM (succ), b ? "continue" : "reset");
+ if (sched_verbose >= 1)
+ sel_print ("Fence %d continues as %d[%d] (state %s)\n",
+ INSN_UID (insn), INSN_UID (succ),
+ BLOCK_NUM (succ), b ? "continue" : "reset");
- if (b)
- new_fences_add_dirty (new_fences, succ, fence);
- else
- {
- /* Mark block of the SUCC as head of the new ebb. */
- bitmap_set_bit (forced_ebb_heads, BLOCK_NUM (succ));
- new_fences_add_clean (new_fences, succ, fence);
- }
- }
- }
+ if (b)
+ add_dirty_fence_to_fences (new_fences, succ, fence);
+ else
+ {
+ /* Mark block of the SUCC as head of the new ebb. */
+ bitmap_set_bit (forced_ebb_heads, BLOCK_NUM (succ));
+ add_clean_fence_to_fences (new_fences, succ, fence);
+ }
+ }
}
}
/* Functions to support substitution. */
+/* Returns whether INSN with dependence status DS is eligible for
+ substitution, i.e. it's a copy operation x := y, and RHS that is
+ moved up through this insn should be substituted. */
+static bool
+can_substitute_through_p (insn_t insn, ds_t ds)
+{
+ /* We can substitute only true dependencies. */
+ if (!flag_sel_sched_substitution
+ || (ds & DEP_OUTPUT)
+ || (ds & DEP_ANTI)
+ || ! INSN_RHS (insn)
+ || ! INSN_LHS (insn))
+ return false;
+
+ /* Now we just need to make sure the INSN_RHS consists of only one
+ simple REG rtx. */
+ if ((REG_P (INSN_LHS (insn))
+ && (REG_P (INSN_RHS (insn))
+ || GET_CODE (INSN_RHS (insn)) == CONST_INT)))
+ return true;
+ return false;
+}
+
/* Substitute all occurences of INSN's destination in EXPR' vinsn with INSN's
source (if INSN is eligible for substitution). Returns TRUE if
substitution was actually performed, FALSE otherwise. Substitution might
@@ -490,22 +522,17 @@ substitute_reg_in_expr (expr_t expr, insn_t insn)
bool new_insn_valid;
vinsn_t *vi = &EXPR_VINSN (expr);
- if (VINSN_UNIQUE_P (*vi))
- /* Unique vinsns can't play this game. */
- return false;
-
/* Do not try to replace in SET_DEST. Although we'll choose new
register for the RHS, we don't want to change RHS' original reg.
If the insn is not SET, we may still be able to substitute something
in it, and if we're here (don't have deps), it doesn't write INSN's
dest. */
-
where = (VINSN_SEPARABLE_P (*vi)
? &VINSN_RHS (*vi)
: &PATTERN (VINSN_INSN_RTX (*vi)));
/* Substitute if INSN has a form of x:=y and LHS(INSN) occurs in *VI. */
- if (insn_eligible_for_subst_p (insn) && rtx_search (INSN_LHS (insn), *where))
+ if (rtx_search (INSN_LHS (insn), *where))
{
rtx new_insn;
rtx *where_replace;
@@ -1511,7 +1538,7 @@ static ds_t get_spec_check_type_for_insn (insn_t, expr_t);
/* Return true if dependence described by DS can be overcomed. */
static bool
-can_overcome_dep_p (ds_t ds)
+can_speculate_dep_p (ds_t ds)
{
if (spec_info == NULL)
return false;
@@ -1732,17 +1759,17 @@ undo_transformations (av_set_t *av_ptr, rtx insn)
/* Moveup_* helpers for code motion and computing av sets. */
-/* Propagates INSN_TO_MOVE_UP inside an insn group through THROUGH_INSN.
+/* Propagates EXPR inside an insn group through THROUGH_INSN.
The difference from the below function is that only substitution is
performed. */
static enum MOVEUP_EXPR_CODE
-moveup_expr_inside_insn_group (expr_t insn_to_move_up, insn_t through_insn)
+moveup_expr_inside_insn_group (expr_t expr, insn_t through_insn)
{
- vinsn_t vi = EXPR_VINSN (insn_to_move_up);
+ vinsn_t vi = EXPR_VINSN (expr);
ds_t *has_dep_p;
ds_t full_ds;
- full_ds = has_dependence_p (insn_to_move_up, through_insn, &has_dep_p);
+ full_ds = has_dependence_p (expr, through_insn, &has_dep_p);
if (full_ds == 0)
return MOVEUP_EXPR_SAME;
@@ -1753,29 +1780,27 @@ moveup_expr_inside_insn_group (expr_t insn_to_move_up, insn_t through_insn)
/* Can't substitute UNIQUE VINSNs. */
gcc_assert (!VINSN_UNIQUE_P (vi));
- if (flag_sel_sched_substitution
- && insn_eligible_for_subst_p (through_insn))
- {
- if (substitute_reg_in_expr (insn_to_move_up, through_insn))
- {
- EXPR_WAS_SUBSTITUTED (insn_to_move_up) = true;
- return MOVEUP_EXPR_CHANGED;
- }
- }
+ if (can_substitute_through_p (through_insn,
+ has_dep_p[DEPS_IN_RHS])
+ && substitute_reg_in_expr (expr, through_insn))
+ {
+ EXPR_WAS_SUBSTITUTED (expr) = true;
+ return MOVEUP_EXPR_CHANGED;
+ }
}
return MOVEUP_EXPR_NULL;
}
-#define CANT_MOVE_TRAPPING(insn_to_move_up, through_insn) \
- (VINSN_MAY_TRAP_P (EXPR_VINSN (insn_to_move_up)) \
+#define CANT_MOVE_TRAPPING(expr, through_insn) \
+ (VINSN_MAY_TRAP_P (EXPR_VINSN (expr)) \
&& !sel_insn_has_single_succ_p ((through_insn), SUCCS_ALL) \
&& !sel_insn_is_speculation_check (through_insn))
/* True when a conflict on a target register was found during moveup_expr. */
static bool was_target_conflict = false;
-/* Modifies INSN_TO_MOVE_UP so it can be moved through the THROUGH_INSN,
+/* Modifies EXPR so it can be moved through the THROUGH_INSN,
performing necessary transformations. Record the type of transformation
made in PTRANS_TYPE, when it is not NULL. When INSIDE_INSN_GROUP,
permit all dependencies except true ones, and try to remove those
@@ -1783,10 +1808,10 @@ static bool was_target_conflict = false;
non-zero cost dependency exists inside an insn group will be fixed
in tick_check_p instead. */
static enum MOVEUP_EXPR_CODE
-moveup_expr (expr_t insn_to_move_up, insn_t through_insn, bool inside_insn_group,
+moveup_expr (expr_t expr, insn_t through_insn, bool inside_insn_group,
enum local_trans_type *ptrans_type)
{
- vinsn_t vi = EXPR_VINSN (insn_to_move_up);
+ vinsn_t vi = EXPR_VINSN (expr);
insn_t insn = VINSN_INSN_RTX (vi);
bool was_changed = false;
bool as_rhs = false;
@@ -1795,8 +1820,9 @@ moveup_expr (expr_t insn_to_move_up, insn_t through_insn, bool inside_insn_group
/* When inside_insn_group, delegate to the helper. */
if (inside_insn_group)
- return moveup_expr_inside_insn_group (insn_to_move_up, through_insn);
+ return moveup_expr_inside_insn_group (expr, through_insn);
+ /* Deal with unique insns and control dependencies. */
if (VINSN_UNIQUE_P (vi))
{
/* We can move jumps without side-effects or jumps that are
@@ -1846,12 +1872,12 @@ moveup_expr (expr_t insn_to_move_up, insn_t through_insn, bool inside_insn_group
else
gcc_assert (!control_flow_insn_p (insn));
+ /* Deal with data dependencies. */
was_target_conflict = false;
- full_ds = has_dependence_p (insn_to_move_up, through_insn, &has_dep_p);
-
+ full_ds = has_dependence_p (expr, through_insn, &has_dep_p);
if (full_ds == 0)
{
- if (!CANT_MOVE_TRAPPING (insn_to_move_up, through_insn))
+ if (!CANT_MOVE_TRAPPING (expr, through_insn))
return MOVEUP_EXPR_SAME;
}
else
@@ -1862,11 +1888,11 @@ moveup_expr (expr_t insn_to_move_up, insn_t through_insn, bool inside_insn_group
return MOVEUP_EXPR_NULL;
}
- if (full_ds != 0 && can_overcome_dep_p (full_ds))
+ if (full_ds != 0 && can_speculate_dep_p (full_ds))
{
int res;
- res = speculate_expr (insn_to_move_up, full_ds);
+ res = speculate_expr (expr, full_ds);
if (res >= 0)
{
/* Speculation was successful. */
@@ -1889,10 +1915,10 @@ moveup_expr (expr_t insn_to_move_up, insn_t through_insn, bool inside_insn_group
/* Only separable insns can be moved up with the new register.
Anyways, we should mark that the original register is
unavailable. */
- if (!enable_schedule_as_rhs_p || !EXPR_SEPARABLE_P (insn_to_move_up))
+ if (!enable_schedule_as_rhs_p || !EXPR_SEPARABLE_P (expr))
return MOVEUP_EXPR_NULL;
- EXPR_TARGET_AVAILABLE (insn_to_move_up) = false;
+ EXPR_TARGET_AVAILABLE (expr) = false;
was_target_conflict = true;
as_rhs = true;
}
@@ -1919,11 +1945,11 @@ moveup_expr (expr_t insn_to_move_up, insn_t through_insn, bool inside_insn_group
/* Can't substitute UNIQUE VINSNs. */
gcc_assert (!VINSN_UNIQUE_P (vi));
- if (can_overcome_dep_p (*rhs_dsp))
+ if (can_speculate_dep_p (*rhs_dsp))
{
int res;
- res = speculate_expr (insn_to_move_up, *rhs_dsp);
+ res = speculate_expr (expr, *rhs_dsp);
if (res >= 0)
{
/* Speculation was successful. */
@@ -1937,21 +1963,17 @@ moveup_expr (expr_t insn_to_move_up, insn_t through_insn, bool inside_insn_group
else
return MOVEUP_EXPR_NULL;
}
- else if (flag_sel_sched_substitution
- && insn_eligible_for_subst_p (through_insn))
+ else if (can_substitute_through_p (through_insn,
+ *rhs_dsp)
+ && substitute_reg_in_expr (expr, through_insn))
{
- /* Substitute in vinsn. */
- if (substitute_reg_in_expr (insn_to_move_up, through_insn))
- EXPR_WAS_SUBSTITUTED (insn_to_move_up) = true;
- else
- return MOVEUP_EXPR_NULL;
-
/* ??? We cannot perform substitution AND speculation on the same
insn. */
gcc_assert (!was_changed);
was_changed = true;
if (ptrans_type)
*ptrans_type = TRANS_SUBSTITUTION;
+ EXPR_WAS_SUBSTITUTED (expr) = true;
}
else
return MOVEUP_EXPR_NULL;
@@ -1960,7 +1982,7 @@ moveup_expr (expr_t insn_to_move_up, insn_t through_insn, bool inside_insn_group
/* Don't move trapping insns through jumps.
This check should be at the end to give a chance to control speculation
to perform its duties. */
- if (CANT_MOVE_TRAPPING (insn_to_move_up, through_insn))
+ if (CANT_MOVE_TRAPPING (expr, through_insn))
return MOVEUP_EXPR_NULL;
return (was_changed
@@ -3228,7 +3250,7 @@ fill_vec_av_set (av_set_t av, blist_t bnds, fence_t fence)
pipelining, because compensating register copies or speculation
checks are likely to be placed near the beginning of the loop,
causing a stall. */
- if (flag_sel_sched_restrict_pipelining & 1
+ if ((flag_sel_sched_restrict_pipelining & 1)
&& pipelining_p && EXPR_ORIG_SCHED_CYCLE (expr) > 0
&& (!is_orig_reg_p || EXPR_SPEC_DONE_DS (expr) != 0))
{
@@ -3267,7 +3289,7 @@ fill_vec_av_set (av_set_t av, blist_t bnds, fence_t fence)
}
}
- if (flag_sel_sched_restrict_pipelining & 2
+ if ((flag_sel_sched_restrict_pipelining & 2)
&& !pipelining_p
&& INSN_SCHED_CYCLE (insn) > FENCE_CYCLE (fence)
&& (sel_insn_is_speculation_check (insn)
@@ -3281,21 +3303,52 @@ fill_vec_av_set (av_set_t av, blist_t bnds, fence_t fence)
continue;
}
+ /* Don't allow any insns whose data is not yet ready.
+ Check first whether we've already tried them and failed. */
+ if (INSN_UID (insn) < FENCE_READY_TICKS_SIZE (fence)
+ && FENCE_READY_TICKS (fence)[INSN_UID (insn)]
+ > FENCE_CYCLE (fence))
+ {
+ stalled++;
+ VEC_unordered_remove (expr_t, vec_av_set, n);
+
+ if (sched_verbose >= 4)
+ sel_print ("Expr %d is not ready until cycle %d (cached)\n",
+ INSN_UID (insn),
+ FENCE_READY_TICKS (fence)[INSN_UID (insn)]);
+ continue;
+ }
+
+ /* Now resort to dependence analysis to find whether EXPR might be
+ stalled due to dependencies from FENCE's context. */
need_cycles = tick_check_p (expr, dc, fence);
- /* Don't allow any insns whose data is not yet ready. */
if (need_cycles > 0)
- {
- /* We need to know whether we do need to stall for any insns. */
- int new_prio = EXPR_PRIORITY (expr) + need_cycles;
- if (av0_prio < new_prio && EXPR_ORIG_SCHED_CYCLE (expr) <= 0)
- av0_prio = new_prio;
+ {
+ int new_prio = EXPR_PRIORITY (expr) + need_cycles;
+
+ if (av0_prio < new_prio && EXPR_ORIG_SCHED_CYCLE (expr) <= 0)
+ av0_prio = new_prio;
+ if (INSN_UID (insn) >= FENCE_READY_TICKS_SIZE (fence))
+ {
+ int new_size = INSN_UID (insn) * 3 / 2;
+
+ FENCE_READY_TICKS (fence)
+ = xrecalloc (FENCE_READY_TICKS (fence),
+ new_size, FENCE_READY_TICKS_SIZE (fence),
+ sizeof (int));
+ }
+ FENCE_READY_TICKS (fence)[INSN_UID (insn)]
+ = FENCE_CYCLE (fence) + need_cycles;
+
stalled++;
VEC_unordered_remove (expr_t, vec_av_set, n);
+
if (sched_verbose >= 4)
- sel_print ("Expr %d is not ready yet\n",
- INSN_UID (insn));
- continue;
- }
+ sel_print ("Expr %d is not ready yet until cycle %d\n",
+ INSN_UID (insn),
+ FENCE_READY_TICKS (fence)[INSN_UID (insn)]);
+ continue;
+ }
if (sched_verbose >= 4)
sel_print ("Expr %d is ok\n", INSN_UID (insn));
@@ -4182,8 +4235,8 @@ fill_insns (fence_t fence, int seqno, ilist_t **scheduled_insns_tailpp)
state_t temp_state = alloca (dfa_state_size);
if (sched_verbose >= 2)
- sel_print ("\nStarting fill_insns for insn %d, seqno %d\n",
- INSN_UID (insn), seqno);
+ sel_print ("\nStarting fill_insns for insn %d, cycle %d\n",
+ INSN_UID (insn), FENCE_CYCLE (fence));
blist_add (&bnds, insn, NULL, FENCE_DC (fence));
bnds_tailp = &BLIST_NEXT (bnds);
@@ -4623,6 +4676,8 @@ fill_insns (fence_t fence, int seqno, ilist_t **scheduled_insns_tailpp)
}
else
FENCE_SCHED_NEXT (fence) = NULL_RTX;
+ if (INSN_UID (insn) < FENCE_READY_TICKS_SIZE (fence))
+ FENCE_READY_TICKS (fence) [INSN_UID (insn)] = 0;
advance_deps_context (BND_DC (bnd), insn);
@@ -4662,7 +4717,7 @@ fill_insns (fence_t fence, int seqno, ilist_t **scheduled_insns_tailpp)
av_set_clear (&av_vliw);
/* Indicate that we've scheduled something on this fence. */
- FENCE_SCHEDULED_SOMETHING (fence) = true;
+ FENCE_SCHEDULED_P (fence) = true;
scheduled_something_on_previous_fence = true;
/* When can_issue_more is 0, variable_issue tells us that we should
@@ -5824,11 +5879,8 @@ sel_region_init (int rgn)
{
/* We need to treat insns as EXPRes only when renaming is enabled. */
enable_schedule_as_rhs_p = (flag_sel_sched_renaming != 0);
-
bookkeeping_p = (flag_sel_sched_bookkeeping != 0);
-
pipelining_p = bookkeeping_p && (flag_sel_sched_pipelining != 0);
-
reset_sched_cycles_p = (pipelining_p
&& !flag_sel_sched_reschedule_pipelined);
}
@@ -6260,7 +6312,7 @@ sel_sched_region_2 (sel_sched_region_2_data_t data)
{
fence_t f = FLIST_FENCE (fences2);
- if (!FENCE_SCHEDULED (f))
+ if (!FENCE_PROCESSED_P (f))
{
int i = INSN_SEQNO (FENCE_INSN (f));
@@ -6268,7 +6320,6 @@ sel_sched_region_2 (sel_sched_region_2_data_t data)
{
seqno = i;
fence = f;
-
first_p = false;
}
else
@@ -6283,10 +6334,8 @@ sel_sched_region_2 (sel_sched_region_2_data_t data)
/* As FENCE is nonnull, SEQNO is initialized. */
seqno -= max_f + 1;
fill_insns (fence, seqno, &scheduled_insns_tailp);
- FENCE_SCHEDULED (fence) = true;
+ FENCE_PROCESSED_P (fence) = true;
}
- /* This condition gives us the number of iterations equal to the number
- of fence groups in fences. */
while ((fences1 = FLIST_NEXT (fences1)));
fences1 = fences;
@@ -6294,48 +6343,28 @@ sel_sched_region_2 (sel_sched_region_2_data_t data)
{
fence_t fence = FLIST_FENCE (fences1);
insn_t insn;
- state_t state = FENCE_STATE (fence);
if (/* This fence doesn't have any successors. */
!FENCE_BNDS (fence))
{
- if (!FENCE_SCHEDULED_SOMETHING (fence))
+ if (!FENCE_SCHEDULED_P (fence))
/* Nothing was scheduled on this fence. */
{
int seqno;
insn = FENCE_INSN (fence);
seqno = INSN_SEQNO (insn);
-
gcc_assert (seqno > 0 && seqno <= orig_max_seqno);
if (sched_verbose >= 1)
sel_print ("Fence %d[%d] has not changed\n",
INSN_UID (insn),
BLOCK_NUM (insn));
-
- new_fences_add (new_fences,
- insn, state, FENCE_DC (fence),
- FENCE_TC (fence),
- FENCE_LAST_SCHEDULED_INSN (fence),
- FENCE_EXECUTING_INSNS (fence),
- FENCE_SCHED_NEXT (fence),
- FENCE_CYCLE (fence),
- FENCE_ISSUED_INSNS (fence),
- FENCE_STARTS_CYCLE_P (fence),
- FENCE_AFTER_STALL_P (fence));
-
- /* Null these fields so that they won't be freed twice. */
- FENCE_STATE (fence) = NULL;
- FENCE_DC (fence) = NULL;
- FENCE_TC (fence) = NULL;
- FENCE_EXECUTING_INSNS (fence) = NULL;
+ move_fence_to_fences (fences1, new_fences);
}
-
- continue;
}
-
- extract_new_fences_from (fence, new_fences, data);
+ else
+ extract_new_fences_from (fences1, new_fences, data);
}
while ((fences1 = FLIST_NEXT (fences1)));
@@ -6402,7 +6431,6 @@ sel_sched_region_1 (void)
else
init_fences (bb_note (EBB_FIRST_BB (0)));
global_level = 1;
-
max_ws = MAX_WS;
sel_sched_region_2 (data);
@@ -6418,11 +6446,8 @@ sel_sched_region_1 (void)
flist_tail_t new_fences = &_new_fences;
pipelining_p = false;
-
- max_ws = issue_rate * 3 / 2;
-
+ max_ws = MIN (max_ws, issue_rate * 3 / 2);
bookkeeping_p = false;
-
enable_schedule_as_rhs_p = false;
if (!flag_sel_sched_reschedule_pipelined)
@@ -6573,11 +6598,8 @@ sel_sched_region_1 (void)
}
pipelining_p = true;
-
max_ws = MAX_WS;
-
bookkeeping_p = (flag_sel_sched_bookkeeping != 0);
-
enable_schedule_as_rhs_p = true;
}
}
@@ -6648,7 +6670,7 @@ sel_global_init (void)
sel_setup_sched_infos ();
sched_rgn_init (false);
sched_init ();
-
+
/* Init lv_sets. */
{
bb_vec_t bbs = VEC_alloc (basic_block, heap, n_basic_blocks);