This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4] Preserve NVPTX "reconvergence" points
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Nathan Sidwell <nathan at codesourcery dot com>, Julian Brown <julian at codesourcery dot com>
- Date: Mon, 22 Jun 2015 16:11:31 +0200
- Subject: Re: [gomp4] Preserve NVPTX "reconvergence" points
- Authentication-results: sourceware.org; auth=none
- References: <20150528150635 dot 7bd5db23 at octopus> <20150528142011 dot GN10247 at tucnak dot redhat dot com> <87pp5kg3js dot fsf at schwinge dot name> <20150528150802 dot GO10247 at tucnak dot redhat dot com> <5583E68A dot 9020608 at codesourcery dot com> <20150619122557 dot GO10247 at tucnak dot redhat dot com> <5584132A dot 6080108 at codesourcery dot com> <20150619134529 dot GP10247 at tucnak dot redhat dot com> <558814DD dot 2050502 at codesourcery dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jun 22, 2015 at 03:59:57PM +0200, Bernd Schmidt wrote:
> On 06/19/2015 03:45 PM, Jakub Jelinek wrote:
> >I actually believe having some optimization passes in between the ompexp
> >and the lowering of the IR into the form PTX wants is highly desirable,
> >the form with the worker-single or vector-single mode lowered will contain
> >too complex CFG for many optimizations to be really effective, especially
> >if it uses abnormal edges. E.g. inlining supposedly would have harder job
> >etc. What exact unpredictable effects do you fear?
>
> Mostly the ones I can't predict. But let's take one example, LICM: let's say
> you pull some assignment out of a loop, then you find yourself in one of two
> possible situations: either it's become not actually available inside the
> loop (because the data and control flow is not described correctly and the
> compiler doesn't know what's going on), or, to avoid that, you introduce
Why do you think that would happen? E.g. for non-addressable gimple types you'd
most likely just have a PHI for it on the loop.
> additional broadcasting operations when entering the loop, which might be
> quite expensive.
If the PHI has cheap initialization, there is not a problem to emit it as
initialization in the loop instead of a broadcast (kind like RA
rematerialization). And by actually adding such an optimization, you help
even code that has computation in a vector-single code and uses it in vector
acc loop.
Jakub