modulo-sched: skip loops with strange register defs [PR100225]
authorRoman Zhuykov <zhroma@ispras.ru>
Fri, 30 Apr 2021 08:08:03 +0000 (11:08 +0300)
committerRoman Zhuykov <zhroma@ispras.ru>
Fri, 30 Apr 2021 08:08:03 +0000 (11:08 +0300)
commit4cf3b10f27b1994cf4a9eb12079d85412ebc7cad
treebb167747d3cbab6271804ab972913459d96ae480
parent17f2908fcf058e145cff275966e34f8c7f57c2c5
modulo-sched: skip loops with strange register defs [PR100225]

PR84878 fix adds an assertion which can fail, e.g. when stack pointer
is adjusted inside the loop.  We have to prevent it and search earlier
for any 'strange' instruction.  The solution is to skip the whole loop
if using 'note_stores' we found that one of hard registers is in
'df->regular_block_artificial_uses' set.

Also patch properly prohibit not single-set instruction in loop body.

gcc/ChangeLog:

PR rtl-optimization/100225
PR rtl-optimization/84878
* modulo-sched.c (sms_schedule): Use note_stores to skip loops
where we have an instruction which touches (writes) any hard
register from df->regular_block_artificial_uses set.
Allow not-single-set instruction only right before basic block
tail.

gcc/testsuite/ChangeLog:

PR rtl-optimization/100225
PR rtl-optimization/84878
* gcc.dg/pr100225.c: New test.

libgomp/ChangeLog:

* testsuite/libgomp.oacc-c-c++-common/atomic_capture-3.c: New test.
gcc/modulo-sched.c
gcc/testsuite/gcc.dg/pr100225.c [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-c-c++-common/atomic_capture-3.c [new file with mode: 0644]