]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Const correctness for gather-scatter info
authorRichard Biener <rguenther@suse.de>
Mon, 28 Jul 2025 11:46:18 +0000 (13:46 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 28 Jul 2025 13:20:47 +0000 (15:20 +0200)
The following adds const qualification to gather_scatter_info *
parameters for various APIs in the vectorizer.

* tree-vect-stmts.cc (check_load_store_for_partial_vectors):
Make *gs_info const.
(vect_build_one_gather_load_call): Likewise.
(vect_build_one_scatter_store_call): Likewise.
(vect_get_gather_scatter_ops): Likewise.
(vect_get_strided_load_store_ops): Likewise.

gcc/tree-vect-stmts.cc

index 20a4bb2b3d389c28cd9e0468a3e666c0a8ca579e..9edc4a8990cb8c6795d8eab945f9b198687e17fc 100644 (file)
@@ -1422,7 +1422,7 @@ check_load_store_for_partial_vectors (loop_vec_info loop_vinfo, tree vectype,
                                      int group_size,
                                      vect_memory_access_type
                                      memory_access_type,
-                                     gather_scatter_info *gs_info,
+                                     const gather_scatter_info *gs_info,
                                      tree scalar_mask,
                                      vec<int> *elsvals = nullptr)
 {
@@ -2771,7 +2771,7 @@ static gimple *
 vect_build_one_gather_load_call (vec_info *vinfo, stmt_vec_info stmt_info,
                                 tree vectype,
                                 gimple_stmt_iterator *gsi,
-                                gather_scatter_info *gs_info,
+                                const gather_scatter_info *gs_info,
                                 tree ptr, tree offset, tree mask)
 {
   tree arglist = TYPE_ARG_TYPES (TREE_TYPE (gs_info->decl));
@@ -2869,7 +2869,7 @@ vect_build_one_gather_load_call (vec_info *vinfo, stmt_vec_info stmt_info,
 static gimple *
 vect_build_one_scatter_store_call (vec_info *vinfo, stmt_vec_info stmt_info,
                                   gimple_stmt_iterator *gsi,
-                                  gather_scatter_info *gs_info,
+                                  const gather_scatter_info *gs_info,
                                   tree ptr, tree offset, tree oprnd, tree mask)
 {
   tree rettype = TREE_TYPE (TREE_TYPE (gs_info->decl));
@@ -2950,8 +2950,8 @@ vect_build_one_scatter_store_call (vec_info *vinfo, stmt_vec_info stmt_info,
    containing loop.  */
 
 static void
-vect_get_gather_scatter_ops (class loop *loop,
-                            slp_tree slp_node, gather_scatter_info *gs_info,
+vect_get_gather_scatter_ops (class loop *loop, slp_tree slp_node,
+                            const gather_scatter_info *gs_info,
                             tree *dataref_ptr, vec<tree> *vec_offset)
 {
   gimple_seq stmts = NULL;
@@ -2979,7 +2979,7 @@ static void
 vect_get_strided_load_store_ops (stmt_vec_info stmt_info, tree vectype,
                                 loop_vec_info loop_vinfo,
                                 gimple_stmt_iterator *gsi,
-                                gather_scatter_info *gs_info,
+                                const gather_scatter_info *gs_info,
                                 tree *dataref_bump, tree *vec_offset,
                                 vec_loop_lens *loop_lens)
 {