+2018-04-09 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/83913
+
+ * sel-sched-ir.c (merge_expr_data): Choose the middle between two
+ different sched-times when merging exprs.
+
2018-04-09 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/83962
if (EXPR_PRIORITY (to) < EXPR_PRIORITY (from))
EXPR_PRIORITY (to) = EXPR_PRIORITY (from);
- if (EXPR_SCHED_TIMES (to) > EXPR_SCHED_TIMES (from))
- EXPR_SCHED_TIMES (to) = EXPR_SCHED_TIMES (from);
+ /* We merge sched-times half-way to the larger value to avoid the endless
+ pipelining of unneeded insns. The average seems to be good compromise
+ between pipelining opportunities and avoiding extra work. */
+ if (EXPR_SCHED_TIMES (to) != EXPR_SCHED_TIMES (from))
+ EXPR_SCHED_TIMES (to) = ((EXPR_SCHED_TIMES (from) + EXPR_SCHED_TIMES (to)
+ + 1) / 2);
if (EXPR_ORIG_BB_INDEX (to) != EXPR_ORIG_BB_INDEX (from))
EXPR_ORIG_BB_INDEX (to) = 0;
+2018-04-09 Andrey Belevantsev <abel@ispras.ru>
+
+ PR rtl-optimization/83913
+ * gcc.dg/pr83913.c: New test.
+
2018-04-09 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/83962
--- /dev/null
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -funroll-all-loops -fselective-scheduling -fsel-sched-pipelining -fschedule-insns -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop -fno-web" } */
+
+int jo, z4;
+
+int
+be (long unsigned int l7, int nt)
+{
+ int en;
+
+ jo = l7;
+ for (en = 0; en < 24; ++en)
+ {
+ jo = (jo / z4) * (!!jo >= ((!!nt) & 2));
+ if (jo == 0)
+ nt = 0;
+ else
+ {
+ nt = z4;
+ ++z4;
+ nt = (long unsigned int) nt == (l7 + 1);
+ }
+ }
+
+ return nt;
+}