public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCHv2 0/5] OpenMP/PTX: improve correctness in SIMD regions
@ 2017-03-22 15:46 Alexander Monakov
  2017-03-22 15:46 ` [PATCH 5/5] address-taken: optimize SIMT privatized variables Alexander Monakov
                   ` (5 more replies)
  0 siblings, 6 replies; 27+ messages in thread
From: Alexander Monakov @ 2017-03-22 15:46 UTC (permalink / raw)
  To: gcc-patches

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

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-04-20 16:48 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-22 15:46 [PATCHv2 0/5] OpenMP/PTX: improve correctness in SIMD regions Alexander Monakov
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-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 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-31 10:22 ` [PATCHv2 0/5] OpenMP/PTX: improve correctness in SIMD regions Thomas Schwinge

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).