]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not consider overrun for VMAT_ELEMENTWISE
authorRichard Biener <rguenther@suse.de>
Wed, 13 Nov 2024 10:32:13 +0000 (11:32 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 14 Nov 2024 08:26:04 +0000 (09:26 +0100)
When we classify an SLP access as VMAT_ELEMENTWISE we still consider
overrun - the reset of it is later overwritten.  The following fixes
this, resolving a few RISC-V FAILs with --param vect-force-slp=1.

* tree-vect-stmts.cc (get_group_load_store_type): For
VMAT_ELEMENTWISE there's no overrun.

gcc/tree-vect-stmts.cc

index 3147ff247a54458e9ec4ad0d4081694ce60947e6..5d731205675eaeb8732b260d81d4ea546512b398 100644 (file)
@@ -2093,7 +2093,6 @@ get_group_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info,
              if (SLP_TREE_LANES (slp_node) == 1)
                {
                  *memory_access_type = VMAT_ELEMENTWISE;
-                 overrun_p = false;
                  if (dump_enabled_p ())
                    dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
                                     "single-element interleaving not supported "
@@ -2110,7 +2109,8 @@ get_group_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info,
                }
            }
 
-         overrun_p = loop_vinfo && gap != 0;
+         overrun_p = (loop_vinfo && gap != 0
+                      && *memory_access_type != VMAT_ELEMENTWISE);
          if (overrun_p && vls_type != VLS_LOAD)
            {
              dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,