On Fri, 21 Jan 2022, Richard Sandiford wrote:

> Richard Biener <rguent...@suse.de> writes:
> > The PR complains that when we only partially BB vectorize an
> > if-converted loop body that this can leave unvectorized code
> > unconditionally executed and thus effectively slow down code.
> > For -O2 we already mitigated the issue by not doing BB vectorization
> > when not all if-converted stmts were covered but the issue is
> > present with -O3 as well.  Thus the following simply extends the
> > fix to cover all but the unlimited cost models.  It is after all
> > very likely that we vectorize some stmts, if only a single
> > paired store.
> >
> > Bootstrap & regtest running on x86_64-unknown-linux-gnu, OK?
> >
> > Thanks,
> > Richard.
> >
> > 2022-01-21  Richard Biener  <rguent...@suse.de>
> >
> >     PR tree-optimization/100089
> >     * tree-vect-slp.cc (vect_slp_region): Reject BB vectorization
> >     of if-converted loops with unvectorized COND_EXPRs for
> >     all but the unlimited cost models.
> > ---
> >  gcc/tree-vect-slp.cc | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
> > index 5ffb63689f2..430da281e18 100644
> > --- a/gcc/tree-vect-slp.cc
> > +++ b/gcc/tree-vect-slp.cc
> > @@ -5907,8 +5907,7 @@ vect_slp_region (vec<basic_block> bbs, 
> > vec<data_reference_p> datarefs,
> >         }
> >  
> >       /* When we're vectorizing an if-converted loop body with the
> > -        very-cheap cost model make sure we vectorized all if-converted
> > -        code.  */
> > +        make sure we vectorized all if-converted code.  */
> 
> Nit: keeps too much of the old comment (“with the”).

Oops, fixed and pushed.

Richard.

Reply via email to