]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vect: Don't guard scalar epilogue for inverted loops [PR118211]
authorAlex Coplan <alex.coplan@arm.com>
Fri, 7 Jun 2024 11:13:02 +0000 (11:13 +0000)
committerTamar Christina <tamar.christina@arm.com>
Fri, 10 Jan 2025 21:21:06 +0000 (21:21 +0000)
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.

gcc/tree-vect-loop-manip.cc

index 15cac0fe27dfb239401f75f46dfbfba44ef94e88..4505e5d87ddb99f172bfd13e97eac6eb8f210f54 100644 (file)
@@ -3530,7 +3530,9 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1,
 
       /* 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);