summaryrefslogtreecommitdiff
path: root/gcc/sched-ebb.c
diff options
context:
space:
mode:
authormkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-16 05:17:41 +0000
committermkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-16 05:17:41 +0000
commit4d64d9a4aa22d73b5197c4d173120885d80493bd (patch)
tree9ddbe18a95fcd89be1c80f461b8e96c3764df6ce /gcc/sched-ebb.c
parent439ce31f0e0ca4964b5927ddcaa8f0de7423caa4 (diff)
downloadgcc-4d64d9a4aa22d73b5197c4d173120885d80493bd.tar.gz
2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
Andrey Belevantsev <abel@ispras.ru> * ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. * lists.c (unused_deps_list): New variable. (free_list): Add assertions to verify the proper distinguishing between INSN_LISTs and DEPS_LISTs. (find_list_elem, remove_list_elem, remove_list_node): New static functions. (alloc_DEPS_LIST, free_DEPS_LIST, free_DEPS_LIST_node, remove_free_INSN_LIST_elem, remove_free_DEPS_LIST_elem, remove_free_INSN_LIST_node, remove_free_DEPS_LIST_node): New functions. (alloc_INSN_LIST): Assert that the list we're working on is indeed an INSN_LIST. (free_INSN_LIST_node): Likewise. * modulo-sched.c (current_sched_info): Initialize flags field. * reg-notes.def: Exchange DEP_ANTI and DEP_OUTPUT. * rtl.def (DEPS_LIST): Define. * rtl.h: Declare new functions from lists.c. * sched-deps.c (spec_dependency_cache): New static variable. (maybe_add_or_update_back_dep_1, add_back_dep): New static functions. (add_dependence): Change return type to void. Move the logic to ... (add_or_update_back_dep_1): ... here. Handle speculative dependencies. (delete_all_dependences): Add comment about forward_dependency_cache. Handle spec_dependency_cache. Handle DEPS_LISTs. (fixup_sched_groups): Clarify the change of priority of output and anti dependencies. (sched_analyze_2): Adjust add_dependence calls to create data speculative dependence. (add_forward_dependence): Renamed to add_forw_dep, change prototype. Adjust all callers. Handle DEPS_LISTS. (compute_forward_dependences): Use add_forw_dep. Sort LOG_LINKs in presence of speculation. (init_dependency_caches, free_dependency_caches): Handle spec_dependency_cache. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep, delete_forw_dep, estimate_dep_weak, get_dep_weak, ds_merge, check_dep_status): New static functions. (add_or_update_back_dep, add_or_update_back_forw_dep, add_back_forw_dep, delete_back_forw_dep): New functions. * sched-int.h (ds_t, dw_t): New typedefs. (struct sched_info): Add new field flags. (struct haifa_insn_data): Add new bitfield has_internal_dep. Prototype new sched-deps.c functions. (HAS_INTERNAL_DEP, DEP_STATUS): New access macros. (BITS_PER_DEP_STATUS, BITS_PER_DEP_WEAK, DEP_WEAK_MASK, MAX_DEP_WEAK, MIN_DEP_WEAK, NO_DEP_WEAK, UNCERTAIN_DEP_WEAK, BEGIN_DATA, BE_IN_DATA, BEGIN_CONTROL, BE_IN_CONTROL, BEGIN_SPEC, DATA_SPEC, CONTROL_SPEC, SPECULATIVE, BE_IN_SPEC, FIRST_SPEC_TYPE, LAST_SPEC_TYPE, SPEC_TYPE_SHIFT, DEP_TRUE, DEP_OUTPUT, DEP_ANTI, DEP_TYPES, HARD_DEP): New constants. (enum SPEC_TYPES_OFFSETS, enum DEPS_ADJUST_RESULT, enum SCHED_FLAGS): New enums. * sched-rgn.c (current_sched_info): Initialize flags field. (schedule_insns): Initialize current_sched_info before the sched_init call. * sched-ebb.c (current_sched_info): Initialize flags field. (add_deps_for_risky_insns): Use control_flow_insn_p instead of JUMP_P. Call add_or_update_back_dep instead of add_dependence. Create control speculative dependencies. (schedule_insns): Initialize current_sched_info before the sched_init call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112125 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-ebb.c')
-rw-r--r--gcc/sched-ebb.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index d5391d0b5df..2fa454df238 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -205,7 +205,9 @@ static struct sched_info ebb_sched_info =
NULL, NULL,
NULL, NULL,
- 0, 1, 0
+ 0, 1, 0,
+
+ 0
};
/* It is possible that ebb scheduling eliminated some blocks.
@@ -421,7 +423,7 @@ add_deps_for_risky_insns (rtx head, rtx tail)
basic_block last_block = NULL, bb;
for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
- if (JUMP_P (insn))
+ if (control_flow_insn_p (insn))
{
bb = BLOCK_FOR_INSN (insn);
bb->aux = last_block;
@@ -455,9 +457,27 @@ add_deps_for_risky_insns (rtx head, rtx tail)
/* We can not change the mode of the backward
dependency because REG_DEP_ANTI has the lowest
rank. */
- if (! sched_insns_conditions_mutex_p (insn, prev)
- && add_dependence (insn, prev, REG_DEP_ANTI))
- add_forward_dependence (prev, insn, REG_DEP_ANTI);
+ if (! sched_insns_conditions_mutex_p (insn, prev))
+ {
+ if (!(current_sched_info->flags & DO_SPECULATION))
+ {
+ enum DEPS_ADJUST_RESULT res;
+
+ res = add_or_update_back_dep (insn, prev,
+ REG_DEP_ANTI, DEP_ANTI);
+
+ if (res == DEP_CREATED)
+ add_forw_dep (insn, LOG_LINKS (insn));
+ else
+ gcc_assert (res != DEP_CHANGED);
+ }
+ else
+ add_or_update_back_forw_dep (insn, prev, REG_DEP_ANTI,
+ set_dep_weak (DEP_ANTI,
+ BEGIN_CONTROL,
+ MAX_DEP_WEAK));
+ }
+
break;
default:
@@ -571,10 +591,12 @@ schedule_ebbs (void)
if (n_basic_blocks == NUM_FIXED_BLOCKS)
return;
- sched_init ();
-
+ /* We need current_sched_info in init_dependency_caches, which is
+ invoked via sched_init. */
current_sched_info = &ebb_sched_info;
+ sched_init ();
+
compute_bb_for_insn ();
/* Schedule every region in the subroutine. */