]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Handle patterns as SLP roots of only live stmts
authorRichard Biener <rguenther@suse.de>
Fri, 20 Sep 2024 11:35:49 +0000 (13:35 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 20 Sep 2024 12:46:12 +0000 (14:46 +0200)
gcc.dg/vect/vect-live-2.c shows it's important to handle live but
otherwise unused pattern stmts.

* tree-vect-slp.cc (vect_analyze_slp): Lookup patterns when
discovering from only-live roots.

gcc/tree-vect-slp.cc

index c8af4d320eb998ed677e49f367e32630273b611c..9c817de18bd14e16653882c07c3cdb200206b026 100644 (file)
@@ -4723,6 +4723,7 @@ vect_analyze_slp (vec_info *vinfo, unsigned max_tree_size,
            if (TREE_CODE (def) == SSA_NAME
                && !virtual_operand_p (def)
                && (stmt_info = loop_vinfo->lookup_def (def))
+               && ((stmt_info = vect_stmt_to_vectorize (stmt_info)), true)
                && STMT_VINFO_RELEVANT (stmt_info) == vect_used_only_live
                && STMT_VINFO_LIVE_P (stmt_info)
                && (STMT_VINFO_DEF_TYPE (stmt_info) == vect_induction_def