This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Vectorizer Pragmas
- From: Renato Golin <renato dot golin at linaro dot org>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc <gcc at gcc dot gnu dot org>
- Date: Sun, 16 Feb 2014 19:05:12 +0000
- Subject: Re: Vectorizer Pragmas
- Authentication-results: sourceware.org; auth=none
- References: <CAMSE1kcaRgyF_HawBSDPvkt2=jP+dXDQJowHOMQ7XmHZCCWLhQ at mail dot gmail dot com> <20140215192627 dot GB22862 at tucnak dot redhat dot com> <CAMSE1kc8Z6s-aK7L7Oog-vw9-dN9sdp8r78BHkVViXAcO3Uuug at mail dot gmail dot com> <5300F417 dot 6000202 at net-b dot de>
On 16 February 2014 17:23, Tobias Burnus <burnus@net-b.de> wrote:
> As '#pragma omp simd' doesn't generate any threads and doesn't call the
> OpenMP run-time library (libgomp), I would claim that it only controls the
> tree vectorizer. (Hence, -fopenmp-simd was added as it permits this control
> without enabling thread parallelization or dependence on libgomp or
> libpthread.)
Right, this is a bit confusing, but should suffice for out purposes,
which are very similar to GCC's.
> Compiler vendors (and users) have different ideas whether the SIMD pragmas
> should give the compiler only a hint or completely override the compiler's
> heuristics. In case of the Intel compiler, the user rules; in case of GCC,
> it only influences the heuristics unless one passes explicitly
> -fsimd-cost-model=unlimited (cf. also -Wopenmp-simd).
We prefer to be on the safe side, too. We're adding a warning callback
mechanism to warn about possible dangerous situations (debug messages
already do that), possibly with the same idea as -Wopenmp-simd. But
the intent is to not vectorize if we're sure it'll break things. Only
on doubt we'll trust the pragmas/flags.
The flag -fsimd-cost-model=unlimited might be a bit too heavy on other
loops, and is the kind of think that I'd rather have as a pragma or
not at all.
> As a user, I found Intel's pragmas interesting, but at the end regarded
> OpenMP's SIMD directives/pragmas as sufficient.
That was the kind of user experience that I was looking for, thanks!
> According to http://gcc.gnu.org/projects/tree-ssa/vectorization.html,
> basic-block vectorization (SLP) support exists since 2009.
Would it be desirable to use some pragmas to control lexical blocks,
too? I'm not sure omp/cilk pragmas apply to lexical blocks...
cheers,
--renato