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-1972] fixup BIT_FIELD_REF detection in SLP discovery
Date: Thu,  9 Jul 2020 17:54:41 +0000 (GMT)	[thread overview]
Message-ID: <20200709175441.610A73861970@sourceware.org> (raw)

https://gcc.gnu.org/g:9ddea9306251b7d4e4fd1d67a5941ef7448b2e66

commit r11-1972-g9ddea9306251b7d4e4fd1d67a5941ef7448b2e66
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Jul 9 16:06:04 2020 +0200

    fixup BIT_FIELD_REF detection in SLP discovery
    
    This fixes a thinko where we end up combining a BIT_FIELD_REF
    and a memory access, fixed by checking all stmts are a load or
    none.
    
    2020-07-09  Richard Biener  <rguenther@suse.de>
    
            PR tree-optimization/96133
            * tree-vect-slp.c (vect_build_slp_tree_1): Compare load_p
            status between stmts.

Diff:
---
 gcc/tree-vect-slp.c | 40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 35ae6984593..b3645b0a820 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -760,7 +760,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
   machine_mode optab_op2_mode;
   machine_mode vec_mode;
   stmt_vec_info first_load = NULL, prev_first_load = NULL;
-  bool load_p = false;
+  bool first_stmt_load_p = false, load_p = false;
 
   /* For every stmt in NODE find its def stmt/s.  */
   stmt_vec_info stmt_info;
@@ -850,6 +850,7 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 	{
 	  *node_vectype = vectype;
 	  first_stmt_code = rhs_code;
+	  first_stmt_load_p = load_p;
 
 	  /* Shift arguments should be equal in all the packed stmts for a
 	     vector shift with scalar shift operand.  */
@@ -931,24 +932,25 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap,
 	  if (first_stmt_code != rhs_code
 	      && alt_stmt_code == ERROR_MARK)
 	    alt_stmt_code = rhs_code;
-	  if (first_stmt_code != rhs_code
-	      && (first_stmt_code != IMAGPART_EXPR
-		  || rhs_code != REALPART_EXPR)
-	      && (first_stmt_code != REALPART_EXPR
-		  || rhs_code != IMAGPART_EXPR)
-	      /* Handle mismatches in plus/minus by computing both
-		 and merging the results.  */
-	      && !((first_stmt_code == PLUS_EXPR
-		    || first_stmt_code == MINUS_EXPR)
-		   && (alt_stmt_code == PLUS_EXPR
-		       || alt_stmt_code == MINUS_EXPR)
-		   && rhs_code == alt_stmt_code)
-	      && !(STMT_VINFO_GROUPED_ACCESS (stmt_info)
-                   && (first_stmt_code == ARRAY_REF
-                       || first_stmt_code == BIT_FIELD_REF
-                       || first_stmt_code == INDIRECT_REF
-                       || first_stmt_code == COMPONENT_REF
-                       || first_stmt_code == MEM_REF)))
+	  if ((first_stmt_code != rhs_code
+	       && (first_stmt_code != IMAGPART_EXPR
+		   || rhs_code != REALPART_EXPR)
+	       && (first_stmt_code != REALPART_EXPR
+		   || rhs_code != IMAGPART_EXPR)
+	       /* Handle mismatches in plus/minus by computing both
+		  and merging the results.  */
+	       && !((first_stmt_code == PLUS_EXPR
+		     || first_stmt_code == MINUS_EXPR)
+		    && (alt_stmt_code == PLUS_EXPR
+			|| alt_stmt_code == MINUS_EXPR)
+		    && rhs_code == alt_stmt_code)
+	       && !(STMT_VINFO_GROUPED_ACCESS (stmt_info)
+		    && (first_stmt_code == ARRAY_REF
+			|| first_stmt_code == BIT_FIELD_REF
+			|| first_stmt_code == INDIRECT_REF
+			|| first_stmt_code == COMPONENT_REF
+			|| first_stmt_code == MEM_REF)))
+	      || first_stmt_load_p != load_p)
 	    {
 	      if (dump_enabled_p ())
 		{


                 reply	other threads:[~2020-07-09 17:54 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=20200709175441.610A73861970@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).