summaryrefslogtreecommitdiff
path: root/gcc/sched-deps.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-20 17:19:39 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-20 17:19:39 +0000
commitd6141c0ca920b76a6c3295041c35545e3b5ebb1b (patch)
tree6792bf552c4e374a8b4a117207dec07374ea6a0d /gcc/sched-deps.c
parentc9784e7e0fdcd44fb9c273c241b76f487767e5b6 (diff)
downloadgcc-d6141c0ca920b76a6c3295041c35545e3b5ebb1b.tar.gz
Support scheduling across extended basic blocks
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38400 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-deps.c')
-rw-r--r--gcc/sched-deps.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index b5f73288997..396b519b164 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -913,6 +913,53 @@ sched_analyze_insn (deps, x, insn, loop_notes)
sched_analyze_2 (deps, XEXP (link, 0), insn);
}
+ if (GET_CODE (insn) == JUMP_INSN)
+ {
+ rtx next, u, pending, pending_mem;
+ next = next_nonnote_insn (insn);
+ if (next && GET_CODE (next) == BARRIER)
+ {
+ for (i = 0; i < maxreg; i++)
+ {
+ for (u = deps->reg_last_sets[i]; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ for (u = deps->reg_last_clobbers[i]; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ for (u = deps->reg_last_uses[i]; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ }
+ }
+ else
+ {
+ regset_head tmp;
+ INIT_REG_SET (&tmp);
+
+ (*current_sched_info->compute_jump_reg_dependencies) (insn, &tmp);
+ EXECUTE_IF_SET_IN_REG_SET
+ (&tmp, 0, i,
+ {
+ for (u = deps->reg_last_sets[i]; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ deps->reg_last_uses[i]
+ = alloc_INSN_LIST (insn, deps->reg_last_uses[i]);
+ });
+
+ CLEAR_REG_SET (&tmp);
+ }
+ pending = deps->pending_write_insns;
+ pending_mem = deps->pending_write_mems;
+ while (pending)
+ {
+ add_dependence (insn, XEXP (pending, 0), 0);
+
+ pending = XEXP (pending, 1);
+ pending_mem = XEXP (pending_mem, 1);
+ }
+
+ for (u = deps->last_pending_memory_flush; u; u = XEXP (u, 1))
+ add_dependence (insn, XEXP (u, 0), REG_DEP_ANTI);
+ }
+
/* If there is a {LOOP,EHREGION}_{BEG,END} note in the middle of a basic
block, then we must be sure that no instructions are scheduled across it.
Otherwise, the reg_n_refs info (which depends on loop_depth) would