]> git.ipfire.org Git - thirdparty/gcc.git/commit
modulo-sched: Carefully process loop counter initialization [PR97421]
authorRoman Zhuykov <zhroma@ispras.ru>
Thu, 24 Dec 2020 16:43:40 +0000 (19:43 +0300)
committerRoman Zhuykov <zhroma@ispras.ru>
Thu, 24 Dec 2020 16:43:40 +0000 (19:43 +0300)
commit0963fa93dcc47d290d1597ff88ff162f5bdd1b13
tree6083692190ce9093a59c65262121bf4348655d02
parente73caa0fc12e4b33563d68ee58b8af882b2341e6
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.

(cherry picked from commit 4eb8f93d026eaa1de9b4820337069f3ce3465cd0)
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]