- implemented ia32 inport, outport for ir_bk_(in|out)port
[libfirm] / ir / be / beblocksched.c
index f089625..11fb8c0 100644 (file)
@@ -34,9 +34,7 @@
  * a next and prev pointers on blocks. The greedy algorithm sorts the edges by
  * execution frequencies and tries to transform them to fallthroughs in this order
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "beblocksched.h"
 
@@ -58,6 +56,7 @@
 #include "beirgmod.h"
 #include "bemodule.h"
 #include "be.h"
+#include "error.h"
 
 #include "lc_opts.h"
 #include "lc_opts_enum.h"
@@ -114,7 +113,7 @@ typedef struct _edge_t {
        int     pos;                /**< number of cfg predecessor (target) */
        double  execfreq;           /**< the frequency */
        int     highest_execfreq;   /**< flag that indicates whether this edge is the edge with the highest
-                                                                    execfreq pointing away from this block */
+                                        execfreq pointing away from this block */
 } edge_t;
 
 typedef struct _blocksched_env_t {
@@ -272,11 +271,10 @@ static void pick_block_successor(blocksched_entry_t *entry, blocksched_env_t *en
        const ir_edge_t    *edge;
        double             best_succ_execfreq;
 
-       if (irn_visited(block))
+       if (irn_visited_else_mark(block))
                return;
 
        env->blockcount++;
-       mark_irn_visited(block);
 
        DBG((dbg, LEVEL_1, "Pick succ of %+F\n", block));
 
@@ -508,7 +506,6 @@ static void collect_egde_frequency_ilp(ir_node *block, void *data)
        }
        else {
                int i;
-               int *edgenums = alloca(sizeof(edgenums[0]) * arity);
 
                snprintf(name, sizeof(name), "block_in_constr_%ld", get_irn_node_nr(block));
                cst = lpp_add_cst_uniq(env->lpp, name, lpp_greater, arity - 1);
@@ -764,6 +761,6 @@ ir_node **be_create_block_schedule(ir_graph *irg, ir_exec_freq *execfreqs)
 #endif /* WITH_ILP */
        }
 
-       assert(0 && "unknown blocksched algo");
+       panic("unknown blocksched algo");
        return NULL;
 }