public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Prune unnecessary cleanup-tree-CFG runs
@ 2015-03-13 12:30 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2015-03-13 12:30 UTC (permalink / raw)
  To: gcc-patches


Trivial for loop header copying and vector lowering.  Remaining
ones done for an empty function at -O1 are DOM and the related
phicprop, both a little more interesting to fix (we usually
defer to CFG cleanup to optimize control stmts with known target).

Bootstrap running on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2015-03-13  Richard Biener  <rguenther@suse.de>

	* tree-sssa-loop-ch.c (pass_data_ch): Remove TODO_cleanup_cfg.
	(pass_ch::execute): Cleanup the CFG only if we did sth.
	* tree-vect-generic.c (pass_data_lower_vector): Remove TODO_cleanup_cfg.
	(pass_data_lower_vector_ssa): Likewise.

Index: gcc/tree-ssa-loop-ch.c
===================================================================
--- gcc/tree-ssa-loop-ch.c	(revision 221411)
+++ gcc/tree-ssa-loop-ch.c	(working copy)
@@ -159,7 +159,7 @@ const pass_data pass_data_ch =
   0, /* properties_provided */
   0, /* properties_destroyed */
   0, /* todo_flags_start */
-  TODO_cleanup_cfg, /* todo_flags_finish */
+  0, /* todo_flags_finish */
 };
 
 class pass_ch : public gimple_opt_pass
@@ -184,6 +184,7 @@ pass_ch::execute (function *fun)
   basic_block *bbs, *copied_bbs;
   unsigned n_bbs;
   unsigned bbs_size;
+  bool changed = false;
 
   loop_optimizer_init (LOOPS_HAVE_PREHEADERS
 		       | LOOPS_HAVE_SIMPLE_LATCHES);
@@ -291,6 +292,8 @@ pass_ch::execute (function *fun)
 	 are not now, since there was the loop exit condition.  */
       split_edge (loop_preheader_edge (loop));
       split_edge (loop_latch_edge (loop));
+
+      changed = true;
     }
 
   update_ssa (TODO_update_ssa);
@@ -298,7 +301,7 @@ pass_ch::execute (function *fun)
   free (copied_bbs);
 
   loop_optimizer_finalize ();
-  return 0;
+  return changed ? TODO_cleanup_cfg : 0;
 }
 
 } // anon namespace
Index: gcc/tree-vect-generic.c
===================================================================
--- gcc/tree-vect-generic.c	(revision 221411)
+++ gcc/tree-vect-generic.c	(working copy)
@@ -1681,8 +1681,7 @@ const pass_data pass_data_lower_vector =
   PROP_gimple_lvec, /* properties_provided */
   0, /* properties_destroyed */
   0, /* todo_flags_start */
-  ( TODO_update_ssa
-    | TODO_cleanup_cfg ), /* todo_flags_finish */
+  TODO_update_ssa, /* todo_flags_finish */
 };
 
 class pass_lower_vector : public gimple_opt_pass
@@ -1725,8 +1724,7 @@ const pass_data pass_data_lower_vector_s
   PROP_gimple_lvec, /* properties_provided */
   0, /* properties_destroyed */
   0, /* todo_flags_start */
-  ( TODO_update_ssa
-    | TODO_cleanup_cfg ), /* todo_flags_finish */
+  TODO_update_ssa, /* todo_flags_finish */
 };
 
 class pass_lower_vector_ssa : public gimple_opt_pass

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-13 12:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13 12:30 [PATCH] Prune unnecessary cleanup-tree-CFG runs Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).