From 8feba6612e24a14434021be5f4982506b7d7d250 Mon Sep 17 00:00:00 2001 From: rakdver Date: Mon, 11 Jul 2005 23:59:17 +0000 Subject: * tree-flow.h (remove_empty_loops, single_dom_exit): Declare. * passes.c (init_optimization_passes): Add pass_empty_loop. * tree-pass.h (pass_empty_loop): Declare. * tree-ssa-loop-ivcanon.c (empty_loop_p, remove_empty_loop, try_remove_empty_loop, remove_empty_loops): New functions. * tree-ssa-loop-ivopts.c (single_dom_exit): Export. * tree-ssa-loop.c (tree_ssa_empty_loop, pass_empty_loop): New. * gcc.dg/tree-ssa/loop-10.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101901 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-ssa-loop.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'gcc/tree-ssa-loop.c') diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c index aa99920f88b..1e7d73b8885 100644 --- a/gcc/tree-ssa-loop.c +++ b/gcc/tree-ssa-loop.c @@ -311,6 +311,34 @@ struct tree_opt_pass pass_scev_cprop = 0 /* letter */ }; +/* Remove empty loops. */ + +static void +tree_ssa_empty_loop (void) +{ + if (!current_loops) + return; + + remove_empty_loops (current_loops); +} + +struct tree_opt_pass pass_empty_loop = +{ + "empty", /* name */ + NULL, /* gate */ + tree_ssa_empty_loop, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_COMPLETE_UNROLL, /* tv_id */ + PROP_cfg | PROP_ssa, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ + 0 /* letter */ +}; + /* Record bounds on numbers of iterations of loops. */ static void -- cgit v1.2.1