* Date: 27.09.2006
* Copyright: (c) Universitaet Karlsruhe
* License: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
- *
+ * CVS-Id: $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
+#endif /* HAVE_CONFIG_H */
#include "beblocksched.h"
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <libcore/lc_timing.h>
-#endif
+#endif /* WITH_LIBCORE */
#ifdef WITH_ILP
#include <lpp/lpp.h>
#include <lpp/lpp_net.h>
-#endif
+#endif /* WITH_ILP */
typedef enum _blocksched_algos_t {
BLOCKSCHED_NAIV, BLOCKSCHED_EXTBB, BLOCKSCHED_GREEDY, BLOCKSCHED_ILP
{ "greedy", BLOCKSCHED_GREEDY },
#ifdef WITH_ILP
{ "ilp", BLOCKSCHED_ILP },
-#endif
+#endif /* WITH_ILP */
{ NULL, 0 }
};
};
static const lc_opt_table_entry_t be_blocksched_options[] = {
- LC_OPT_ENT_ENUM_INT ("algo", "the block scheduling algorithm", &algo_var),
+ LC_OPT_ENT_ENUM_INT ("algo", "the block scheduling algorithm (naiv, extbb, greedy, ilp)", &algo_var),
{ NULL }
};
{
const edge_t *e1 = d1;
const edge_t *e2 = d2;
- return e2->execfreq - e1->execfreq;
+ if (e2->execfreq > e1->execfreq) return 1;
+ if (e2->execfreq < e1->execfreq) return -1;
+ return 0;
}
static void coalesce_blocks(blocksched_env_t *env)
*/
foreach_block_succ(block, edge) {
ir_node *succ_block = get_edge_src_irn(edge);
+ double execfreq;
if(irn_visited(succ_block))
continue;
if(succ_entry->prev != NULL)
continue;
- double execfreq = get_block_execfreq(env->execfreqs, succ_block);
+ execfreq = get_block_execfreq(env->execfreqs, succ_block);
if(execfreq > best_succ_execfreq) {
best_succ_execfreq = execfreq;
succ = succ_block;
return block_list;
}
-#endif
+#endif /* WITH_ILP */
/*
* _____ _ ____ ____
lc_opt_add_table(blocksched_grp, be_blocksched_options);
}
-#endif
+#endif /* WITH_LIBCORE */
ir_node **be_create_block_schedule(ir_graph *irg, ir_exec_freq *execfreqs)
{
#ifdef WITH_ILP
case BLOCKSCHED_ILP:
return create_block_schedule_ilp(irg, execfreqs);
-#endif
+#endif /* WITH_ILP */
}
assert(0 && "unknown blocksched algo");