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, Jan 18, 2017 at 03:32:56PM +0100, Jakub Jelinek wrote:
> > It probably is.
> > 
> > But I guess I was asking whether you could initially emit
> > 
> >  void *omp_simt = IFN_GOMP_SIMT_ENTER (0);
> > 
> >   for (int i = n1; i < n2; i++)
> >      foo (&tmp);
> > 
> >   IFN_GOMP_SIMT_EXIT (omp_simt);
> > 
> > and only after inlining do liveness / use analysis of everything between
> > SIMT_ENTER and SIMT_EXIT doing the rewriting only at that point.
> 
> Can't it be e.g. recorded inside a flag on the VAR_DECLs or magic attributes
> on them during omplower time and then only finalized into the magic .local
> alloca in the pass_omp_device_lower pass?  The inliner would need to be able
> to add those flags or magic attributes also when duplicating vars/parameters
> from inline functions into the SIMT region (perhaps some flag on GIMPLE_CALL
> stmts, or on bbs in the simt region, or something similar could turn that
> behavior on in the inliner)?

I see in the 2/5 patch you introduce that as a loop flag, that works too.
The inliner could still see the flag on the loop containing the call into
which it is inlining, and if it is a SIMT loop, handle it specially in
copy_decl*.

	Jakub


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