aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop.c
diff options
context:
space:
mode:
authorZdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>2004-09-23 14:21:31 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2004-09-23 12:21:31 +0000
commit92fc4a2f399b92bf6f9ee3b50373216b01b1ca5e (patch)
tree4eca96bd1993934aaf193e1ddbcaa3b752254965 /gcc/tree-ssa-loop.c
parentb8b94c5ba81744d325f235a0409660f50ac3f361 (diff)
downloadgcc-92fc4a2f399b92bf6f9ee3b50373216b01b1ca5e.zip
gcc-92fc4a2f399b92bf6f9ee3b50373216b01b1ca5e.tar.gz
gcc-92fc4a2f399b92bf6f9ee3b50373216b01b1ca5e.tar.bz2
cfgloop.h (update_single_exits_after_duplication): Declare.
* cfgloop.h (update_single_exits_after_duplication): Declare. (loopify, split_loop_bb): Declaration changed. * cfgloopmanip.c (split_loop_bb): Take void * as an argument instead of rtx. (loopify): Added redirect_all_edges argument. (update_single_exits_after_duplication): Export. * loop-unswitch.c (unswitch_loop): Changed due to loopify change. * tree-flow.h (tree_duplicate_loop_to_header_edge, tree_ssa_loop_version): Declare. * tree-ssa-loop-manip.c (copy_phi_node_args, rename_variables, set_phi_def_stmts, tree_duplicate_loop_to_header_edge, lv_adjust_loop_header_phi, lv_adjust_loop_entry_edge, lv_update_pending_stmts, tree_ssa_loop_version): New functions. * tree-ssa-loop-unswitch.c: New file. * Makefile.in (tree-ssa-loop-unswitch.o): Add. * timevar.def (TV_TREE_LOOP_UNSWITCH): New timevar. * tree-flow.h (tree_ssa_unswitch_loops): Declare. * tree-optimize.c (init_tree_optimization_passes): Add pass_unswitch. * tree-pass.h (pass_unswitch): Declare. * tree-ssa-loop.c (tree_ssa_loop_unswitch, gate_tree_ssa_loop_unswitch, pass_unswitch): New pass. * doc/passes.texi: Documen tree level loop unswitching. * gcc.dg/tree-ssa/loop-6.c: New test. From-SVN: r87943
Diffstat (limited to 'gcc/tree-ssa-loop.c')
-rw-r--r--gcc/tree-ssa-loop.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 2f87d87..19f784d 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -159,6 +159,40 @@ struct tree_opt_pass pass_lim =
0 /* letter */
};
+/* Loop unswitching pass. */
+
+static void
+tree_ssa_loop_unswitch (void)
+{
+ if (!current_loops)
+ return;
+
+ tree_ssa_unswitch_loops (current_loops);
+}
+
+static bool
+gate_tree_ssa_loop_unswitch (void)
+{
+ return flag_unswitch_loops != 0;
+}
+
+struct tree_opt_pass pass_unswitch =
+{
+ "unswitch", /* name */
+ gate_tree_ssa_loop_unswitch, /* gate */
+ tree_ssa_loop_unswitch, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_TREE_LOOP_UNSWITCH, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func, /* todo_flags_finish */
+ 0 /* letter */
+};
+
/* Loop autovectorization. */
static void