modulo-sched: Carefully process loop counter initialization [PR97421]
authorRoman Zhuykov <zhroma@ispras.ru>
Sat, 5 Dec 2020 15:45:27 +0000 (18:45 +0300)
committerRoman Zhuykov <zhroma@ispras.ru>
Sat, 5 Dec 2020 15:45:27 +0000 (18:45 +0300)
commit4eb8f93d026eaa1de9b4820337069f3ce3465cd0
tree634fd95b9a60f6e2a837980a61318d109a29605a
parent7ae210d5db5eb96989b2f639e65678b5597e61f0
modulo-sched: Carefully process loop counter initialization [PR97421]

Do not allow direct adjustment of pre-header initialization instruction for
count register if is read in some instruction below in that basic block.

gcc/ChangeLog:

PR rtl-optimization/97421
* modulo-sched.c (generate_prolog_epilog): Remove forward
declaration, adjust last argument name and type.
(const_iteration_count): Add bool pointer parameter to return
whether count register is read in pre-header after its
initialization.
(sms_schedule): Fix count register initialization adjustment
procedure according to what const_iteration_count said.

gcc/testsuite/ChangeLog:

PR rtl-optimization/97421
* gcc.c-torture/execute/pr97421-1.c: New test.
* gcc.c-torture/execute/pr97421-2.c: New test.
* gcc.c-torture/execute/pr97421-3.c: New test.
gcc/modulo-sched.c
gcc/testsuite/gcc.c-torture/execute/pr97421-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr97421-2.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr97421-3.c [new file with mode: 0644]