[PATCH] tree-optimization/101003 - use pattern defs when linearizing

Richard Biener rguenther@suse.de
Thu Jun 10 08:41:09 GMT 2021


We of course have to use pattern stmt defs for the linearized
chain operands which is what I failed to ensure.

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

2021-06-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101003
	* tree-vect-slp.c (vect_build_slp_tree_2): Appropriately
	use the pattern stmt defs when linearizing a chain.
---
 gcc/tree-vect-slp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 1915d74070b..c4f8f38012f 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1806,6 +1806,11 @@ vect_build_slp_tree_2 (vec_info *vinfo, slp_tree node,
 		  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)
+		    {
+		      def_stmt_info = vect_stmt_to_vectorize (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


More information about the Gcc-patches mailing list