public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-8656] Fix SLP permute propagation error
Date: Fri, 25 Jun 2021 09:06:14 +0000 (GMT)	[thread overview]
Message-ID: <20210625090614.DC81839C19F6@sourceware.org> (raw)

https://gcc.gnu.org/g:62bbb113ae68a7e724255e17143520735bcb9ec9

commit r11-8656-g62bbb113ae68a7e724255e17143520735bcb9ec9
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Jun 24 10:47:18 2021 +0200

    Fix SLP permute propagation error
    
    This fixes SLP permute propagation to not propagate across operations
    that have different semantics on different lanes like for example
    the recently added COMPLEX_ADD_ROT90.
    
    2021-06-24  Richard Biener  <rguenther@suse.de>
    
            * tree-vect-slp.c (vect_optimize_slp): Do not propagate
            across operations that have different semantics on different
            lanes.

Diff:
---
 gcc/tree-vect-slp.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 8ee2c231672..a40b2f06a5f 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -3180,11 +3180,25 @@ vect_optimize_slp (vec_info *vinfo)
 
 	  bitmap_set_bit (n_visited, idx);
 
-	  /* We cannot move a permute across a store.  */
-	  if (STMT_VINFO_DATA_REF (SLP_TREE_REPRESENTATIVE (node))
-	      && DR_IS_WRITE
-		   (STMT_VINFO_DATA_REF (SLP_TREE_REPRESENTATIVE (node))))
+	  /* We do not handle stores with a permutation.  */
+	  stmt_vec_info rep = SLP_TREE_REPRESENTATIVE (node);
+	  if (STMT_VINFO_DATA_REF (rep)
+	      && DR_IS_WRITE (STMT_VINFO_DATA_REF (rep)))
 	    continue;
+	  /* We cannot move a permute across an operation that is
+	     not independent on lanes.  Note this is an explicit
+	     negative list since that's much shorter than the respective
+	     positive one but it's critical to keep maintaining it.  */
+	  if (is_gimple_call (STMT_VINFO_STMT (rep)))
+	    switch (gimple_call_combined_fn (STMT_VINFO_STMT (rep)))
+	      {
+	      case CFN_COMPLEX_ADD_ROT90:
+	      case CFN_COMPLEX_ADD_ROT270:
+	      case CFN_COMPLEX_MUL:
+	      case CFN_COMPLEX_MUL_CONJ:
+		continue;
+	      default:;
+	      }
 
 	  int perm = -1;
 	  for (graph_edge *succ = slpg->vertices[idx].succ;


                 reply	other threads:[~2021-06-25  9:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210625090614.DC81839C19F6@sourceware.org \
    --to=rguenth@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).