]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not query further vector epilogues after a masked epilogue
authorRichard Biener <rguenther@suse.de>
Wed, 2 Jul 2025 11:44:59 +0000 (13:44 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 2 Jul 2025 12:57:40 +0000 (14:57 +0200)
When doing --param vect-partial-vector-usage=1 we'd continue querying
the target whether it wants more vector epilogues, but when it comes
back with a suggestion we then might iterate endlessly.  Do not
even ask the target when we decided for the last epilogue to be
one with partial vectors.

PR tree-optimization/120927
* tree-vect-loop.cc (vect_analyze_loop): Stop querying
further epilogues after one with partial vectors.

(cherry picked from commit 57d30924e2b3887a1aedc6102daa67bc3272ace7)

gcc/tree-vect-loop.cc

index c824b5abaaff4cfd12447d3ea76d4c4988f83743..a38bd5723fdd0705e713cd0bc2c440bf485268aa 100644 (file)
@@ -3815,6 +3815,7 @@ vect_analyze_loop (class loop *loop, gimple *loop_vectorized_call,
       /* When we selected a first vectorized epilogue, see if the target
         suggests to have another one.  */
       if (!unlimited_cost_model (loop)
+         && !LOOP_VINFO_USING_PARTIAL_VECTORS_P (orig_loop_vinfo)
          && (orig_loop_vinfo->vector_costs->suggested_epilogue_mode ()
              != VOIDmode))
        {