]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Simplify vect_supportable_dr_alignment API
authorRichard Biener <rguenther@suse.de>
Tue, 12 Aug 2025 13:47:06 +0000 (15:47 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 13 Aug 2025 07:53:49 +0000 (09:53 +0200)
The gather_scatter_info pointer is only used as flag, so pass down
a flag.

* tree-vectorizer.h (vect_supportable_dr_alignment): Pass
a bool instead of a pointer to gather_scatter_info.
* tree-vect-data-refs.cc (vect_supportable_dr_alignment):
Likewise.
* tree-vect-stmts.cc (get_load_store_type): Adjust.

gcc/tree-vect-data-refs.cc
gcc/tree-vect-stmts.cc
gcc/tree-vectorizer.h

index a3d3b3e7f433ba88f821280801ca33441c3e5e11..4cfd1a301c2b1e343653afae9b26ec04e5310e89 100644 (file)
@@ -6541,7 +6541,7 @@ vect_can_force_dr_alignment_p (const_tree decl, poly_uint64 alignment)
 enum dr_alignment_support
 vect_supportable_dr_alignment (vec_info *vinfo, dr_vec_info *dr_info,
                               tree vectype, int misalignment,
-                              gather_scatter_info *gs_info)
+                              bool is_gather_scatter)
 {
   data_reference *dr = dr_info->dr;
   stmt_vec_info stmt_info = dr_info->stmt;
@@ -6652,7 +6652,6 @@ vect_supportable_dr_alignment (vec_info *vinfo, dr_vec_info *dr_info,
 
   bool is_packed = false;
   tree type = TREE_TYPE (DR_REF (dr));
-  bool is_gather_scatter = gs_info != nullptr;
   if (misalignment == DR_MISALIGNMENT_UNKNOWN)
     is_packed = not_size_aligned (DR_REF (dr));
   if (targetm.vectorize.support_vector_misalignment (mode, type, misalignment,
index 22397dc8bc3376eb9a3b834d24ec9acf29b65c2e..1aa3c37d25e068cfa51da30842ad078f64758619 100644 (file)
@@ -2346,7 +2346,7 @@ get_load_store_type (vec_info  *vinfo, stmt_vec_info stmt_info,
       *alignment_support_scheme
        = vect_supportable_dr_alignment
           (vinfo, first_dr_info, vectype, *misalignment,
-           *memory_access_type == VMAT_GATHER_SCATTER ? gs_info : nullptr);
+           *memory_access_type == VMAT_GATHER_SCATTER);
     }
 
   if (overrun_p)
index 041cff80286f5c2d4b040db65eece12b07761f1e..729c7044ef39177a51f8cca77bd7113c4b2d6d90 100644 (file)
@@ -2549,7 +2549,7 @@ extern bool ref_within_array_bound (gimple *, tree);
 extern bool vect_can_force_dr_alignment_p (const_tree, poly_uint64);
 extern enum dr_alignment_support vect_supportable_dr_alignment
                                   (vec_info *, dr_vec_info *, tree, int,
-                                    gather_scatter_info * = nullptr);
+                                   bool = false);
 extern tree vect_get_smallest_scalar_type (stmt_vec_info, tree);
 extern opt_result vect_analyze_data_ref_dependences (loop_vec_info, unsigned int *);
 extern bool vect_slp_analyze_instance_dependence (vec_info *, slp_instance);