https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105254
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Richard Sandiford <rsand...@gcc.gnu.org>: https://gcc.gnu.org/g:f2ebf2d98efe0ac2314b58cf474f44cb8ebd5244 commit r12-8146-gf2ebf2d98efe0ac2314b58cf474f44cb8ebd5244 Author: Richard Sandiford <richard.sandif...@arm.com> Date: Wed Apr 13 17:53:54 2022 +0100 aarch64: Make sure the UF divides the VF [PR105254] In this PR, we were trying to set the unroll factor to a value higher than the minimum VF (or more specifically, to a value that doesn't divide the VF). I guess there are two approaches to this: let the target pick any value it likes and make target-independent code pare it back to something that makes sense, or require targets to supply sensible values from the outset. This patch goes for the latter approach. gcc/ PR tree-optimization/105254 * config/aarch64/aarch64.cc (aarch64_vector_costs::determine_suggested_unroll_factor): Take a loop_vec_info as argument. Restrict the unroll factor to values that divide the VF. (aarch64_vector_costs::finish_cost): Update call accordingly. gcc/testsuite/ PR tree-optimization/105254 * g++.dg/vect/pr105254.cc: New test.