This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[vta] don't let debug insns get in the way of simple vect reduction


libgfortran had some vectorization cases that wouldn't be applied in
the presence of debug stmts referencing the same variables.  Fixed
with the patch below, to be installed shortly.

for  gcc/ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* tree-vectorizer.c (vect_is_simple_reduction): Disregard uses
	in debug insns.

Index: gcc/tree-vectorizer.c
===================================================================
--- gcc/tree-vectorizer.c.orig	2007-09-17 15:31:48.000000000 -0300
+++ gcc/tree-vectorizer.c	2007-11-03 01:44:55.000000000 -0200
@@ -2199,6 +2199,8 @@ vect_is_simple_reduction (loop_vec_info 
   FOR_EACH_IMM_USE_FAST (use_p, imm_iter, name)
     {
       tree use_stmt = USE_STMT (use_p);
+      if (IS_DEBUG_STMT (use_stmt))
+	continue;
       if (flow_bb_inside_loop_p (loop, bb_for_stmt (use_stmt))
 	  && vinfo_for_stmt (use_stmt)
 	  && !is_pattern_stmt_p (vinfo_for_stmt (use_stmt)))
@@ -2241,6 +2243,8 @@ vect_is_simple_reduction (loop_vec_info 
   FOR_EACH_IMM_USE_FAST (use_p, imm_iter, name)
     {
       tree use_stmt = USE_STMT (use_p);
+      if (IS_DEBUG_STMT (use_stmt))
+	continue;
       if (flow_bb_inside_loop_p (loop, bb_for_stmt (use_stmt))
 	  && vinfo_for_stmt (use_stmt)
 	  && !is_pattern_stmt_p (vinfo_for_stmt (use_stmt)))
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]