#include "irgraph_t.h"
#include "iredges_t.h"
#include "ircons.h"
+#include "irextbb.h"
#include "debug.h"
#include "bearch.h"
return curr;
}
-/** A simple forward single linked list. */
-typedef struct {
- ir_node *start; /**< start of the list */
- ir_node *end; /**< last block in the list */
- unsigned n_blks; /**< number of blocks in the list */
-} anchor;
-
-/**
- * Ext-Block walker: create a block schedule
- */
-static void create_block_list(ir_extblk *blk, void *env) {
- anchor *list = env;
- int i, n;
-
- for (i = 0, n = get_extbb_n_blocks(blk); i < n; ++i) {
- ir_node *block = get_extbb_block(blk, i);
-
- set_irn_link(block, NULL);
- if (list->start)
- set_irn_link(list->end, block);
- else
- list->start = block;
-
- list->end = block;
- ++list->n_blks;
- }
-}
-
-/*
- * Calculates a block schedule. The schedule is stored as a linked
- * list starting at the start_block of the irg.
- */
-ir_node **sched_create_block_schedule(ir_graph *irg, exec_freq_t *execfreqs)
-{
- anchor list;
- ir_node **blk_list, *b, *n;
- unsigned i;
-
- /* schedule extended basic blocks */
- compute_extbb_execfreqs(irg, execfreqs);
- //compute_extbb(irg);
-
- list.start = NULL;
- list.end = NULL;
- list.n_blks = 0;
- irg_extblock_walk_graph(irg, NULL, create_block_list, &list);
-
- /** create an array, so we can go forward and backward */
- blk_list = NEW_ARR_D(ir_node *, irg->obst,list.n_blks);
-
- for (i = 0, b = list.start; b; b = n, ++i) {
- n = get_irn_link(b);
- blk_list[i] = b;
- }
-
- return blk_list;
-}
+//---------------------------------------------------------------------------
typedef struct remove_dead_nodes_env_t_ {
ir_graph *irg;