public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] tree-optimization/101112 - fix pattern stmt def lookup in SLP reassoc
@ 2021-06-18 11:43 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2021-06-18 11:43 UTC (permalink / raw)
  To: gcc-patches

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-18 11:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 11:43 [PATCH] tree-optimization/101112 - fix pattern stmt def lookup in SLP reassoc 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).