https://gcc.gnu.org/g:6d85a0bc2e09221bdb412bc47aefbcd10c546fd5

commit r15-5230-g6d85a0bc2e09221bdb412bc47aefbcd10c546fd5
Author: Richard Biener <rguent...@suse.de>
Date:   Wed Nov 13 11:32:13 2024 +0100

    Do not consider overrun for VMAT_ELEMENTWISE
    
    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.

Diff:
---
 gcc/tree-vect-stmts.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 3147ff247a54..5d731205675e 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -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,

Reply via email to