This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RFC: SIMD pragma independent of Cilk Plus / OpenMPv4
- From: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 9 Sep 2013 15:37:37 +0200
- Subject: RFC: SIMD pragma independent of Cilk Plus / OpenMPv4
- Authentication-results: sourceware.org; auth=none
Dear all,
sometimes it can be useful to annotate loops for better vectorization,
which is rather independent from parallelization.
For vectorization, GCC has [0]:
a) Cilk Plus's #pragma simd [1]
b) OpenMP 4.0's #pragma omp simd [2]
Those require -fcilkplus and -fopenmp, respectively, and activate much
more. The question is whether it makes sense to provide a means to ask
the compiler for SIMD vectorization without enabling all the other things
of Cilk Plus/OpenMP. What's your opinion?
[If one provides it, the question is whether it is always on or not,
which syntax/semantics it uses [e.g. just the one of Cilk or OpenMP]
and what to do with conflicting pragmas which can occur in this case.]
Side remark: For vectorization, the widely supported #pragma ivdep,
vector, novector can be also useful, even if they are less formally
defined. "ivdep" seems to be one of the more useful ones, whose
semantics one can map to a safelen of infinity in OpenMP's semenatics
[i.e. loop->safelen = INT_MAX].
Tobias
[0] In the trunk is currently only some initial middle-end support.
OpenMP's imp simd is in the gomp-4_0-branch; Cilk Plus's simd has been
submitted for the trunk at
http://gcc.gnu.org/ml/gcc-patches/2013-08/msg01626.html
[1] http://www.cilkplus.org/download#open-specification
[2] http://www.openmp.org/mp-documents/OpenMP4.0.0.pdf