irop_flag_highlevel flag added to Confirm and Cast
[libfirm] / ir / ana / callgraph.c
index c7a0137..ab3fb3e 100644 (file)
@@ -1118,7 +1118,7 @@ static void compute_rec_depth (ir_graph *irg, void *env) {
 
 
 /* ----------------------------------------------------------------------------------- */
-/* Another algorithm to compute recursion nesting depth                                */
+/* Another algorithm to compute the execution freqency of methods ignoring recursions. */
 /* Walk the callgraph.  Ignore backedges.  Use sum of execution freqencies of Call     */
 /* nodes to evaluate a callgraph edge.                                                 */
 /* ----------------------------------------------------------------------------------- */
@@ -1129,6 +1129,9 @@ double get_irg_method_execution_frequency (ir_graph *irg) {
 
 void set_irg_method_execution_frequency (ir_graph *irg, double freq) {
   irg->method_execution_frequency = freq;
+
+  if (irp->max_method_execution_frequency < freq)
+    irp->max_method_execution_frequency = freq;
 }
 
 static void compute_method_execution_frequency (ir_graph *irg, void *env) {
@@ -1286,10 +1289,6 @@ void compute_performance_estimates(void) {
 
   DEL_ARR_F(e.loop_stack);
 
-  //dump_callgraph("-with_nesting");
-  //dump_callgraph_loop_tree(current_loop, "-after_cons");
-
-
   /* -- compute the execution frequency -- */
   irp->max_method_execution_frequency = 0;
   master_cg_visited += 2;
@@ -1341,4 +1340,18 @@ void analyse_loop_nesting_depth(void) {
   find_callgraph_recursions();
 
   compute_performance_estimates();
+
+  set_irp_loop_nesting_depth_state(loop_nesting_depth_consistent);
+}
+
+
+loop_nesting_depth_state get_irp_loop_nesting_depth_state(void) {
+  return irp->lnd_state;
+}
+void                     set_irp_loop_nesting_depth_state(loop_nesting_depth_state s) {
+  irp->lnd_state = s;
+}
+void                     set_irp_loop_nesting_depth_state_inconsistent(void) {
+  if (irp->lnd_state == loop_nesting_depth_consistent)
+    irp->lnd_state = loop_nesting_depth_inconsistent;
 }