diff options
author | Maxim Kuvyrkov <maxim@codesourcery.com> | 2009-07-09 18:15:22 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <mkuvyrkov@gcc.gnu.org> | 2009-07-09 18:15:22 +0000 |
commit | 356c23b3059cc4516ee59c51ab0947a4308624ac (patch) | |
tree | 3cb914bdfcf5212d19e7a8855b5c111e763388ba /gcc/haifa-sched.c | |
parent | 5223c588529b44e0538b2b99e48c2cce6f96818b (diff) | |
download | gcc-356c23b3059cc4516ee59c51ab0947a4308624ac.zip gcc-356c23b3059cc4516ee59c51ab0947a4308624ac.tar.gz gcc-356c23b3059cc4516ee59c51ab0947a4308624ac.tar.bz2 |
haifa-sched.c (insn_finishes_cycle_p): New static function.
* haifa-sched.c (insn_finishes_cycle_p): New static function.
(max_issue): Use it.
* sched-int.h (struct sched_info: insn_finishes_block_p): New
scheduler hook.
* sched-rgn.c (rgn_insn_finishes_block_p): Implement it.
(region_sched_info): Update.
* sched-ebb.c (ebb_sched_info): Update.
* modulo-sched.c (sms_sched_info): Update.
* sel-sched-ir.c (sched_sel_haifa_sched_info): Update.
From-SVN: r149427
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r-- | gcc/haifa-sched.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index eff10c8..66be7e5 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -1990,6 +1990,23 @@ move_insn (rtx insn, rtx last, rtx nt) SCHED_GROUP_P (insn) = 0; } +/* Return true if scheduling INSN will finish current clock cycle. */ +static bool +insn_finishes_cycle_p (rtx insn) +{ + if (SCHED_GROUP_P (insn)) + /* After issuing INSN, rest of the sched_group will be forced to issue + in order. Don't make any plans for the rest of cycle. */ + return true; + + /* Finishing the block will, apparently, finish the cycle. */ + if (current_sched_info->insn_finishes_block_p + && current_sched_info->insn_finishes_block_p (insn)) + return true; + + return false; +} + /* The following structure describe an entry of the stack of choices. */ struct choice_entry { @@ -2168,7 +2185,10 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state, delay = state_transition (state, insn); if (delay < 0) { - if (state_dead_lock_p (state)) + if (state_dead_lock_p (state) + || insn_finishes_cycle_p (insn)) + /* We won't issue any more instructions in the next + choice_state. */ top->rest = 0; else top->rest--; |