This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Vectorizer Pragmas


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]