public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 4/5] tree-inline: implement SIMT privatization, part 3
Date: Thu, 23 Mar 2017 11:25:00 -0000	[thread overview]
Message-ID: <20170323112459.GR11094@tucnak> (raw)
In-Reply-To: <alpine.LNX.2.20.13.1703231400180.30883@monopod.intra.ispras.ru>

On Thu, Mar 23, 2017 at 02:13:45PM +0300, Alexander Monakov wrote:
> On Thu, 23 Mar 2017, Jakub Jelinek wrote:
> > On Wed, Mar 22, 2017 at 06:46:34PM +0300, Alexander Monakov wrote:
> > > @@ -4730,6 +4746,25 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
> > >    if (cfun->gimple_df)
> > >      pt_solution_reset (&cfun->gimple_df->escaped);
> > >  
> > > +  /* Add new automatic variables to IFN_GOMP_SIMT_ENTER arguments.  */
> > > +  if (id->dst_simt_vars)
> > > +    {
> > > +      size_t nargs = gimple_call_num_args (simtenter_stmt);
> > > +      hash_set<tree> *vars = id->dst_simt_vars;
> > > +      auto_vec<tree> newargs (nargs + vars->elements ());
> > > +      for (size_t i = 0; i < nargs; i++)
> > > +	newargs.quick_push (gimple_call_arg (simtenter_stmt, i));
> > > +      for (hash_set<tree>::iterator i = vars->begin (); i != vars->end (); ++i)
> > > +	newargs.quick_push (build1 (ADDR_EXPR,
> > > +				    build_pointer_type (TREE_TYPE (*i)), *i));
> > 
> > Traversing a hash table where the traversal affects code generation is
> > -fcompare-debug unfriendly.
> > Do you actually need a hash_set and not say just a vec of the vars?  I can't
> > find where you'd actually do any lookups there, just add and traverse.
> 
> Sorry for missing the IR stability issue.  This code relies on dst_simt_vars
> being a set and thus having no duplicate entries (so the implicit lookup when
> adding an element is needed).
> 
> However, I think I was overly cautious: looking again, I think we can't enter
> copy_decl_for_dup_finish twice with the same 'copy' VAR_DECL.  Changing it to a
> vec should be fine then?

Yeah, callers of copy_decl* should look the orig var in the decl map first,
plus if you look at all copy_decl_for_dup_finish callers, all of them first
create a new tree (usually copy_node) and then pass it as copy to
copy_decl_for_dup_finish, so you'll never get the same copy in there.

So, please change it into a vector.

	Jakub

  reply	other threads:[~2017-03-23 11:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22 15:46 [PATCHv2 0/5] OpenMP/PTX: improve correctness in SIMD regions Alexander Monakov
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 [this message]
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 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 5/5] address-taken: optimize SIMT privatized variables Alexander Monakov
2017-03-23 10:48   ` 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

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=20170323112459.GR11094@tucnak \
    --to=jakub@redhat.com \
    --cc=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).