This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/5] OpenMP/PTX: improve correctness in SIMD regions


On Wed, Feb 01, 2017 at 06:44:39PM +0300, Alexander Monakov wrote:
> > That said, I understand how would you add these &varN arguments during
> > lowering, but don't understand what would you want to do during inlining,
> > if you have addressable vars in inlined function, you need to avoid
> > escaping those from the SIMT region.
> > 
> > I believe the abnormal edges turning the SIMT region into kind of loop that
> > it to some extent is would take care of this even without having to add
> > those addresses to the ifns, but if you don't want to go that way,
> > supposedly the inliner would need to find those GOMP_SIMT_* statements
> > around the inline caller if any and adjust those?
> 
> Yes; I imagine the approach taken in patch 2/5 can be extended to achieve this.
> That is, instead of just storing a flag 'bool in_simtreg' in struct loop, store
> pointers to corresponding SIMT_ENTER/EXIT gimple statements, use a similar
> upwards walk on loop tree to discover if we're inlining into a SIMT region, and
> if yes, adjust their argument lists.  Does this sound ok?

I'd prefer the abnormal edges and flags on the vars, if it can work, but
won't fight for that hard.
That said, I think pointers to gimple stmts in struct loop or something
similar is problematic, you'd need to adjust those whenever something would
remove those stmts, or e.g. duplicate the loop and stmts, handle those
during inlining (if you inline some function with SIMT_ENTER/EXIT in them)
etc.  Trying to find those stmts on preheader or in exit block from the
marked loop might be easier.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]