From: Victor Do Nascimento Date: Thu, 6 Nov 2025 20:50:12 +0000 (+0000) Subject: vect: Disable use of partial vectors for uncounted loops X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5a5a73209f1ad5b48fc0449b938e27d67fb76b3;p=thirdparty%2Fgcc.git vect: Disable use of partial vectors for uncounted loops 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. --- diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 36e29cd1862..9b435c78c21 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -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;