https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103997
--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> --- On Thu, 13 Jan 2022, avieira at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103997 > > avieira at gcc dot gnu.org changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |avieira at gcc dot gnu.org > > --- Comment #5 from avieira at gcc dot gnu.org --- > Yeah I made a mistake there using the vector_mode like that, since that vector > mode really only determines vector size (and vector ISA for aarch64). > > I am almost finished testing a patch that instead goes through the > 'used_vector_modes' to find the largest element for all used vector modes, > then > use related_vector_mode to get the vector mode for that element with the same > size as the current vector_mode[mode_i]. That would give us the lowest > possible > VF for that loop and vector size. That's of course only accurate in case the vectorization will happen with the very same structure. But since we re-do pattern detection it might be we end up with a lower VF requirement even? Guess we can revisit that when it happens ... It does sound like a reasonable heuristic though.