[gcc r16-6131] vect: Reject uncounted loop vectorization where alias analysis may fail

Victor Do Nascimento victorldn@gcc.gnu.org
Mon Dec 15 15:29:02 GMT 2025


https://gcc.gnu.org/g:ed6afed22c994a86e95ece73be2530899003d97d

commit r16-6131-ged6afed22c994a86e95ece73be2530899003d97d
Author: Victor Do Nascimento <victor.donascimento@arm.com>
Date:   Thu Sep 4 13:19:44 2025 +0100

    vect: Reject uncounted loop vectorization where alias analysis may fail
    
    Issues with alias list pruning for uncounted loops was found to cause
    as-of-yet unresolved issues in the execution of SpecV6.  Disable this
    while a reduced testcase is developed and a solution implemented.
    
    Test derived from "omp_get_partition_place_nums" from libgomp "icv.c":
    
    unsigned len = 8;
    
    void
    alias_fail (int n[8])
    {
      unsigned int i;
      for (i = 0; i < len; i++)
        *n++ = i;
    }
    
    gcc/ChangeLog:
    
            * tree-vect-data-refs.cc (vect_prune_runtime_alias_test_list):
            Reject when !operand_equal_p for any data ref pair.

Diff:
---
 gcc/tree-vect-data-refs.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc
index 154bf5ac1b66..753224dd367b 100644
--- a/gcc/tree-vect-data-refs.cc
+++ b/gcc/tree-vect-data-refs.cc
@@ -4324,7 +4324,13 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
 	{
 	  if (!operand_equal_p (DR_STEP (dr_info_a->dr),
 				DR_STEP (dr_info_b->dr), 0))
-	    length_factor = scalar_loop_iters;
+	    {
+	      length_factor = scalar_loop_iters;
+	      if (TREE_CODE (length_factor) == SCEV_NOT_KNOWN)
+		return opt_result::failure_at (vect_location,
+					       "Unsupported alias check on"
+					       " uncounted loop\n");
+	    }
 	  else
 	    length_factor = size_int (vect_factor);
 	  segment_length_a = vect_vfa_segment_size (dr_info_a, length_factor);


More information about the Gcc-cvs mailing list