sched-rgn: run add_branch_dependencies for sel-sched (PR 84301)

PR target/84301
	* sched-rgn.c (add_branch_dependences): Move sel_sched_p check here...
	(compute_block_dependences): ... from here.

testsuite/
	* gcc.target/i386/pr84301.c: New test.

From-SVN: r259321
This commit is contained in:
Alexander Monakov 2018-04-11 17:32:32 +03:00 committed by Alexander Monakov
parent 52cdcfb7b4
commit a87a01ea37
4 changed files with 32 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2018-04-11 Alexander Monakov <amonakov@ispras.ru>
PR target/84301
* sched-rgn.c (add_branch_dependences): Move sel_sched_p check here...
(compute_block_dependences): ... from here.
2018-04-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/85331

View File

@ -2497,6 +2497,11 @@ add_branch_dependences (rtx_insn *head, rtx_insn *tail)
while (insn != head && DEBUG_INSN_P (insn));
}
/* Selective scheduling handles control dependencies by itself, and
CANT_MOVE flags ensure that other insns will be kept in place. */
if (sel_sched_p ())
return;
/* Make sure these insns are scheduled last in their block. */
insn = last;
if (insn != 0)
@ -2725,9 +2730,7 @@ compute_block_dependences (int bb)
sched_analyze (&tmp_deps, head, tail);
/* Selective scheduling handles control dependencies by itself. */
if (!sel_sched_p ())
add_branch_dependences (head, tail);
add_branch_dependences (head, tail);
if (current_nr_blocks > 1)
propagate_deps (bb, &tmp_deps);

View File

@ -1,3 +1,8 @@
2018-04-11 Alexander Monakov <amonakov@ispras.ru>
PR target/84301
* gcc.target/i386/pr84301.c: New test.
2018-04-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/85331

View File

@ -0,0 +1,15 @@
/* PR target/84301 */
/* { dg-do compile } */
/* { dg-options "-march=bdver1 -O1 -fexpensive-optimizations -fschedule-insns -fselective-scheduling -fno-dce -fno-tree-dce --param max-pending-list-length=0 --param selsched-max-lookahead=2" } */
int lr;
long int xl;
int
v4 (void)
{
int mp;
++xl;
mp = (lr - xl) > 1;
}