For the testcase in PR108782 we're rejecting to vectorize the nested cycle because if (!flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "intermediate value used outside loop.\n"); return NULL; } but really all inner PHIs should be trivially vectorizable without further restrictions. The only thing we need to do is detect double reductions, that is, when there's an outer reduction feeding the inner loop PHI.