From: Richard Biener Date: Fri, 25 Jun 2021 06:54:14 +0000 (+0200) Subject: Fixup reduction info on addsub SLP pattern X-Git-Tag: basepoints/gcc-13~6505 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05516402f8eb8ec282a13fa1e38d9f9c5b3dd3e5;p=thirdparty%2Fgcc.git 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 * tree-vect-slp-patterns.c (addsub_pattern::build): Copy STMT_VINFO_REDUC_DEF from the original representative. --- diff --git a/gcc/tree-vect-slp-patterns.c b/gcc/tree-vect-slp-patterns.c index d536494a1bd7..2671f91972d7 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 ();