Commit 2db45993 by Jeffrey A Law Committed by Jeff Law

haifa-sched.c (rank_for_schedule): For "equally good insns", prefer the insn…

haifa-sched.c (rank_for_schedule): For "equally good insns", prefer the insn which has the most insns dependent on it.

        * haifa-sched.c (rank_for_schedule): For "equally good insns", prefer
        the insn which has the most insns dependent on it.

From-SVN: r20243
parent 192231fb
Fri Jun 5 12:29:28 1998 Jeffrey A Law (law@cygnus.com)
* haifa-sched.c (rank_for_schedule): For "equally good insns", prefer
the insn which has the most insns dependent on it.
Fri Jun 5 09:03:22 1998 John Carr <jfc@mit.edu> Fri Jun 5 09:03:22 1998 John Carr <jfc@mit.edu>
* alias.c (find_base_value): Avoid reading past end of reg_base_value. * alias.c (find_base_value): Avoid reading past end of reg_base_value.
......
...@@ -87,7 +87,8 @@ ...@@ -87,7 +87,8 @@
broken by broken by
6. choose insn with the least dependences upon the previously 6. choose insn with the least dependences upon the previously
scheduled insn, or finally scheduled insn, or finally
7. choose insn with lowest UID. 7 choose the insn which has the most insns dependent on it.
8. choose insn with lowest UID.
Memory references complicate matters. Only if we can be certain Memory references complicate matters. Only if we can be certain
that memory references are not part of the data dependency graph that memory references are not part of the data dependency graph
...@@ -4029,7 +4030,7 @@ rank_for_schedule (x, y) ...@@ -4029,7 +4030,7 @@ rank_for_schedule (x, y)
rtx tmp = *(rtx *)y; rtx tmp = *(rtx *)y;
rtx tmp2 = *(rtx *)x; rtx tmp2 = *(rtx *)x;
rtx link; rtx link;
int tmp_class, tmp2_class; int tmp_class, tmp2_class, depend_count1, depend_count2;
int val, priority_val, spec_val, prob_val, weight_val; int val, priority_val, spec_val, prob_val, weight_val;
...@@ -4090,6 +4091,21 @@ rank_for_schedule (x, y) ...@@ -4090,6 +4091,21 @@ rank_for_schedule (x, y)
return val; return val;
} }
/* Prefer the insn which has more later insns that depend on it.
This gives the scheduler more freedom when scheduling later
instructions at the expense of added register pressure. */
depend_count1 = 0;
for (link = INSN_DEPEND (tmp); link; link = XEXP (link, 1))
depend_count1++;
depend_count2 = 0;
for (link = INSN_DEPEND (tmp2); link; link = XEXP (link, 1))
depend_count2++;
val = depend_count2 - depend_count1;
if (val)
return val;
/* If insns are equally good, sort by INSN_LUID (original insn order), /* If insns are equally good, sort by INSN_LUID (original insn order),
so that we make the sort stable. This minimizes instruction movement, so that we make the sort stable. This minimizes instruction movement,
thus minimizing sched's effect on debugging and cross-jumping. */ thus minimizing sched's effect on debugging and cross-jumping. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment