https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101390
--- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> --- On Wed, 7 Aug 2024, jschmitz at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101390 > > --- Comment #7 from Jennifer Schmitz <jschmitz at gcc dot gnu.org> --- > Thank you for the reply. Seems like I have been looking in the right places. > I'm a new member of the GCC community, so I'm still getting familiar with many > parts of the code base. I have been trying to find out where the related case, > but with the division operator is implemented, as this seems a natural place > to > also implement the modulo operator. This does not seem to happen in > vect_recog_divmod_pattern. Do you still think vect_recog_divmod_pattern is the > right location to implement this or can you point me to the implementation of > the same case with division? Division by non-constant is not emulated in any way, so there is nothing to find. I would suggest you add a vect_recog_mod_var_pattern function implementing modulo by non-constant via division and multiply/sub.