[gomp4] Some progress on #pragma omp simd

Jakub Jelinek jakub@redhat.com
Wed Apr 24 11:02:00 GMT 2013


On Wed, Apr 24, 2013 at 08:01:17AM +0200, Jakub Jelinek wrote:
> On Tue, Apr 23, 2013 at 09:32:29PM +0000, Iyer, Balaji V wrote:
> The documentation doesn't suggest that.  Anyway, so
> #pragma simd
> should be equivalent to
> #pragma omp simd
> wrt. inter-iteration dependencies, and
> #pragma simd vectorlength(a, b, c)
> to
> #pragma omp simd safelen(max (a, b, c))
> ?  If so, then the FE could emit OMP_SIMD for #pragma simd, and if
> vectorlength is present, add OMP_CLAUSE_SAFELEN with the maximum of the
> values in all vectorlength clauses, and keep the vectorlength clauses around
> too as CILK_CLAUSE_VECTORLENGTH as hints to the vectorizer?
> 
> Also, Aldy said that #pragma simd loops allow != condition, how do you
> compute number of iterations in that case if the increment isn't constant?
> As conditional depending on whether increment is positive or negative?
> != condition isn't allowed in OpenMP, so there it is always obvious which
> direction it should iterate, and the expansion code will assume if it sees
> NE_EXPR that it is just folded border test (comparison with maximum or
> minimum value).

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?;
at least, that was the semantics of #pragma omp for too and there is no wording
to suggest otherwise for #pragma omp simd or #pragma omp for simd), while the above
html suggests in Cilk+ it is private to each iteration.  #pragma omp simd
doesn't support firstprivate.  The lastprivate semantics wrt. returning the
last iteration's value is the same.

	Jakub



More information about the Gcc-patches mailing list