@@ -3274,12 +3274,24 @@ nvptx_reorg_uniform_simt ()
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)))
+
+ /* Skip NOTE, USE, etc. */
+ if (!INSN_P (insn) || recog_memoized (insn) == -1)
continue;
+
+ if (CALL_P (insn) && nvptx_call_insn_is_syscall_p (insn))
+ {
+ /* Handle syscall. */
+ }
+ else if (get_attr_atomic (insn))
+ {
+ /* Handle atomic insn. */
+ }
+ else
+ continue;
+
rtx pat = PATTERN (insn);
+ gcc_assert (GET_CODE (pat) == PARALLEL);
rtx master = nvptx_get_unisimt_master ();
bool shuffle_p = false;
for (int i = 0; i < XVECLEN (pat, 0); i++)
@@ -2097,7 +2097,7 @@ (define_insn "nvptx_atomic_store<mode>"
= "%.\tst%A0.b%T0\t%0, %1;";
return nvptx_output_atomic_insn (t, operands, 0, 2);
}
- [(set_attr "atomic" "true")])
+ [(set_attr "atomic" "false")]) ;; Note: st is not an atomic insn.
(define_insn "atomic_fetch_add<mode>"
[(set (match_operand:SDIM 1 "memory_operand" "+m")
new file mode 100644
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -muniform-simt -misa=sm_75" } */
+
+#include "atomic-store-2.c"