On Tue, 8 Mar 2022, Jeff Law wrote:

> 
> 
> On 3/8/2022 5:56 AM, Richard Biener via Gcc-patches wrote:
> > This adds a --param to allow disabling of vectorization of
> > floating point inductions.  Ontop of -Ofast this should allow
> > 549.fotonik3d_r to not miscompare.
> >
> > While I thought of a more elaborate way of disabling certain
> > vectorization kinds (reductions also came to my mind) this
> > for now simply uses a --param than some sophisticated -fvectorize-*
> > scheme.
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu.  I've
> > verified that 549.fotonik3d_r miscompares with -Ofast -march=znver2
> > and passes when adding --param vect-induction-float=0 which
> > should be valid at least for peak (but I guess also base for
> > FOPTIMIZE for example).  I did not benchmark against other
> > workarounds (it has been said -fno-unsafe-math-optimizations
> > or other similar things work as well).
> Those other options do work well to throttle things back for fotonik.  
> Presumably the idea of having the param is to be more surgical about what
> needs to be disabled to keep fotonik happy. Given the benchmark specific
> nature of the option, I'm not opposed to it being a param (primarily for
> developer use) vs a -f<blah> which are more geared to the user community.

Yes, my original idea was to provide more fine-grained control in
a more user-friendly way but that requires quite a bit of bike-shedding
that's not appropriate for this stage.

> >
> > OK for trunk?
> >
> > Thanks,
> > Richard.
> >
> > 2022-03-08  Richard Biener  <rguent...@suse.de>
> >
> >  PR tree-optimization/84201
> >  * params.opt (-param=vect-induction-float): Add.
> >  * doc/invoke.texi (vect-induction-float): Document.
> >  * tree-vect-loop.cc (vectorizable_induction): Honor
> >  param_vect_induction_float.
> >
> >  * gcc.dg/vect/pr84201.c: New testcase.
> LGTM.

Thanks - pushed.

Richard.

Reply via email to