summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/sched-ebb.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/sched-ebb.c')
-rw-r--r--contrib/gcc/sched-ebb.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/contrib/gcc/sched-ebb.c b/contrib/gcc/sched-ebb.c
index e9d7482..47dd83f 100644
--- a/contrib/gcc/sched-ebb.c
+++ b/contrib/gcc/sched-ebb.c
@@ -52,7 +52,8 @@ static int schedule_more_p PARAMS ((void));
static const char *ebb_print_insn PARAMS ((rtx, int));
static int rank PARAMS ((rtx, rtx));
static int contributes_to_priority PARAMS ((rtx, rtx));
-static void compute_jump_reg_dependencies PARAMS ((rtx, regset));
+static void compute_jump_reg_dependencies PARAMS ((rtx, regset, regset,
+ regset));
static void schedule_ebb PARAMS ((rtx, rtx));
/* Return nonzero if there are more insns that should be scheduled. */
@@ -160,22 +161,30 @@ contributes_to_priority (next, insn)
return 1;
}
-/* INSN is a JUMP_INSN. Store the set of registers that must be considered
- to be set by this jump in SET. */
+/* INSN is a JUMP_INSN, COND_SET is the set of registers that are
+ conditionally set before INSN. Store the set of registers that
+ must be considered as used by this jump in USED and that of
+ registers that must be considered as set in SET. */
static void
-compute_jump_reg_dependencies (insn, set)
+compute_jump_reg_dependencies (insn, cond_set, used, set)
rtx insn;
- regset set;
+ regset cond_set, used, set;
{
basic_block b = BLOCK_FOR_INSN (insn);
edge e;
for (e = b->succ; e; e = e->succ_next)
- if ((e->flags & EDGE_FALLTHRU) == 0)
- {
- bitmap_operation (set, set, e->dest->global_live_at_start,
- BITMAP_IOR);
- }
+ if (e->flags & EDGE_FALLTHRU)
+ /* The jump may be a by-product of a branch that has been merged
+ in the main codepath after being conditionalized. Therefore
+ it may guard the fallthrough block from using a value that has
+ conditionally overwritten that of the main codepath. So we
+ consider that it restores the value of the main codepath. */
+ bitmap_operation (set, e->dest->global_live_at_start, cond_set,
+ BITMAP_AND);
+ else
+ bitmap_operation (used, used, e->dest->global_live_at_start,
+ BITMAP_IOR);
}
/* Used in schedule_insns to initialize current_sched_info for scheduling
OpenPOWER on IntegriCloud