For loops with LOOP_VINFO_EARLY_BREAKS_VECT_PEELED we should always
enter the scalar epilogue, so avoid emitting a guard on entry to the
epilogue.
gcc/ChangeLog:
PR tree-optimization/118211
PR tree-optimization/116126
* tree-vect-loop-manip.cc (vect_do_peeling): Avoid emitting an
epilogue guard for inverted early-exit loops.
/* If we have a peeled vector iteration we will never skip the epilog loop
and we can simplify the cfg a lot by not doing the edge split. */
- if (skip_epilog || LOOP_VINFO_EARLY_BREAKS (loop_vinfo))
+ if (skip_epilog
+ || (LOOP_VINFO_EARLY_BREAKS (loop_vinfo)
+ && !LOOP_VINFO_EARLY_BREAKS_VECT_PEELED (loop_vinfo)))
{
guard_cond = fold_build2 (EQ_EXPR, boolean_type_node,
niters, niters_vector_mult_vf);