]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix non-grouped SLP load/store accounting in alignment peeling
authorRichard Biener <rguenther@suse.de>
Tue, 5 Mar 2024 15:07:41 +0000 (16:07 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 8 May 2024 12:30:39 +0000 (14:30 +0200)
When we have a non-grouped access we bogously multiply by zero.
This shows most with single-lane SLP but also happens with
the multi-lane splat case.

* tree-vect-data-refs.cc (vect_enhance_data_refs_alignment):
Properly guard DR_GROUP_SIZE access with STMT_VINFO_GROUPED_ACCESS.

gcc/tree-vect-data-refs.cc

index c531079d3bbf972c05ee97246db5927b8ca53c98..ae237407672c670bbf9801ca0e29668fefda7371 100644 (file)
@@ -2290,8 +2290,11 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
               if (unlimited_cost_model (LOOP_VINFO_LOOP (loop_vinfo)))
                {
                  poly_uint64 vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
-                 nscalars = (STMT_SLP_TYPE (stmt_info)
-                             ? vf * DR_GROUP_SIZE (stmt_info) : vf);
+                 unsigned group_size = 1;
+                 if (STMT_SLP_TYPE (stmt_info)
+                     && STMT_VINFO_GROUPED_ACCESS (stmt_info))
+                   group_size = DR_GROUP_SIZE (stmt_info);
+                 nscalars = vf * group_size;
                }
 
              /* Save info about DR in the hash table.  Also include peeling