On 06/16/2016 09:41 AM, Ilya Enkovich wrote:
2016-06-15 14:44 GMT+03:00 Richard Biener <richard.guent...@gmail.com>:
On Thu, May 19, 2016 at 9:44 PM, Ilya Enkovich <enkovich....@gmail.com> wrote:
Hi,
This patch introduces support for loop epilogue combining. This includes
support in cost estimation and all required changes required to mask
vectorized loop.
I wonder why you compute a minimum number of iterations to make masking
of the vectorized body profitable rather than a maximum number of iterations.
I'd say masking the vectorized loop is profitable if niter/vf *
masking-overhead < epilogue-cost.
Masking the epilogue is profitable if vectorizing the epilogue with
masking is profitable.
Am I missing something?
We don't have two versions of vectorized loop. The choice is between vector
and scalar loop and in this case minimum number of iterations is what we need.
Generating two vectorized loop versions would be something new to vectorizer.
What I think Richi is saying is that we have to multiply the cost of the
masking overhead by the number of iterations of vectorized loop to
determine the cost of masking -- the more loop iterations we have, the
greater the cost of masking in the loop becomes and those costs may be
higher than the normal epilogue sequence.
Jeff