Re: [PATCH 4/5] tree-inline: implement SIMT privatization, part 3

2017-03-23 Thread Jakub Jelinek
On Thu, Mar 23, 2017 at 08:00:11PM +0300, Alexander Monakov wrote: > On Thu, 23 Mar 2017, Jakub Jelinek wrote: > > And then clear it. That doesn't look like the right thing. > > > > So either you need some bool variable whether you've actually allocated > > the vector in the current expand_call_i

Re: [PATCH 4/5] tree-inline: implement SIMT privatization, part 3

2017-03-23 Thread Alexander Monakov
On Thu, 23 Mar 2017, Jakub Jelinek wrote: > And then clear it. That doesn't look like the right thing. > > So either you need some bool variable whether you've actually allocated > the vector in the current expand_call_inline and use that instead of > if (id->dst_simt_vars), or maybe you should c

Re: [PATCH 4/5] tree-inline: implement SIMT privatization, part 3

2017-03-23 Thread Jakub Jelinek
On Thu, Mar 23, 2017 at 07:15:52PM +0300, Alexander Monakov wrote: > * tree-inline.h (struct copy_body_data): New field dst_simt_vars. > * tree-inline.c (expand_call_inline): Handle SIMT privatization. > (copy_decl_for_dup_finish): Ditto. > --- > gcc/tree-inline.c | 65 > +++

Re: [PATCH 4/5] tree-inline: implement SIMT privatization, part 3

2017-03-23 Thread Alexander Monakov
On Thu, 23 Mar 2017, Jakub Jelinek wrote: > > 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: lookin

Re: [PATCH 4/5] tree-inline: implement SIMT privatization, part 3

2017-03-23 Thread Jakub Jelinek
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

Re: [PATCH 4/5] tree-inline: implement SIMT privatization, part 3

2017-03-23 Thread Alexander Monakov
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); >

Re: [PATCH 4/5] tree-inline: implement SIMT privatization, part 3

2017-03-23 Thread Jakub Jelinek
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_SI

[PATCH 4/5] tree-inline: implement SIMT privatization, part 3

2017-03-22 Thread Alexander Monakov
This patch implements privatization for SIMT during inlining. We need to discover if the call being inlined belongs to a SIMT region (by looking at simduid of the containing loop), and if so, treat them similar to OpenMP-SIMD privatization: add the "omp simt private" attribute and mention them amo