https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108601
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So for the trivial
void
__attribute__((noipa))
foo_mul (int* a, int b, int n)
{
for (int i = 0; i != N; i++)
{
a[i] = b;
b *= 3;
}
}
I get
t.c:5:21: note: examining phi: b_17 = PHI <b_12(6), b_7(D)(5)>
t.c:5:21: missed: Peeling for epilogue is not supported for nonlinear
induction except neg when iteration count is unknown.
t.c:3:1: missed: not vectorized: relevant phi not supported: b_17 = PHI
<b_12(6), b_7(D)(5)>
t.c:5:21: missed: bad operation or unsupported loop bound.
so for some reason this check doesn't trigger for the case in SPEC? The
check seems to be
vect_can_peel_nonlinear_iv_p (loop_vec_info loop_vinfo,
enum vect_induction_op_type induction_type)
{
tree niters_skip;
/* Init_expr will be update by vect_update_ivs_after_vectorizer,
if niters is unkown:
For shift, when shift mount >= precision, there would be UD.
For mult, don't known how to generate
init_expr * pow (step, niters) for variable niters.
For neg, it should be ok, since niters of vectorized main loop
will always be multiple of 2. */
if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)
&& induction_type != vect_step_op_neg)
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"Peeling for epilogue is not supported"
" for nonlinear induction except neg"
" when iteration count is unknown.\n");
return false;
}
that might not be entirely sufficient to detect all epilogue peeling cases.