public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/rguenth/heads/vect-force-slp)] Avoid bogus SLP outer loop vectorization
@ 2024-03-06 14:14 Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2024-03-06 14:14 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d1b89155e4bc4f42a06a36b64208216e5d37e779

commit d1b89155e4bc4f42a06a36b64208216e5d37e779
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Mar 6 15:13:05 2024 +0100

    Avoid bogus SLP outer loop vectorization
    
    This fixes the check for multiple types which go wrong I think
    because of bogus pointer IV increments when there are multiple
    copies of vector stmts in the inner loop.
    
            * tree-vect-stmts.cc (vectorizable_load): Avoid outer loop
            SLP vectorization with multi-copy vector stmts in the inner
            loop.
            (vectorizable_store): Likewise.

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

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 8766ef220c2..2bee550f4a9 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -8176,7 +8176,9 @@ vectorizable_store (vec_info *vinfo,
   gcc_assert (ncopies >= 1);
 
   /* FORNOW.  This restriction should be relaxed.  */
-  if (loop && nested_in_vect_loop_p (loop, stmt_info) && ncopies > 1)
+  if (loop
+      && nested_in_vect_loop_p (loop, stmt_info)
+      && (ncopies > 1 || (slp && SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) > 1)))
     {
       if (dump_enabled_p ())
 	dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
@@ -9917,7 +9919,8 @@ vectorizable_load (vec_info *vinfo,
   gcc_assert (ncopies >= 1);
 
   /* FORNOW. This restriction should be relaxed.  */
-  if (nested_in_vect_loop && ncopies > 1)
+  if (nested_in_vect_loop
+      && (ncopies > 1 || (slp && SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) > 1)))
     {
       if (dump_enabled_p ())
         dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/rguenth/heads/vect-force-slp)] Avoid bogus SLP outer loop vectorization
@ 2024-05-13 14:28 Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2024-05-13 14:28 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4652b8bdf79f6ba3a86e085b7ce13d23057c57f6

commit 4652b8bdf79f6ba3a86e085b7ce13d23057c57f6
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Mar 6 15:13:05 2024 +0100

    Avoid bogus SLP outer loop vectorization
    
    This fixes the check for multiple types which go wrong I think
    because of bogus pointer IV increments when there are multiple
    copies of vector stmts in the inner loop.
    
            * tree-vect-stmts.cc (vectorizable_load): Avoid outer loop
            SLP vectorization with multi-copy vector stmts in the inner
            loop.
            (vectorizable_store): Likewise.

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

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 414c1fce38db..840ff8a3406a 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -8195,7 +8195,9 @@ vectorizable_store (vec_info *vinfo,
   gcc_assert (ncopies >= 1);
 
   /* FORNOW.  This restriction should be relaxed.  */
-  if (loop && nested_in_vect_loop_p (loop, stmt_info) && ncopies > 1)
+  if (loop
+      && nested_in_vect_loop_p (loop, stmt_info)
+      && (ncopies > 1 || (slp && SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) > 1)))
     {
       if (dump_enabled_p ())
 	dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
@@ -9941,7 +9943,8 @@ vectorizable_load (vec_info *vinfo,
   gcc_assert (ncopies >= 1);
 
   /* FORNOW. This restriction should be relaxed.  */
-  if (nested_in_vect_loop && ncopies > 1)
+  if (nested_in_vect_loop
+      && (ncopies > 1 || (slp && SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) > 1)))
     {
       if (dump_enabled_p ())
         dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-13 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-06 14:14 [gcc(refs/users/rguenth/heads/vect-force-slp)] Avoid bogus SLP outer loop vectorization Richard Biener
2024-05-13 14:28 Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).