combos constant dataflow analysis has to be consistent with the localopt; this should...
[libfirm] / ir / ana / execution_frequency.c
index e7e21e7..8765c71 100644 (file)
@@ -31,6 +31,7 @@
 #include "set.h"
 #include "pdeq.h"
 #include "hashptr.h"
+#include "error.h"
 
 #include "irprog_t.h"
 #include "irgraph_t.h"
@@ -130,7 +131,7 @@ static int just_passed_a_Raise = 0;
 static ir_node *Cond_list = NULL;
 
 /* We do not use an extra set, as Projs are not yet in the existing one. */
-void set_ProjX_probability(ir_node *n, Cond_prob prob)
+static void set_ProjX_probability(ir_node *n, Cond_prob prob)
 {
   reg_exec_freq ef;
   ef.reg  = n;
@@ -138,7 +139,7 @@ void set_ProjX_probability(ir_node *n, Cond_prob prob)
   set_insert(exec_freq_set, &ef, sizeof(ef), exec_freq_hash(&ef));
 }
 
-Cond_prob get_ProjX_probability(ir_node *n)
+static Cond_prob get_ProjX_probability(ir_node *n)
 {
   reg_exec_freq ef, *found;
   ef.reg  = n;
@@ -153,8 +154,7 @@ Cond_prob get_ProjX_probability(ir_node *n)
 
 /* A walker that only visits the nodes we want to see. */
 
-static void
-my_irg_walk_2_both(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void * env)
+static void my_irg_walk_2_both(ir_node *node, irg_walk_func *pre, irg_walk_func *post, void * env)
 {
   int i;
   set_irn_visited(node, current_ir_graph->visited);
@@ -246,7 +246,7 @@ static void walk_post(ir_node *n, void *env)
 /** Precompute which Conds test for an exception.
  *
  *  Operates on current_ir_graph. */
-void precompute_cond_evaluation(void)
+static void precompute_cond_evaluation(void)
 {
   ir_node *c;
 
@@ -266,10 +266,12 @@ void precompute_cond_evaluation(void)
     /* both are exceptions */
     if ((get_ProjX_probability(p0) == Cond_prob_exception_taken) &&
         (get_ProjX_probability(p1) == Cond_prob_exception_taken)   ) {
-      assert(0 && "I tried to avoid these!");
+      panic("I tried to avoid these!");
+#if 0
       /* It's a */
       set_ProjX_probability(p0, Cond_prob_normal);
       set_ProjX_probability(p1, Cond_prob_normal);
+#endif
     }
 
     /* p0 is exception */