diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-11 23:59:17 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-11 23:59:17 +0000 |
commit | 8feba6612e24a14434021be5f4982506b7d7d250 (patch) | |
tree | 2dbef04c2f2db68628a4762f85cddb33c11d1be9 /gcc/tree-ssa-loop.c | |
parent | 77236994a08415e1d85f246a09bc03e714a3653e (diff) | |
download | gcc-8feba6612e24a14434021be5f4982506b7d7d250.tar.gz |
* 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
Diffstat (limited to 'gcc/tree-ssa-loop.c')
-rw-r--r-- | gcc/tree-ssa-loop.c | 28 |
1 files changed, 28 insertions, 0 deletions
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 |