]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix another thinko in peeling for gap compute of get_group_load_store_type
authorRichard Biener <rguenther@suse.de>
Thu, 14 Nov 2024 13:22:01 +0000 (14:22 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 14 Nov 2024 14:30:42 +0000 (15:30 +0100)
There's inconsistent handling of the cpart_size == cnunits which
currently avoids reporting peeling for gaps being insufficient, but
the following condition which is enough to trigger it,
cremain + group_size < cpart_size with cpart_size == cnunits is
equal to the condition that brings us here in the first place,
maybe_lt (remain + group_size, nunits).  The following fixes this
by not checking cpart_size against special values.

* tree-vect-stmts.cc (get_group_load_store_type): Do not
exempt cpart_size == cnunits from failing.

gcc/tree-vect-stmts.cc

index 011d66747ec13d35365302c363e62d7997f1e524..458056dd13dc70bfc0408d4012f883e427459ab2 100644 (file)
@@ -2196,7 +2196,7 @@ get_group_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info,
              if (!nunits.is_constant (&cnunits)
                  || !LOOP_VINFO_VECT_FACTOR (loop_vinfo).is_constant (&cvf)
                  || (((cremain = (group_size * cvf - gap) % cnunits), true)
-                     && ((cpart_size = (1 << ceil_log2 (cremain))) != cnunits)
+                     && ((cpart_size = (1 << ceil_log2 (cremain))), true)
                      && (cremain + group_size < cpart_size
                          || vector_vector_composition_type
                               (vectype, cnunits / cpart_size,