+2019-12-20 Roman Zhuykov <zhroma@ispras.ru>
+
+ Backport from mainline
+ 2019-12-13 Roman Zhuykov <zhroma@ispras.ru>
+
+ PR rtl-optimization/92591
+ * modulo-sched.c (ps_add_node_check_conflicts): Improve checking
+ for history > 0 case.
+ * params.def (sms-dfa-history): Limit to 16.
+
2019-12-19 Georg-Johann Lay <avr@gjlay.de>
Backport support for some AVR devices from avrxmega3 family
int c, sbitmap must_precede,
sbitmap must_follow)
{
- int has_conflicts = 0;
+ int i, first, amount, has_conflicts = 0;
ps_insn_ptr ps_i;
/* First add the node to the PS, if this succeeds check for
if (! (ps_i = add_node_to_ps (ps, n, c, must_precede, must_follow)))
return NULL; /* Failed to insert the node at the given cycle. */
- has_conflicts = ps_has_conflicts (ps, c, c)
- || (ps->history > 0
- && ps_has_conflicts (ps,
- c - ps->history,
- c + ps->history));
-
- /* Try different issue slots to find one that the given node can be
- scheduled in without conflicts. */
- while (has_conflicts)
+ while (1)
{
+ has_conflicts = ps_has_conflicts (ps, c, c);
+ if (ps->history > 0 && !has_conflicts)
+ {
+ /* Check all 2h+1 intervals, starting from c-2h..c up to c..2h,
+ but not more than ii intervals. */
+ first = c - ps->history;
+ amount = 2 * ps->history + 1;
+ if (amount > ps->ii)
+ amount = ps->ii;
+ for (i = first; i < first + amount; i++)
+ {
+ has_conflicts = ps_has_conflicts (ps,
+ i - ps->history,
+ i + ps->history);
+ if (has_conflicts)
+ break;
+ }
+ }
+ if (!has_conflicts)
+ break;
+ /* Try different issue slots to find one that the given node can be
+ scheduled in without conflicts. */
if (! ps_insn_advance_column (ps, ps_i, must_follow))
break;
- has_conflicts = ps_has_conflicts (ps, c, c)
- || (ps->history > 0
- && ps_has_conflicts (ps,
- c - ps->history,
- c + ps->history));
}
if (has_conflicts)
DEFPARAM(PARAM_SMS_DFA_HISTORY,
"sms-dfa-history",
"The number of cycles the swing modulo scheduler considers when checking conflicts using DFA.",
- 0, 0, 0)
+ 0, 0, 16)
DEFPARAM(PARAM_SMS_LOOP_AVERAGE_COUNT_THRESHOLD,
"sms-loop-average-count-threshold",
"A threshold on the average loop count considered by the swing modulo scheduler.",
+2019-12-20 Roman Zhuykov <zhroma@ispras.ru>
+
+ Backport from mainline
+ 2019-12-13 Roman Zhuykov <zhroma@ispras.ru>
+
+ PR rtl-optimization/92591
+ * gcc.dg/pr92951-1.c: New test.
+ * gcc.dg/pr92951-2.c: New test.
+
2019-12-17 Andreas Krebbel <krebbel@linux.ibm.com>
Backport from mainline