verbosity
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Tue, 28 Sep 2004 12:35:07 +0000 (12:35 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Tue, 28 Sep 2004 12:35:07 +0000 (12:35 +0000)
[r3983]

ir/opt/tailrec.c
ir/opt/tailrec.h

index 4d043d9..57a28f4 100644 (file)
@@ -26,6 +26,8 @@
 #include "irflag.h"
 #include "firmstat.h"
 
+static int n_opt_applications = 0;
+
 /**
  * the environment for colelcting data
  */
@@ -309,6 +311,11 @@ void opt_tail_rec_irg(ir_graph *irg)
   if (! n_tail_calls)
     return;
 
+  if (get_opt_tail_recursion_verbose() && get_firm_verbosity() > 1)
+    printf("  Performing tail recursion for graph %s and %d Calls\n",
+          get_entity_ld_name(get_irg_entity(irg)), n_tail_calls);
+  n_opt_applications++;
+
   do_opt_tail_rec(irg, rets, n_tail_calls);
 }
 
@@ -322,9 +329,14 @@ void opt_tail_recursion(void)
   if (! get_opt_tail_recursion() || ! get_opt_optimize())
     return;
 
+  n_opt_applications = 0;
+
   for (i = 0; i < get_irp_n_irgs(); i++) {
     current_ir_graph = get_irp_irg(i);
 
     opt_tail_rec_irg(current_ir_graph);
   }
+
+  if (get_opt_tail_recursion_verbose())
+    printf("Performed tail recursion for %d of %d graphs\n", n_opt_applications, get_irp_n_irgs());
 }
index 880d554..deedd12 100644 (file)
@@ -26,6 +26,8 @@
  * Optimizes simple tail-recursion calls by
  * converting them into loops. Depends on the flag opt_tail_recursion.
  *
+ * Does not work for Calls that use the exception stuff.
+ *
  * @param irg   the graph to be optimized
  */
 void opt_tail_rec_irg(ir_graph *irg);