OSDN Git Service

* config/rs6000/rs6000.md: Document why a pattern is not
[pf3gnuchains/gcc-fork.git] / gcc / cfgloopanal.c
index 9b3ffa0..63d6f41 100644 (file)
@@ -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;
+}