This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4.5] Don't mark GOMP_MAP_FIRSTPRIVATE mapped vars addressable
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 Nov 2015 19:27:51 +0300 (MSK)
- Subject: Re: [gomp4.5] Don't mark GOMP_MAP_FIRSTPRIVATE mapped vars addressable
- Authentication-results: sourceware.org; auth=none
- References: <20151111161418 dot GI5675 at tucnak dot redhat dot com>
On Wed, 11 Nov 2015, Jakub Jelinek wrote:
> Hi!
>
> Alex reported to me privately that with the OpenMP 4.5 handling of
> array section bases (that they are firstprivate instead of mapped)
> we unnecessarily mark the pointers addressable and that result
> in less efficient way of passing them as shared to inner constructs.
Thanks! Would you be interested in further (minimized) cases where new
implementation no longer manages to perform copy-in/copy-out optimization?
E.g. the following. Or I can try to put such cases in Bugzilla, if you like.
Alexander
void f(int *p, int n)
{
int tmp;
#pragma omp target map(to:p[0:n]) map(tofrom:tmp)
{
#pragma omp parallel
asm volatile ("" : "=r" (tmp) : "r" (p));
}
#pragma omp target
/* Missing optimization for 'tmp' here. */
#pragma omp parallel
asm volatile ("" : : "r" (tmp));
}