summaryrefslogtreecommitdiff
path: root/gcc/cfgloopanal.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-18 16:42:34 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-18 16:42:34 +0000
commit2d49f8240d0215badf73b1984dade82a824c2ea0 (patch)
tree245f4992ca85428a919452579f49376b65e76f95 /gcc/cfgloopanal.c
parent20ebc48fe6ad018a6aa7f9958b7c46cf7b54e6ab (diff)
downloadgcc-2d49f8240d0215badf73b1984dade82a824c2ea0.tar.gz
* doloop.c: Removed.
* loop-doloop.c: New file. * Makefile.in (doloop.o): Remove. (loop-doloop.o): New. * cfgloop.h (get_loop_level, doloop_optimize_loops): Declare. * cfgloopanal.c (get_loop_level): New function. * loop-iv.c (iv_number_of_iterations): Handle case when loop is leaved immediatelly. * loop.c (strength_reduce): Do not call doloop optimization. * loop.h (LOOP_BCT): Removed. * passes.c (rest_of_handle_loop_optimize): Do not use LOOP_BCT. (rest_of_handle_loop2): Call doloop_optimize_loops. (rest_of_compilation): Test for optimizations moved to rest_of_handle_loop2. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79625 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgloopanal.c')
-rw-r--r--gcc/cfgloopanal.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
index 9b3ffa0c8ae..63d6f4121b0 100644
--- a/gcc/cfgloopanal.c
+++ b/gcc/cfgloopanal.c
@@ -457,3 +457,20 @@ expected_loop_iterations (const struct loop *loop)
return (freq_latch + freq_in - 1) / freq_in;
}
}
+
+/* Returns the maximum level of nesting of subloops of LOOP. */
+
+unsigned
+get_loop_level (const struct loop *loop)
+{
+ const struct loop *ploop;
+ unsigned mx = 0, l;
+
+ for (ploop = loop->inner; ploop; ploop = ploop->next)
+ {
+ l = get_loop_level (ploop);
+ if (l >= mx)
+ mx = l + 1;
+ }
+ return mx;
+}