]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vect: Disable use of partial vectors for uncounted loops
authorVictor Do Nascimento <victor.donascimento@arm.com>
Thu, 6 Nov 2025 20:50:12 +0000 (20:50 +0000)
committerVictor Do Nascimento <victor.donascimento@arm.com>
Mon, 15 Dec 2025 15:27:40 +0000 (15:27 +0000)
Given the current reliance of masking on niters and the fact this is
undetermined for uncounted loops, we circumvent this limitation by
disabling the use of partial vectors when vectorizing loops with an
unkown upper bound.

gcc/ChangeLog:

* tree-vect-loop.cc (vect_analyze_loop_2): Disable partial
vector use for uncounted loops.

gcc/tree-vect-loop.cc

index 36e29cd18628094eb9f12a9f651abe193dd6a6fe..9b435c78c21b1305944e954d6ff442263df84162 100644 (file)
@@ -2108,6 +2108,10 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, int masked_p, bool &fatal,
     orig_loop_vinfo = loop_vinfo;
   gcc_assert (orig_loop_vinfo);
 
+  /* We can't mask on niters for uncounted loops due to unkown upper bound.  */
+  if (LOOP_VINFO_NITERS_UNCOUNTED_P (loop_vinfo))
+    LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P (loop_vinfo) = false;
+
   /* The first group of checks is independent of the vector size.  */
   fatal = true;