Do not mark the transformed as visited. It makes no sense at all.
[libfirm] / ir / be / beblocksched.c
index f089625..cbfb98d 100644 (file)
@@ -58,6 +58,7 @@
 #include "beirgmod.h"
 #include "bemodule.h"
 #include "be.h"
+#include "error.h"
 
 #include "lc_opts.h"
 #include "lc_opts_enum.h"
@@ -114,7 +115,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 +273,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));
 
@@ -764,6 +764,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;
 }