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]

[patch] Add cfgcleanup todo to vectorizer


Hello,

vectorizer often creates a lot of junk in cfg by adding the code to
enforce alignment etc., but does not call cfgcleanup.  This may
pessimize following optimizations.

This patch makes vectorizer ask for cfg cleanup if it changes anything.

Bootstrapped & regtested on i686.

Zdenek

	* tree-ssa-loop.c (tree_vectorize): Return the result of
	vectorize_loops.
	* tree-vectorizer.c (vectorize_loops): Return TODO_cleanup_cfg
	if anything changed.
	* tree-vectorizer.h (vectorize_loops): Declaration removed.
	* tree-flow.h (vectorize_loops): Declaration changed.

Index: tree-ssa-loop.c
===================================================================
*** tree-ssa-loop.c	(revision 118690)
--- tree-ssa-loop.c	(working copy)
*************** struct tree_opt_pass pass_tree_unswitch 
*** 189,196 ****
  static unsigned int
  tree_vectorize (void)
  {
!   vectorize_loops (current_loops);
!   return 0;
  }
  
  static bool
--- 189,195 ----
  static unsigned int
  tree_vectorize (void)
  {
!   return vectorize_loops (current_loops);
  }
  
  static bool

Index: tree-vectorizer.c
===================================================================
*** tree-vectorizer.c	(revision 118690)
--- tree-vectorizer.c	(working copy)
*************** vect_is_simple_iv_evolution (unsigned lo
*** 2151,2157 ****
     
     Entry Point to loop vectorization phase.  */
  
! void
  vectorize_loops (struct loops *loops)
  {
    unsigned int i;
--- 2151,2157 ----
     
     Entry Point to loop vectorization phase.  */
  
! unsigned
  vectorize_loops (struct loops *loops)
  {
    unsigned int i;
*************** vectorize_loops (struct loops *loops)
*** 2209,2212 ****
--- 2209,2214 ----
        destroy_loop_vec_info (loop_vinfo);
        loop->aux = NULL;
      }
+ 
+   return num_vectorized_loops > 0 ? TODO_cleanup_cfg : 0;
  }
Index: tree-vectorizer.h
===================================================================
*** tree-vectorizer.h	(revision 118690)
--- tree-vectorizer.h	(working copy)
*************** extern bool supportable_widening_operati
*** 345,352 ****
  extern loop_vec_info new_loop_vec_info (struct loop *loop);
  extern void destroy_loop_vec_info (loop_vec_info);
  extern stmt_vec_info new_stmt_vec_info (tree stmt, loop_vec_info);
- /* Main driver.  */
- extern void vectorize_loops (struct loops *);
  
  
  /** In tree-vect-analyze.c  **/
--- 345,350 ----
Index: tree-flow.h
===================================================================
*** tree-flow.h	(revision 118690)
--- tree-flow.h	(working copy)
*************** struct tree_niter_desc
*** 801,807 ****
  };
  
  /* In tree-vectorizer.c */
! void vectorize_loops (struct loops *);
  extern bool vect_can_force_dr_alignment_p (tree, unsigned int);
  extern tree get_vectype_for_scalar_type (tree);
  
--- 802,808 ----
  };
  
  /* In tree-vectorizer.c */
! unsigned vectorize_loops (struct loops *);
  extern bool vect_can_force_dr_alignment_p (tree, unsigned int);
  extern tree get_vectype_for_scalar_type (tree);
  


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