Richard Biener <rguent...@suse.de> writes: > The following is said to fix a 482.sphinx3 regression. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. > > Richard. > > 2017-09-18 Richard Biener <rguent...@suse.de> > > PR tree-optimization/82220 > * tree-vect-loop.c (vect_estimate_min_profitable_iters): Exclude > epilogue niters from the min_profitable_iters compute. > > Index: gcc/tree-vect-loop.c > =================================================================== > --- gcc/tree-vect-loop.c (revision 252907) > +++ gcc/tree-vect-loop.c (working copy) > @@ -3663,8 +3663,8 @@ vect_estimate_min_profitable_iters (loop > min_profitable_iters); > > /* We want the vectorized loop to execute at least once. */ > - if (min_profitable_iters < (vf + peel_iters_prologue + > peel_iters_epilogue)) > - min_profitable_iters = vf + peel_iters_prologue + peel_iters_epilogue; > + if (min_profitable_iters < (vf + peel_iters_prologue)) > + min_profitable_iters = vf + peel_iters_prologue;
Maybe we should still add 1 when peeling for gaps? Even adding the prologue count seems a bit weird if we've guessed it to be vf/2. Wouldn't it be more profitable to vectorise with an iteration count of 1 vector iteration + 1 peeled iteration than 1 vector iteration + vf-1 peeled iterations, at least in percentage terms? Was just wondering if we should only add peel_iters_prologue when npeels > 0. Thanks, Richard