]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/110310 - move vector epilogue disabling to analysis phase
authorRichard Biener <rguenther@suse.de>
Mon, 3 Jul 2023 11:59:33 +0000 (13:59 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 4 Jul 2023 07:04:51 +0000 (09:04 +0200)
commit0682a32c026f1e246eb07bb8066abca4636f01d8
tree7398ac782ac4989b785cb1b387c8f9feb6b77658
parenteed9eeaab30fd7b9e509ec3cf78f5f3c881b0abf
tree-optimization/110310 - move vector epilogue disabling to analysis phase

The following removes late deciding to elide vectorized epilogues to
the analysis phase and also avoids altering the epilogues niter.
The costing part from vect_determine_partial_vectors_and_peeling is
moved to vect_analyze_loop_costing where we use the main loop
analysis to constrain the epilogue scalar iterations.

I have not tried to integrate this with vect_known_niters_smaller_than_vf.

It seems the for_epilogue_p parameter in
vect_determine_partial_vectors_and_peeling is largely useless and
we could compute that in the function itself.

PR tree-optimization/110310
* tree-vect-loop.cc (vect_determine_partial_vectors_and_peeling):
Move costing part ...
(vect_analyze_loop_costing): ... here.  Integrate better
estimate for epilogues from ...
(vect_analyze_loop_2): Call vect_determine_partial_vectors_and_peeling
with actual epilogue status.
* tree-vect-loop-manip.cc (vect_do_peeling): ... here and
avoid cancelling epilogue vectorization.
(vect_update_epilogue_niters): Remove.  No longer update
epilogue LOOP_VINFO_NITERS.

* gcc.target/i386/pr110310.c: New testcase.
* gcc.dg/vect/slp-perm-12.c: Disable epilogue vectorization.
gcc/testsuite/gcc.dg/vect/slp-perm-12.c
gcc/testsuite/gcc.target/i386/pr110310.c [new file with mode: 0644]
gcc/tree-vect-loop-manip.cc
gcc/tree-vect-loop.cc