public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: gcc-patches@gcc.gnu.org
Subject: [PATCHv2 0/5] OpenMP/PTX: improve correctness in SIMD regions
Date: Wed, 22 Mar 2017 15:46:00 -0000	[thread overview]
Message-ID: <1490197595-31938-1-git-send-email-amonakov@ispras.ru> (raw)

Hello,

This patchset implements privatization of addressable variables in OpenMP SIMD
regions lowered for SIMT targets (i.e. NVPTX) via the approach identified in
the review of the previous submission.

Now instead of explicitly privatizing those variables as fields of an
allocated struct up front, we keep them as normal variables in the IR until
after IPA passes.  After that, the ompdevlow pass rewrites the IR to make
privatization explicit (patch 3/5).

Inlining is taught to privatize variables this way (patch 4), and when a
variable no longer has its address taken, it can be promoted to a gimple
register and no longer be subject to special privatization (patch 5).

Post-omplow IR looks like this:

  void *simtrec;
  int priv1 __attribute__((omp simt private));

  simduid.n_2 = GOMP_SIMT_ENTER (simduid.n_1, &priv1, &priv2, ...);
  simtrec = GOMP_SIMT_ENTER_ALLOC (simduid.n_2);

  for (...) { foo (&priv1); }

  priv1 = {CLOBBER};
  GOMP_SIMT_EXIT (simtrec);

And post-ompdevlow IR looks like this:

  struct {
    int priv1;
  } *simtrec;
  int priv1 [value-expr: simtrec->priv1];
  /* priv1 is no longer itself present in IR */

  simduid.n_2 = simduid.n_1;
  simtrec = GOMP_SIMT_ENTER_ALLOC (sizeof *simtrec, alignof *simtrec);

  for (...) { foo (&simtrec->priv1); }

  *simtrec = {CLOBBER};
  GOMP_SIMT_EXIT (simtrec);

Thanks.
Alexander

             reply	other threads:[~2017-03-22 15:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22 15:46 Alexander Monakov [this message]
2017-03-22 15:46 ` [PATCH 1/5] nvptx: implement SIMT enter/exit insns Alexander Monakov
2017-03-27 11:12   ` Alexander Monakov
2017-03-27 15:03     ` Bernd Schmidt
2017-03-22 15:46 ` [PATCH 3/5] omp-offload: implement SIMT privatization, part 2 Alexander Monakov
2017-03-23 10:37   ` Jakub Jelinek
2017-03-23 10:53     ` Alexander Monakov
2017-03-23 11:19       ` Jakub Jelinek
2017-03-22 15:46 ` [PATCH 4/5] tree-inline: implement SIMT privatization, part 3 Alexander Monakov
2017-03-23 10:47   ` Jakub Jelinek
2017-03-23 11:13     ` Alexander Monakov
2017-03-23 11:25       ` Jakub Jelinek
2017-03-23 16:15         ` Alexander Monakov
2017-03-23 16:23           ` Jakub Jelinek
2017-03-23 17:02             ` Alexander Monakov
2017-03-23 17:09               ` Jakub Jelinek
2017-03-22 15:46 ` [PATCH 2/5] omp-low: implement SIMT privatization, part 1 Alexander Monakov
2017-03-23 10:32   ` Jakub Jelinek
2017-03-31 16:05     ` Alexander Monakov
2017-04-07  7:58       ` [PATCH] omp-low: fix lastprivate/linear lowering for SIMT Alexander Monakov
2017-04-20 12:55         ` Alexander Monakov
2017-04-20 15:32       ` [PATCH 2/5] omp-low: implement SIMT privatization, part 1 Jakub Jelinek
2017-04-20 16:48         ` Alexander Monakov
2017-04-20 17:29           ` Jakub Jelinek
2017-03-22 15:46 ` [PATCH 5/5] address-taken: optimize SIMT privatized variables Alexander Monakov
2017-03-23 10:48   ` Jakub Jelinek
2017-03-31 10:22 ` [PATCHv2 0/5] OpenMP/PTX: improve correctness in SIMD regions Thomas Schwinge

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=1490197595-31938-1-git-send-email-amonakov@ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=gcc-patches@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).