[PATCH] tree-optimization/96978 - fix fallout of BB vectorization of live stmts

Richard Biener rguenther@suse.de
Wed Sep 9 07:49:14 GMT 2020


This avoids looking at STMT_VINFO_LIVE_P when vectorizing BBs.

Bootstrap / regtest running on x86_64-unknown-linux-gnu.

Richard.

2020-09-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/96978
	* tree-vect-stmts.c (vectorizable_condition): Do not
	look at STMT_VINFO_LIVE_P for BB vectorization.
	(vectorizable_comparison): Likewise.
---
 gcc/tree-vect-stmts.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index a7ffe72378f..065d1bf3caf 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -9855,7 +9855,7 @@ vectorizable_condition (vec_info *vinfo,
 	return false;
 
       /* FORNOW: only supported as part of a reduction.  */
-      if (STMT_VINFO_LIVE_P (stmt_info))
+      if (loop_vinfo && STMT_VINFO_LIVE_P (stmt_info))
 	{
 	  if (dump_enabled_p ())
 	    dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
@@ -10328,7 +10328,7 @@ vectorizable_comparison (vec_info *vinfo,
   if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_internal_def)
     return false;
 
-  if (STMT_VINFO_LIVE_P (stmt_info))
+  if (loop_vinfo && STMT_VINFO_LIVE_P (stmt_info))
     {
       if (dump_enabled_p ())
 	dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-- 
2.26.2


More information about the Gcc-patches mailing list