diff mbox series

Handle patterns as SLP roots of only live stmts

Message ID 20240920124558.9141313AA7@imap1.dmz-prg2.suse.org
State New
Headers show
Series Handle patterns as SLP roots of only live stmts | expand

Commit Message

Richard Biener Sept. 20, 2024, 12:45 p.m. UTC
gcc.dg/vect/vect-live-2.c shows it's important to handle live but
otherwise unused pattern stmts.

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

	* tree-vect-slp.cc (vect_analyze_slp): Lookup patterns when
	discovering from only-live roots.
---
 gcc/tree-vect-slp.cc | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index c8af4d320eb..9c817de18bd 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -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