On Wed, 12 Jan 2022, Andre Vieira (lists) wrote: > Hi, > > This a fix for the regression caused by '[vect] Re-analyze all modes for > epilogues'. The earlier patch assumed there was always at least one other mode > than VOIDmode, but that does not need to be the case. > If we are dealing with a target that does not define more modes for > 'autovectorize_vector_modes', the behaviour before the patch would be to try > to create an epilogue for the same autodetected_vector_mode, which unless the > target supported partial vectors would always fail. So as a fix I suggest > trying to vectorize the epilogue with the preferred_simd_mode for QI, > mimicking autovectorize_vector_mode, which will be skipped if it is not a > vector_mode (since that already should indicate partial vectors aren't > possible) or if no partial vectors are supported and its pessimistic NUNITS is > larger than the main loop's VF. > > Currently bootstrapping and regression testing, otherwise OK for trunk? Can > someone verify this fixes the issue for PR103971 on powerpc?
Why not simply start at mode_i = 0 which means autodetecting the mode to use for the epilogue? That appears to be a much simpler solution to me, including for targets where there are more than one element in the vector. Richard.