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 r12-1808] Fixup reduction info on addsub SLP pattern
Date: Fri, 25 Jun 2021 08:19:04 +0000 (GMT)	[thread overview]
Message-ID: <20210625081904.3440039C0C03@sourceware.org> (raw)

https://gcc.gnu.org/g:05516402f8eb8ec282a13fa1e38d9f9c5b3dd3e5

commit r12-1808-g05516402f8eb8ec282a13fa1e38d9f9c5b3dd3e5
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jun 25 08:54:14 2021 +0200

    Fixup reduction info on addsub SLP pattern
    
    gcc.dg/vect/pr96854.c shows we need to copy over reduction info
    to the SLP pattern as already done for the complex patterns.
    
    2021-06-25  Richard Biener  <rguenther@suse.de>
    
            * tree-vect-slp-patterns.c (addsub_pattern::build): Copy
            STMT_VINFO_REDUC_DEF from the original representative.

Diff:
---
 gcc/tree-vect-slp-patterns.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/gcc/tree-vect-slp-patterns.c b/gcc/tree-vect-slp-patterns.c
index d536494a1bd..2671f91972d 100644
--- a/gcc/tree-vect-slp-patterns.c
+++ b/gcc/tree-vect-slp-patterns.c
@@ -1577,11 +1577,13 @@ addsub_pattern::build (vec_info *vinfo)
 			       (TREE_TYPE (gimple_assign_lhs (rep->stmt))));
   gimple_call_set_nothrow (call, true);
   gimple_set_bb (call, gimple_bb (rep->stmt));
-  SLP_TREE_REPRESENTATIVE (node) = vinfo->add_pattern_stmt (call, rep);
-  STMT_VINFO_RELEVANT (SLP_TREE_REPRESENTATIVE (node)) = vect_used_in_scope;
-  STMT_SLP_TYPE (SLP_TREE_REPRESENTATIVE (node)) = pure_slp;
-  STMT_VINFO_VECTYPE (SLP_TREE_REPRESENTATIVE (node)) = SLP_TREE_VECTYPE (node);
-  STMT_VINFO_SLP_VECT_ONLY_PATTERN (SLP_TREE_REPRESENTATIVE (node)) = true;
+  stmt_vec_info new_rep = vinfo->add_pattern_stmt (call, rep);
+  SLP_TREE_REPRESENTATIVE (node) = new_rep;
+  STMT_VINFO_RELEVANT (new_rep) = vect_used_in_scope;
+  STMT_SLP_TYPE (new_rep) = pure_slp;
+  STMT_VINFO_VECTYPE (new_rep) = SLP_TREE_VECTYPE (node);
+  STMT_VINFO_SLP_VECT_ONLY_PATTERN (new_rep) = true;
+  STMT_VINFO_REDUC_DEF (new_rep) = STMT_VINFO_REDUC_DEF (vect_orig_stmt (rep));
   SLP_TREE_CODE (node) = ERROR_MARK;
   SLP_TREE_LANE_PERMUTATION (node).release ();


                 reply	other threads:[~2021-06-25  8:19 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=20210625081904.3440039C0C03@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).