summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-30 15:33:18 +0000
committermkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-30 15:33:18 +0000
commit611a596b7f5688ec42abf08e46b7fb2e56bd47ab (patch)
treedbed31a44e1dfb141866940a1e2a936d2d37c2fe
parenta92178b81b2df7eded22e5116545c61c2ca0c045 (diff)
downloadppe42-gcc-611a596b7f5688ec42abf08e46b7fb2e56bd47ab.tar.gz
ppe42-gcc-611a596b7f5688ec42abf08e46b7fb2e56bd47ab.zip
2006-03-30 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
* haifa-sched.c (try_ready): Change condition to restore non-speculative pattern of the instruction. (process_insn_depend_be_in_spec): Code to keep probability of the speculative dependence non-decreasing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112537 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/haifa-sched.c49
2 files changed, 42 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a23dd7bb997..902cf75af3a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2006-03-30 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
+
+ * haifa-sched.c (try_ready): Change condition to restore
+ non-speculative pattern of the instruction.
+ (process_insn_depend_be_in_spec): Code to keep probability of the
+ speculative dependence non-decreasing.
+
2006-03-30 Jie Zhang <jie.zhang@analog.com>
* config/bfin/bfin.c (single_move_for_strmov): Renamed to...
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 56abcda64e2..4825189b034 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -1,6 +1,6 @@
/* Instruction scheduling pass.
- Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
and currently maintained by, Jim Wilson (wilson@cygnus.com)
@@ -3055,16 +3055,6 @@ try_ready (rtx next)
|| !RECOVERY_BLOCK (next)
|| RECOVERY_BLOCK (next) == EXIT_BLOCK_PTR);
- if (*ts == 0 && ORIG_PAT (next) && !RECOVERY_BLOCK (next))
- /* We should change pattern of every previously speculative
- instruction - and we determine if NEXT was speculative by using
- ORIG_PAT field. Except one case - simple checks have ORIG_PAT
- pat too, hence we also check for the RECOVERY_BLOCK. */
- {
- change_pattern (next, ORIG_PAT (next));
- ORIG_PAT (next) = 0;
- }
-
if (*ts & HARD_DEP)
{
/* We can't assert (QUEUE_INDEX (next) == QUEUE_NOWHERE) here because
@@ -3075,6 +3065,15 @@ try_ready (rtx next)
change_queue_index (next, QUEUE_NOWHERE);
return -1;
}
+ else if (!(*ts & BEGIN_SPEC) && ORIG_PAT (next) && !RECOVERY_BLOCK (next))
+ /* We should change pattern of every previously speculative
+ instruction - and we determine if NEXT was speculative by using
+ ORIG_PAT field. Except one case - simple checks have ORIG_PAT
+ pat too, hence we also check for the RECOVERY_BLOCK. */
+ {
+ change_pattern (next, ORIG_PAT (next));
+ ORIG_PAT (next) = 0;
+ }
if (sched_verbose >= 2)
{
@@ -3312,8 +3311,30 @@ process_insn_depend_be_in_spec (rtx link, rtx twin, ds_t fs)
ds = DEP_STATUS (link);
- if (fs && (ds & DEP_TYPES) == DEP_TRUE)
- ds = (ds & ~BEGIN_SPEC) | fs;
+ if (/* If we want to create speculative dep. */
+ fs
+ /* And we can do that because this is a true dep. */
+ && (ds & DEP_TYPES) == DEP_TRUE)
+ {
+ gcc_assert (!(ds & BE_IN_SPEC));
+
+ if (/* If this dep can be overcomed with 'begin speculation'. */
+ ds & BEGIN_SPEC)
+ /* Then we have a choice: keep the dep 'begin speculative'
+ or transform it into 'be in speculative'. */
+ {
+ if (/* In try_ready we assert that if insn once became ready
+ it can be removed from the ready (or queue) list only
+ due to backend decision. Hence we can't let the
+ probability of the speculative dep to decrease. */
+ dep_weak (ds) <= dep_weak (fs))
+ /* Transform it to be in speculative. */
+ ds = (ds & ~BEGIN_SPEC) | fs;
+ }
+ else
+ /* Mark the dep as 'be in speculative'. */
+ ds |= fs;
+ }
add_back_forw_dep (consumer, twin, REG_NOTE_KIND (link), ds);
}
OpenPOWER on IntegriCloud