This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4] Some progress on #pragma omp simd
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>
- Cc: Aldy Hernandez <aldyh at redhat dot com>, Richard Henderson <rth at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 24 Apr 2013 08:40:54 +0200
- Subject: Re: [gomp4] Some progress on #pragma omp simd
- References: <20130419132957 dot GE12880 at tucnak dot redhat dot com> <5175B40F dot 7040709 at redhat dot com> <20130423135455 dot GN12880 at tucnak dot redhat dot com> <BF230D13CA30DD48930C31D40993300032A37760 at FMSMSX101 dot amr dot corp dot intel dot com> <20130424060117 dot GV12880 at tucnak dot redhat dot com> <20130424062536 dot GW12880 at tucnak dot redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Apr 24, 2013 at 08:25:36AM +0200, Jakub Jelinek wrote:
> BTW, the semantics of private/firstprivate/lastprivate desribed in
> http://software.intel.com/sites/products/documentation/studio/composer/en-us/2011Update/compiler_c/cref_cls/common/cppref_pragma_simd.htm
> doesn't seem to match the semantics of those in #pragma omp simd.
> private in OpenMP I understand is private to the whole loop (or SIMD lane?;
SIMD lane apparently. Guess that is going to be quite difficult, because
at the point of omp lowering or expansion we are nowhere close to knowing
what vectorization factor we are going to choose, all we have is an
upper bound on that based on the target ISA and safelen clause.
If say private clause is used with C++ classes with non-trivial ctors/dtors
that would make a difference. Plus how to represent this in the IL.
struct A { A (); ~A (); A (const A &); int i; };
void
foo ()
{
A a, b;
#pragma omp simd private (a) lastprivate (b)
for (int i = 0; i < 10; i++)
{
a.i++;
b.i++;
}
}
Right now what gomp4 branch does is that it will just construct private
vars around the whole loop, as in:
void
foo ()
{
A a, b;
{
A a', b';
int i;
for (i = 0; i < 10; i++)
{
a'.i++;
b'.i++;
if (i == 9)
b = b';
}
}
}
Jakub