vect: Refactor peel_iters_{pro,epi}logue cost modeling
authorKewen Lin <linkw@linux.ibm.com>
Tue, 28 Jul 2020 02:30:26 +0000 (21:30 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Tue, 28 Jul 2020 02:30:26 +0000 (21:30 -0500)
commit0ff959e0a2214fa553ac2d06ed66ede62602fc9a
tree8fee3106c81b62594d90dc456f868ca2c6a7965b
parente71dab87744081714bae2b3abb2e4157beed513d
vect: Refactor peel_iters_{pro,epi}logue cost modeling

This patch is to refactor the existing peel_iters_prologue and
peel_iters_epilogue cost model handlings, by following the structure
below suggested by Richard Sandiford:

  - calculate peel_iters_prologue
  - calculate peel_iters_epilogue
  - add costs associated with peel_iters_prologue
  - add costs associated with peel_iters_epilogue
  - add costs related to branch taken/not_taken.

Bootstrapped/regtested on aarch64-linux-gnu.

gcc/ChangeLog:

* tree-vect-loop.c (vect_get_known_peeling_cost): Factor out some code
to determine peel_iters_epilogue to...
(vect_get_peel_iters_epilogue): ...this new function.
(vect_estimate_min_profitable_iters): Refactor cost calculation on
peel_iters_prologue and peel_iters_epilogue.
gcc/tree-vect-loop.c