]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vect: Use loop len in vectorizable_scan_store.
authorRobin Dapp <rdapp@ventanamicro.com>
Mon, 1 Dec 2025 16:27:04 +0000 (17:27 +0100)
committerRobin Dapp <rdapp@ventanamicro.com>
Tue, 2 Dec 2025 11:29:23 +0000 (12:29 +0100)
On riscv we ICE because we use SELECT_VL for a vectorizable_scan_store
that calls vect_get_data_ptr_increment without a loop_lens argument.

This patch just gets the loop_lens and passes them along.

gcc/ChangeLog:

* tree-vect-stmts.cc (vectorizable_scan_store): Pass loop_lens
to vect_get_data_ptr_increment.

gcc/tree-vect-stmts.cc

index a47bbd3345b1e291d0d3ae571cf5666b66b02706..641b2835693fd5a5133c7488433e1aae7cf8aff4 100644 (file)
@@ -3275,7 +3275,7 @@ static tree
 vect_get_data_ptr_increment (vec_info *vinfo, gimple_stmt_iterator *gsi,
                             dr_vec_info *dr_info, tree aggr_type,
                             vect_memory_access_type memory_access_type,
-                            vec_loop_lens *loop_lens = nullptr)
+                            vec_loop_lens *loop_lens)
 {
   if (memory_access_type == VMAT_INVARIANT)
     return size_zero_node;
@@ -7843,13 +7843,19 @@ vectorizable_scan_store (vec_info *vinfo, stmt_vec_info stmt_info,
        perms[i] = vect_gen_perm_mask_checked (vectype, indices);
     }
 
+  vec_loop_lens *loop_lens
+    = (loop_vinfo && LOOP_VINFO_FULLY_WITH_LENGTH_P (loop_vinfo)
+       ? &LOOP_VINFO_LENS (loop_vinfo)
+       : NULL);
+
   tree vec_oprnd1 = NULL_TREE;
   tree vec_oprnd2 = NULL_TREE;
   tree vec_oprnd3 = NULL_TREE;
   tree dataref_ptr = DR_BASE_ADDRESS (dr_info->dr);
   tree dataref_offset = build_int_cst (ref_type, 0);
   tree bump = vect_get_data_ptr_increment (vinfo, gsi, dr_info,
-                                          vectype, VMAT_CONTIGUOUS);
+                                          vectype, VMAT_CONTIGUOUS,
+                                          loop_lens);
   tree ldataref_ptr = NULL_TREE;
   tree orig = NULL_TREE;
   if (STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info) == 4 && !inscan_var_store)