public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] tree-optimization/101112 - fix pattern stmt def lookup in SLP reassoc
Date: Fri, 18 Jun 2021 13:43:12 +0200 (CEST)	[thread overview]
Message-ID: <nnr01pps-q7qq-s81s-s993-o17r4or4rn3s@fhfr.qr> (raw)

This fixes the lookup of a pattern stmt def operand.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

2021-06-18  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101112
	* tree-vect-slp.c (vect_slp_linearize_chain): Fix condition
	to lookup a pattern stmt def.
---
 gcc/tree-vect-slp.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 0c1f85beeb2..f9c33c0bb14 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1482,13 +1482,9 @@ vect_slp_linearize_chain (vec_info *vinfo,
 	  stmt_vec_info def_stmt_info;
 	  bool res = vect_is_simple_use (op, vinfo, &dt, &def_stmt_info);
 	  gcc_assert (res);
-	  if (dt == vect_internal_def)
-	    {
-	      stmt_vec_info orig_def_stmt_info = def_stmt_info;
-	      def_stmt_info = vect_stmt_to_vectorize (def_stmt_info);
-	      if (def_stmt_info != orig_def_stmt_info)
-		op = gimple_get_lhs (def_stmt_info->stmt);
-	    }
+	  if (dt == vect_internal_def
+	      && is_pattern_stmt_p (def_stmt_info))
+	    op = gimple_get_lhs (def_stmt_info->stmt);
 	  gimple *use_stmt;
 	  use_operand_p use_p;
 	  if (dt == vect_internal_def
-- 
2.26.2

                 reply	other threads:[~2021-06-18 11:43 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=nnr01pps-q7qq-s81s-s993-o17r4or4rn3s@fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@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).