From: Alfie Richards Date: Tue, 10 Feb 2026 10:01:20 +0000 (+0000) Subject: vect: Remove innacturate comment and logic for data ref alignment X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7535d14ffe87ff1ac073c092cb07233804111811;p=thirdparty%2Fgcc.git vect: Remove innacturate comment and logic for data ref alignment vect_analyze_data_refs_alignment clearly cannot return a failure, so remove the misleading comment and control flow that suggests it might. gcc/ChangeLog: * tree-vect-data-refs.cc (vect_analyze_data_refs_alignment): Update signature and comment. * tree-vect-loop.cc (vect_analyze_loop_2): Update comment for vect_analyze_data_refs_alignment and remove control flow. * tree-vectorizer.h (vect_analyze_data_refs_alignment): Update signature. --- diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc index e1facc7e957..4977e425e81 100644 --- a/gcc/tree-vect-data-refs.cc +++ b/gcc/tree-vect-data-refs.cc @@ -3068,10 +3068,9 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) /* Function vect_analyze_data_refs_alignment - Analyze the alignment of the data-references in the loop. - Return FALSE if a data reference is found that cannot be vectorized. */ + Analyze the alignment of the data-references in the loop. */ -opt_result +void vect_analyze_data_refs_alignment (loop_vec_info loop_vinfo) { DUMP_VECT_SCOPE ("vect_analyze_data_refs_alignment"); @@ -3094,8 +3093,6 @@ vect_analyze_data_refs_alignment (loop_vec_info loop_vinfo) STMT_VINFO_VECTYPE (dr_info->stmt)); } } - - return opt_result::success (); } diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index a7daeb72a5c..7d3151128e7 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -2328,17 +2328,8 @@ start_over: loop_vinfo->vector_costs = init_cost (loop_vinfo, false); - /* Analyze the alignment of the data-refs in the loop. - Fail if a data reference is found that cannot be vectorized. */ - - ok = vect_analyze_data_refs_alignment (loop_vinfo); - if (!ok) - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "bad data alignment.\n"); - return ok; - } + /* Analyze the alignment of the data-refs in the loop. */ + vect_analyze_data_refs_alignment (loop_vinfo); /* Prune the list of ddrs to be tested at run-time by versioning for alias. It is important to call pruning after vect_analyze_data_ref_accesses, diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 5c700535ed2..bde164301a8 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -2611,7 +2611,7 @@ 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); extern opt_result vect_enhance_data_refs_alignment (loop_vec_info); -extern opt_result vect_analyze_data_refs_alignment (loop_vec_info); +extern void vect_analyze_data_refs_alignment (loop_vec_info); extern bool vect_slp_analyze_instance_alignment (vec_info *, slp_instance); extern opt_result vect_analyze_data_ref_accesses (vec_info *, vec *); extern opt_result vect_prune_runtime_alias_test_list (loop_vec_info);