- irg_walk_graph(current_ir_graph, get_loop_info, NULL, NULL);
-
- /* Depth of 0 is the procedure and 1 a topmost loop. */
- loop_depth = get_loop_depth(loop) - 1;
-
- /* Calculating in per mil. */
- max_loop_nodes_adapted = get_max_nodes_adapted(loop_depth);
-
- DB((dbg, LEVEL_1, "max_nodes: %d\nmax_nodes_adapted %d at depth of %d (adaption %d)\n",
- max_loop_nodes, max_loop_nodes_adapted, loop_depth, depth_adaption));
-
- if (! (loop_info.nodes > 0))
- return;
-
-#if LOOP_IGNORE_NODE_LIMITS
- DB((dbg, LEVEL_1, "WARNING: Loop node limitations ignored."));
-#else
- if (loop_info.nodes > max_loop_nodes) {
- /* Only for stats */
- DB((dbg, LEVEL_1, "Nodes %d > allowed nodes %d\n",
- loop_info.nodes, loop_depth, max_loop_nodes));
- count_stats(stats.too_large);
- /* no RETURN */
- /* Adaption might change it */
- }
-
- /* Limit processing to loops smaller than given parameter. */
- if (loop_info.nodes > max_loop_nodes_adapted) {
- DB((dbg, LEVEL_1, "Nodes %d > allowed nodes (depth %d adapted) %d\n",
- loop_info.nodes, loop_depth, max_loop_nodes_adapted));
- count_stats(stats.too_large_adapted);
- return;
- }
-
- if (loop_info.calls > opt_params.allowed_calls) {
- DB((dbg, LEVEL_1, "Calls %d > allowed calls %d\n",
- loop_info.calls, max_calls));
- count_stats(stats.calls_limit);
- return;
- }
-#endif