This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] OpenMP #pragma omp declare simd support (take 2)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Richard Biener <rguenther at suse dot de>, Richard Henderson <rth at redhat dot com>, Martin Jambor <mjambor at suse dot cz>, Aldy Hernandez <aldyh at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Nov 2013 20:16:17 +0100
- Subject: Re: [PATCH] OpenMP #pragma omp declare simd support (take 2)
- Authentication-results: sourceware.org; auth=none
- References: <20131122003437 dot GS892 at tucnak dot redhat dot com> <alpine dot LNX dot 2 dot 00 dot 1311221003080 dot 8615 at zhemvz dot fhfr dot qr> <20131125164011 dot GZ892 at tucnak dot redhat dot com> <20131125171550 dot GA17059 at kam dot mff dot cuni dot cz> <20131125172534 dot GC892 at tucnak dot redhat dot com> <20131125184834 dot GA29823 at kam dot mff dot cuni dot cz> <20131125185705 dot GD892 at tucnak dot redhat dot com>
> On Mon, Nov 25, 2013 at 07:48:34PM +0100, Jan Hubicka wrote:
> > > isn't exactly enabled by default ;)
> >
> > OK :))
> > > Anyway, all the pass needs is bodies of functions with "omp declare simd"
> > > attribute which will be defined in the current partition, for functions
> > > defined in other partitions all it wants to do is just clone the
> > > DECL_EXTERNAL FUNCTION_DECL. But it needs to be called before any
> > > caller's of that function (whether extern/in another partition, or local
> > > (defined in the current partition) will run through vectorization.
> >
> > Yep, we will need to add an interface for late passes that needs to look
> > only into specific bodies. (in fact, I already added cgraph_get_body
> > and perhaps I can just integrate IPA transformation into that and make late IPA passes
> > to use them)
>
> Note that while the late IPA pass for simd clones is enabled say for
> -fopenmp, even if it needed the bodies that wouldn't be in current
> partition, it wants to look only at a fraction of all functions, so loading
> the bodies just in case for everything would be tons of unnecessary work.
Indeed.
> If IPA-PTA needs bodies of everything always, perhaps it could call
> cgraph_get_body at the beginning of handling each function?
Well, ipa-pta is mostlly off, so I did not care about it (yet). I will need to
re-arrange the way IPA transforms are executed - currently cgraph_get_body only
loads the body. The actual transformations are executed by pass manager either
before first simple IPA pass on all function bodies (this path we go only with
-fipa-pta for now) or before first local pass on the current body (this is what
happens by default). Because funtion bodies are removed after compiling, we don't
really load whole partition at once this way.
Getting cgraph_get_body to do the right thing is not terribly difficult, but it
will need a bit of cooperation with the way inliner is hooked into it. I can
do it next week quite easilly. Given that debug info is major memory sink
of ltrans (with -g), this is not that critical for 4.9, so perhaps it can also wait for
next stage1.
Honza
>
> Jakub