This is the mail archive of the gcc-patches@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: [gomp4 simd, RFC] Simple fix to override vectorization cost estimation.


On Tue, Nov 12, 2013 at 03:35:13PM +0100, Richard Biener wrote:
> > Anyway, in that case I think the originally posted patch is wrong,
> > if we want to treat force_vect as disregard all the cost model and
> > force vectorization (well, the name of the field already kind of suggest
> > that), then IMHO we should treat it the same as -fvect-cost-model=unlimited
> > for those loops.
> 
> Err - the user may have a specific sub-architecture in mind when using
> #pragma simd, if you say we should completely ignore the cost model
> then should we also sorry () if we cannot vectorize the loop (either
> because of GCC deficiencies or lack of sub-target support)?

A sorry is too strong, AFAIK Cilk+ had for #pragma simd originally some
clause to request compiler error if it hasn't been vectorized, but it has
been removed afterwards, in OpenMP you can certainly write valid code which
will not be vectorizable ever.  Warning about it with a way to turn the
warning off, surely possible, but sorry/error is IMHO wrong.
In the spec the construct is just an optimization hint, now the question is
how strong a hint we should consider it.

> That said, at least in the cases that the cost model says the loop
> is never profitable to vectorize we should follow its advice.

But that is exactly the spot that Yuri was originally changing (to my
surprise not all the others cases).

Dunno if we want to let the user choose what they want,
-fsimd-vect-cost-model={unlimited,dynamic,cheap} which would override
-fvect-cost-model for simd loops, something different?

	Jakub


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