[nvptx] Don't skip atomic insns in nvptx_reorg_uniform_simt
In nvptx_reorg_uniform_simt we have a loop:
...
for (insn = get_insns (); insn; insn = next)
{
next = NEXT_INSN (insn);
if (!(CALL_P (insn) && nvptx_call_insn_is_syscall_p (insn))
&& !(NONJUMP_INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == PARALLEL
&& get_attr_atomic (insn)))
continue;
...
that intends to handle syscalls and atomic insns.
However, this also silently skips the atomic insn nvptx_atomic_store, which
has GET_CODE (PATTERN (insn)) == SET.
This does not cause problems, because the nvptx_atomic_store actually maps
onto a "st" insn, and therefore is not atomic and doesn't need to be handled
by nvptx_reorg_uniform_simt.
Fix this by:
- explicitly setting nvptx_atomic_store's atomic attribute to false,
- rewriting the skip condition to make sure all insn
with atomic attribute are handled, and
- asserting that all handled insns are PARALLEL.
Tested on nvptx.
gcc/ChangeLog:
2022-02-19 Tom de Vries <tdevries@suse.de>
* config/nvptx/nvptx.cc (nvptx_reorg_uniform_simt): Handle all
insns with atomic attribute. Assert that all handled insns are
PARALLELs.
* config/nvptx/nvptx.md (define_insn "nvptx_atomic_store<mode>"):
Set atomic attribute to false.
gcc/testsuite/ChangeLog:
2022-02-19 Tom de Vries <tdevries@suse.de>
* gcc.target/nvptx/uniform-simt-3.c: New test.