https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108601

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Tamar Christina from comment #7)
> (In reply to Andrew Pinski from comment #1)
> > So here is how I would tackle this:
> > Put all the needed .i/.ii files in a response file.
> > 
> > 
> > $CC -c @files @options
> > $CC -r -o file.o @fileso @options 
> > 
> > Since this is only at profile generated stage it is not as hard ...
> > Then start by reducing the needed .o files in `fileso` .
> > When that is finished. Update `files` to match `fileso`.
> > and then run delta (or another automated reducer) over the files in `files`.
> > Maybe even change -flto=auto etc.
> 
> Thanks! Managed to reduce it to something fairly simple.
> 
> Repro:
> 
> ----
> 
> decode_options() {
>   int flag = 1;
>   for (; flag <= 1 << 21; flag <<= 1)
>     ;
> }
> 
> ----
> 
> compile with gcc -fprofile-generate -mcpu=neoverse-v1 -Ofast opts.i

OK so after _very_ many analyses we get

t.c:3:15: note:  ***** Choosing vector mode VNx2DI
t.c:3:15: note:  ***** Re-trying epilogue analysis with vector mode VNx2DI
...

but then vect_can_advance_ivs_p should return false for the VNx2DI mode
vectorized loop and thus no epilogue peeling possible?

We also do not choose any epilogue vector mode in the end, so the issue
isn't really epilogue vectorization related.  I suppose the
VNx2DI vector loop doesn't use fully masked vectorization but we should
have forced that because we cannot create an epilogue.

That boils down to vect_can_peel_nonlinear_iv_p but oddly enough that's
called from vectorizable_nonlinear_induction itself, possibly because
it calls vect_peel_nonlinear_iv_init.  But then this should never happen
because peeling should be disabled if not possible (but in this context
we don't know whether we actually need to peel).

I think we should remove the vect_can_peel_nonlinear_iv_p call from
vectorizable_nonlinear_induction and adjust vect_can_peel_nonlinear_iv_p
to require a .is_constant () VF.

Reply via email to