public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/104364] [12 Regression] OpenMP/nvptx regressions after "[nvptx] Add some support for .local atomics"
Date: Tue, 08 Feb 2022 09:01:52 +0000	[thread overview]
Message-ID: <bug-104364-4-Ty1iWqpced@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104364-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104364

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@gcc.gnu.org>:

https://gcc.gnu.org/g:04b54cc486cc6fcc40380445e500eaf46d7901dc

commit r12-7092-g04b54cc486cc6fcc40380445e500eaf46d7901dc
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Feb 3 14:00:02 2022 +0100

    [nvptx] Fix .local atomic regressions

    In PR target/104364, two problems were reported:
    - in muniform-simt mode, an atom.cas insn is no longer executed in the
      "master lane" only.
    - in msoft-stack mode, an __atomic_compare_exchange_n on stack memory is
      translated assuming it accesses local memory, while that's not the case.

    Fix these by:
    - ensuring that all insns with atomic attribute are also predicable, such
      that the validate_change in nvptx_reorg_uniform_simt will succeed, and
      asserting that it does, and
    - guarding the local atomics implementation with a new function
      nvptx_mem_local_p that correctly handles msoft-stack.

    Tested on x86_64 with nvptx accelerator.

    gcc/ChangeLog:

    2022-02-04  Tom de Vries  <tdevries@suse.de>

            PR target/104364
            * config/nvptx/nvptx-protos.h (nvptx_mem_local_p): Declare.
            * config/nvptx/nvptx.cc (nvptx_reorg_uniform_simt): Assert that
            change is validated.
            (nvptx_mem_local_p): New function.
            * config/nvptx/nvptx.md: Use nvptx_mem_local_p.
            (define_c_enum "unspecv"): Add UNSPECV_CAS_LOCAL.
            (define_insn "atomic_compare_and_swap<mode>_1_local"): New
            non-atomic, non-predicable define_insn, factored out of ...
            (define_insn "atomic_compare_and_swap<mode>_1"): ... here.
            Make predicable again.
            (define_expand "atomic_compare_and_swap<mode>"): Use
            atomic_compare_and_swap<mode>_1_local.

    gcc/testsuite/ChangeLog:

    2022-02-04  Tom de Vries  <tdevries@suse.de>

            PR target/104364
            * gcc.target/nvptx/softstack-2.c: New test.
            * gcc.target/nvptx/uniform-simt-1.c: New test.

  parent reply	other threads:[~2022-02-08  9:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03  9:53 [Bug target/104364] New: " tschwinge at gcc dot gnu.org
2022-02-03 10:35 ` [Bug target/104364] " vries at gcc dot gnu.org
2022-02-03 11:45 ` rguenth at gcc dot gnu.org
2022-02-03 11:48 ` vries at gcc dot gnu.org
2022-02-03 12:47 ` vries at gcc dot gnu.org
2022-02-03 13:03 ` vries at gcc dot gnu.org
2022-02-03 13:35 ` vries at gcc dot gnu.org
2022-02-04  7:27 ` tschwinge at gcc dot gnu.org
2022-02-08  9:01 ` cvs-commit at gcc dot gnu.org [this message]
2022-02-08  9:07 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-104364-4-Ty1iWqpced@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).