aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2012-09-19 19:37:31 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2012-09-19 19:37:31 +0000
commit1a83e602a157b844ed98d0dab832c1240ed6bf4b (patch)
tree379bbdd61db7200439ea249c13f2b0c2c5b8fefc /gcc/config
parent7b49d6db24d87f69458eaa3712445741997e80c7 (diff)
downloadgcc-1a83e602a157b844ed98d0dab832c1240ed6bf4b.zip
gcc-1a83e602a157b844ed98d0dab832c1240ed6bf4b.tar.gz
gcc-1a83e602a157b844ed98d0dab832c1240ed6bf4b.tar.bz2
dbgcnt.def (sched_breakdep): New counter.
* dbgcnt.def (sched_breakdep): New counter. * haifa-sched.c (update_insn_after_change): New static function, broken out of haifa_change_pattern. (haifa_change_pattern): Call it. (dep_t heap vecs): Declare. (INSN_COST): Define earlier. (next_cycle_replace_deps, next_cycle_apply): New static variables. (apply_replacement): New static function. (recompute_todo_spec): New argument FOR_BACKTRACK. All callers changed. Handle DEP_REPLACE deps. (contributes_to_priority_p): False for replaceable deps. (must_restore_pattern_p, restore_pattern): New static functions. (schedule_insn): Use them. Apply replacements for broken deps. (struct haifa_saved_data): Add new fields to keep track of replacements. (save_backtrack_point): Initialize them. (undo_replacements_for_backtrack): New static function. (restore_last_backtrack_point, free_topmost_backtrack_point): Use it and keep track of replacements. (perform_replacements_new_cycle, undo_all_replacements): New static functions. (schedule_block): Call these two as necessary. Call find_modifiable_mems. (try_ready): Tweak the assert. Check for DEP_POSTPONED. * sched-deps.c: Include "emit-rtl.h". (init_dep_1): Initialize DEP_NONREG, DEP_MULTIPLE and DEP_REPLACE. (dep_spec_p): True for DEP_REPLACE deps. (mark_as_hard): New static variable. (update_dep): Update DEP_NONREG and DEP_MULTIPLE. (add_dependence_list): New argument hard. All callers changed. Set and clear mark_as_hard around function body. (add_dependence_list_and_free): Likewise. (haifa_note_mem_dep): Set DEP_NONREG. (haifa_note_dep): Likewise if mark_as_hard is true. (sched_analyze_insn): Switch loop with if statement testing for sel_sched_p. (struct mem_inc_info): New. (attempt_change, parse_add_or_inc, find_inc, find_mem): New static functions. (find_modifiable_mems): New function. * sched-int.h (struct dep_replacement): New. (struct _dep): Add replace, nonreg and multiple fields. Make type and cost bitfields. (UNKNOWN_DEP_COST): Change to match the bitfield. (DEP_NONREG, DEP_MULTIPLE, DEP_REPLACE): New macros. (DEP_POSTPONED): New macro. (DEP_CANCELLED): Renumber. (find_modifiable_mems): Declare. (enum SCHED_FLAGS): Add DONT_BREAK_DEPENDENCIES. * sched-rgn.c (init_ready_list): Set TODO_SPEC here. (new_ready): Don't set HARD_DEP, use DEP_POSTPONED. (debug_dependencies): Dump DEP_NONREG and DEP_MULTIPLE. * Makefile.in (sched-deps.o): Update dependencies. * config/c6x/c6x.c (in_hwloop): New static variable. (c6x_set_sched_flags): If it is true, add DONT_BREAK_DEPENDENCIES. (hwloop_optimize): Set and clear it around preliminary scheduling pass. From-SVN: r191493
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/c6x/c6x.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
index 1905504..e894882 100644
--- a/gcc/config/c6x/c6x.c
+++ b/gcc/config/c6x/c6x.c
@@ -3912,6 +3912,13 @@ c6x_free_sched_context (void *_sc)
free (_sc);
}
+/* True if we are currently performing a preliminary scheduling
+ pass before modulo scheduling; we can't allow the scheduler to
+ modify instruction patterns using packetization assumptions,
+ since there will be another scheduling pass later if modulo
+ scheduling fails. */
+static bool in_hwloop;
+
/* Provide information about speculation capabilities, and set the
DO_BACKTRACKING flag. */
static void
@@ -3923,6 +3930,8 @@ c6x_set_sched_flags (spec_info_t spec_info)
{
*flags |= DO_BACKTRACKING | DO_PREDICATION;
}
+ if (in_hwloop)
+ *flags |= DONT_BREAK_DEPENDENCIES;
spec_info->mask = 0;
}
@@ -5536,9 +5545,11 @@ hwloop_optimize (hwloop_info loop)
reshuffle_units (loop->head);
+ in_hwloop = true;
schedule_ebbs_init ();
schedule_ebb (BB_HEAD (loop->tail), loop->loop_end, true);
schedule_ebbs_finish ();
+ in_hwloop = false;
bb = loop->head;
loop_earliest = bb_earliest_end_cycle (bb, loop->loop_end) + 1;