https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110474
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Hao Liu <h...@gcc.gnu.org>: https://gcc.gnu.org/g:7339e725b995912747c01c3ec80ce602512f45df commit r14-2335-g7339e725b995912747c01c3ec80ce602512f45df Author: Hao Liu <h...@os.amperecomputing.com> Date: Thu Jul 6 10:03:47 2023 +0800 tree-optimization/110474 - Vect: select small VF for epilog of unrolled loop If a loop is unrolled during vectorization (i.e. suggested_unroll_factor > 1), the VFs of both main and epilog loop are enlarged. The epilog vect loop is specific for a loop with small iteration counts, so a large VF may hurt performance. This patch unscales the main loop VF by suggested_unroll_factor while selecting the epilog loop VF, so that it will be the same as vectorized loop without unrolling (i.e. suggested_unroll_factor = 1). gcc/ChangeLog: PR tree-optimization/110474 * tree-vect-loop.cc (vect_analyze_loop_2): unscale the VF by suggested unroll factor while selecting the epilog vect loop VF. gcc/testsuite/ChangeLog: * gcc.target/aarch64/pr110474.c: New testcase.