On Mon, 10 Nov 2025, Victor Do Nascimento wrote:

> 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 | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
> index 35fa01548df..3cfb9761f80 100644
> --- a/gcc/tree-vect-loop.cc
> +++ b/gcc/tree-vect-loop.cc
> @@ -2143,6 +2143,9 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool 
> &fatal,
>      orig_loop_vinfo = loop_vinfo;
>    gcc_assert (orig_loop_vinfo);
>  
> +  if (LOOP_VINFO_NITERS_UNCOUNTED_P (loop_vinfo))
> +    LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P (loop_vinfo) = false;
> +

Ok with adding a comment reflecting what the commit message says.

Richard.

>    /* The first group of checks is independent of the vector size.  */
>    fatal = true;
>  
> 

-- 
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Reply via email to