summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authormkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-07 11:16:16 +0000
committermkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-07 11:16:16 +0000
commit79be434401a6144c41aacacccc06a07cc28b6030 (patch)
tree6d177538c49fa7953215baff16336a58aeaecf0c /gcc
parentbcc93a18377db427ffcd28fd8ab5f82e047928c6 (diff)
downloadgcc-79be434401a6144c41aacacccc06a07cc28b6030.tar.gz
Fix INSN_TICK heuristic for SCHED_PRESSURE
* haifa-sched.c (rank_for_schedule): Fix INSN_TICK-based heuristics. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213708 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/haifa-sched.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f5e63955f31..b6f03630890 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2014-08-07 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
+
+ * haifa-sched.c (rank_for_schedule): Fix INSN_TICK-based heuristics.
+
2014-08-07 Ilya Tocar <ilya.tocar@intel.com>
* config/i386/sse.md (vec_extract_lo_<mode><mask_name>): Fix
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index fb15e0db882..a33186d45cb 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -2584,14 +2584,11 @@ rank_for_schedule (const void *x, const void *y)
}
if (sched_pressure != SCHED_PRESSURE_NONE
- && (INSN_TICK (tmp2) > clock_var || INSN_TICK (tmp) > clock_var))
+ && (INSN_TICK (tmp2) > clock_var || INSN_TICK (tmp) > clock_var)
+ && INSN_TICK (tmp2) != INSN_TICK (tmp))
{
- if (INSN_TICK (tmp) <= clock_var)
- return -1;
- else if (INSN_TICK (tmp2) <= clock_var)
- return 1;
- else
- return INSN_TICK (tmp) - INSN_TICK (tmp2);
+ diff = INSN_TICK (tmp) - INSN_TICK (tmp2);
+ return diff;
}
/* If we are doing backtracking in this schedule, prefer insns that
@@ -2676,10 +2673,9 @@ rank_for_schedule (const void *x, const void *y)
}
/* Prefer instructions that occur earlier in the model schedule. */
- if (sched_pressure == SCHED_PRESSURE_MODEL)
+ if (sched_pressure == SCHED_PRESSURE_MODEL
+ && INSN_BB (tmp) == target_bb && INSN_BB (tmp2) == target_bb)
{
- int diff;
-
diff = model_index (tmp) - model_index (tmp2);
if (diff != 0)
return diff;