Commit 31636543 authored by Michael Beck's avatar Michael Beck
Browse files

backend part is always WITH_LIBCORE :-)

[r14903]
parent 79ed89a6
......@@ -49,6 +49,10 @@
#include "bemodule.h"
#include "be.h"
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <libcore/lc_timing.h>
#ifdef WITH_ILP
#include <lpp/lpp.h>
#include <lpp/lpp_net.h>
......@@ -62,13 +66,6 @@ typedef enum _blocksched_algos_t {
static int algo = BLOCKSCHED_GREEDY;
#ifdef WITH_LIBCORE
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <libcore/lc_timing.h>
static const lc_opt_enum_int_items_t blockschedalgo_items[] = {
{ "naiv", BLOCKSCHED_NAIV },
{ "extbb", BLOCKSCHED_EXTBB },
......@@ -87,7 +84,6 @@ static const lc_opt_table_entry_t be_blocksched_options[] = {
LC_OPT_ENT_ENUM_INT ("algo", "the block scheduling algorithm", &algo_var),
LC_OPT_LAST
};
#endif /* WITH_LIBCORE */
/*
* ____ _
......@@ -728,12 +724,11 @@ static ir_node **create_extbb_block_schedule(ir_graph *irg, ir_exec_freq *execfr
*/
void be_init_blocksched(void)
{
#ifdef WITH_LIBCORE
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *blocksched_grp = lc_opt_get_grp(be_grp, "blocksched");
lc_opt_add_table(blocksched_grp, be_blocksched_options);
#endif
FIRM_DBG_REGISTER(dbg, "firm.be.blocksched");
}
......
......@@ -38,6 +38,10 @@
#include "iterator.h"
#include "firm_config.h"
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <libcore/lc_timing.h>
#include "ircons_t.h"
#include "irmode_t.h"
#include "irgraph_t.h"
......@@ -119,11 +123,6 @@ static be_ra_timer_t ra_timer = {
NULL,
};
#ifdef WITH_LIBCORE
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <libcore/lc_timing.h>
static const lc_opt_enum_int_items_t lower_perm_items[] = {
{ "copy", BE_CH_LOWER_PERM_COPY },
{ "swap", BE_CH_LOWER_PERM_SWAP },
......@@ -175,7 +174,6 @@ static const lc_opt_table_entry_t be_chordal_options[] = {
LC_OPT_ENT_ENUM_PTR ("vrfy", "verify options", &be_ch_vrfy_var),
LC_OPT_LAST
};
#endif /* WITH_LIBCORE */
static void dump(unsigned mask, ir_graph *irg,
const arch_register_class_t *cls,
......@@ -631,13 +629,12 @@ static be_ra_t be_ra_chordal_allocator = {
void be_init_chordal_main(void)
{
#ifdef WITH_LIBCORE
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra");
lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal");
lc_opt_add_table(chordal_grp, be_chordal_options);
#endif
be_register_allocator("chordal", &be_ra_chordal_allocator);
}
......
......@@ -28,6 +28,9 @@
#include "config.h"
#endif
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <stdlib.h>
#include <limits.h>
......@@ -63,10 +66,6 @@ static int subtree_iter = 4;
static int max_depth = 20;
static double constr_factor = 0.9;
#ifdef WITH_LIBCORE
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
/* Options using libcore */
static const lc_opt_enum_mask_items_t dump_items[] = {
{ "before", DUMP_BEFORE },
......@@ -87,18 +86,15 @@ static const lc_opt_table_entry_t options[] = {
LC_OPT_ENT_INT ("max", "maximum recursion depth", &max_depth),
LC_OPT_LAST
};
#endif /* WITH_LIBCORE */
void be_init_copyheur2(void)
{
#ifdef WITH_LIBCORE
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra");
lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal");
lc_opt_entry_t *co2_grp = lc_opt_get_grp(chordal_grp, "co2");
lc_opt_add_table(co2_grp, options);
#endif
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur2);
......
......@@ -28,6 +28,9 @@
#include "config.h"
#endif
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <stdlib.h>
#include <limits.h>
......@@ -63,10 +66,6 @@
static unsigned dump_flags = 0;
static int dbg_level = 0;
#ifdef WITH_LIBCORE
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
static const lc_opt_enum_mask_items_t dump_items[] = {
{ "before", DUMP_BEFORE },
{ "after", DUMP_AFTER },
......@@ -83,18 +82,15 @@ static const lc_opt_table_entry_t options[] = {
LC_OPT_ENT_INT ("dbg", "debug level for the Java coalescer", &dbg_level),
LC_OPT_LAST
};
#endif /* WITH_LIBCORE */
void be_init_copyheur3(void)
{
#ifdef WITH_LIBCORE
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra");
lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal");
lc_opt_entry_t *co3_grp = lc_opt_get_grp(chordal_grp, "co3");
lc_opt_add_table(co3_grp, options);
#endif
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur3);
......
......@@ -66,6 +66,10 @@
#include "beirg_t.h"
#include "error.h"
#include <libcore/lc_timing.h>
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#define DUMP_BEFORE 1
#define DUMP_AFTER 2
#define DUMP_APPEL 4
......@@ -82,11 +86,6 @@ static cost_fct_t cost_func = co_get_costs_exec_freq;
static unsigned algo = CO_ALGO_HEUR4;
static int improve = 1;
#ifdef WITH_LIBCORE
#include <libcore/lc_timing.h>
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
static const lc_opt_enum_mask_items_t dump_items[] = {
{ "before", DUMP_BEFORE },
{ "after", DUMP_AFTER },
......@@ -152,7 +151,6 @@ static const lc_opt_table_entry_t options[] = {
LC_OPT_ENT_BOOL ("improve", "run heur3 before if algo can exploit start solutions", &improve),
LC_OPT_LAST
};
#endif /* WITH_LIBCORE */
/* Insert additional options registration functions here. */
extern void be_co_ilp_register_options(lc_opt_entry_t *grp);
......@@ -161,14 +159,12 @@ extern void be_co3_register_options(lc_opt_entry_t *grp);
void be_init_copycoal(void)
{
#ifdef WITH_LIBCORE
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra");
lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal");
lc_opt_entry_t *co_grp = lc_opt_get_grp(chordal_grp, "co");
lc_opt_add_table(co_grp, options);
#endif
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copycoal);
......
......@@ -30,6 +30,10 @@
#include <stdlib.h>
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <libcore/lc_timing.h>
#include "bitset.h"
#include "irgwalk.h"
#include "irnode_t.h"
......@@ -702,11 +706,6 @@ enum {
static int ifg_flavor = BE_IFG_STD;
#ifdef WITH_LIBCORE
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <libcore/lc_timing.h>
static const lc_opt_enum_int_items_t ifg_flavor_items[] = {
{ "std", BE_IFG_STD },
{ "fast", BE_IFG_FAST },
......@@ -725,16 +724,13 @@ static const lc_opt_table_entry_t be_ifg_options[] = {
LC_OPT_ENT_ENUM_PTR ("ifg", "interference graph flavour", &ifg_flavor_var),
LC_OPT_LAST
};
#endif /* WITH_LIBCORE */
void be_init_ifg(void)
{
#ifdef WITH_LIBCORE
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *ifg_grp = lc_opt_get_grp(be_grp, "ifg");
lc_opt_add_table(ifg_grp, be_ifg_options);
#endif
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_ifg);
......
......@@ -61,6 +61,9 @@
#include "bestat.h"
#include "beirg_t.h"
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL);
#define BE_SCHED_NODE(irn) (be_is_Keep(irn) || be_is_CopyKeep(irn) || be_is_RegParams(irn))
......@@ -90,11 +93,6 @@ static list_sched_options_t list_sched_options = {
BE_SCHED_PREP_NONE, /* no scheduling preparation */
};
#ifdef WITH_LIBCORE
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
/* schedule selector options. */
static const lc_opt_enum_int_items_t sched_select_items[] = {
{ "trivial", BE_SCHED_SELECT_TRIVIAL },
......@@ -127,7 +125,6 @@ static const lc_opt_table_entry_t list_sched_option_table[] = {
LC_OPT_ENT_ENUM_PTR("select", "node selector", &sched_select_var),
LC_OPT_LAST
};
#endif /* WITH_LIBCORE */
/**
* All scheduling info needed per node.
......@@ -732,12 +729,11 @@ void list_sched_single_block(const be_irg_t *birg, ir_node *block,
* Register list scheduler options.
*/
void be_init_listsched(void) {
#ifdef WITH_LIBCORE
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *sched_grp = lc_opt_get_grp(be_grp, "listsched");
lc_opt_add_table(sched_grp, list_sched_option_table);
#endif
FIRM_DBG_REGISTER(dbg, "firm.be.sched");
}
......
......@@ -31,6 +31,10 @@
#include <stdarg.h>
#include <stdio.h>
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <libcore/lc_timing.h>
#include "obst.h"
#include "bitset.h"
......@@ -98,11 +102,6 @@ static char config_file[256] = { 0 };
/* back end instruction set architecture to use */
static const arch_isa_if_t *isa_if = NULL;
#ifdef WITH_LIBCORE
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <libcore/lc_timing.h>
/* possible dumping options */
static const lc_opt_enum_mask_items_t dump_items[] = {
{ "none", DUMP_NONE },
......@@ -163,7 +162,6 @@ static const lc_opt_table_entry_t be_main_options[] = {
#endif /* WITH_ILP */
LC_OPT_LAST
};
#endif /* WITH_LIBCORE */
static be_module_list_entry_t *isa_ifs = NULL;
......@@ -187,27 +185,21 @@ void be_opt_register(void)
be_init_modules();
#ifdef WITH_LIBCORE
be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_add_table(be_grp, be_main_options);
be_add_module_list_opt(be_grp, "isa", "the instruction set architecture",
&isa_ifs, (void**) &isa_if);
#endif
}
/* Parse one argument. */
int be_parse_arg(const char *arg) {
#ifdef WITH_LIBCORE
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
if (strcmp(arg, "help") == 0 || (arg[0] == '?' && arg[1] == '\0')) {
lc_opt_print_help(be_grp, stdout);
return -1;
}
return lc_opt_from_single_arg(be_grp, NULL, arg, NULL);
#else
return 0;
#endif
}
/** The be parameters returned by default, all off. */
......
......@@ -65,12 +65,11 @@ void be_allocate_registers(be_irg_t *birg)
}
}
void be_init_ra(void) {
#ifdef WITH_LIBCORE
void be_init_ra(void)
{
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
be_add_module_list_opt(be_grp, "regalloc", "register allocator",
&register_allocators, (void**) &selected_allocator);
#endif
}
BE_REGISTER_MODULE_CONSTRUCTOR(init_be_ra);
......@@ -59,6 +59,10 @@
#include "besched_t.h"
#include "beirg_t.h"
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#define ARR_LEN_SAFE(arr) ((arr) != NULL ? ARR_LEN((arr)) : 0)
#define HASH_RSS_EDGE(edge) ((get_irn_node_nr((edge)->src) << 16) | (get_irn_node_nr((edge)->tgt) & 0xFFFF))
......@@ -197,10 +201,6 @@ static rss_opts_t rss_options = {
RSS_DUMP_NONE,
};
#ifdef WITH_LIBCORE
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
static const lc_opt_enum_int_items_t dump_items[] = {
{ "none", RSS_DUMP_NONE },
{ "cbc", RSS_DUMP_CBC },
......@@ -220,7 +220,6 @@ static const lc_opt_table_entry_t rss_option_table[] = {
LC_OPT_ENT_ENUM_MASK("dump", "dump phases", &dump_var),
LC_OPT_LAST
};
#endif /* WITH_LIBCORE */
/******************************************************************************
* _ _ __ _ _
......@@ -2137,13 +2136,11 @@ static void process_block(ir_node *block, void *env) {
* Register the options.
*/
void be_init_schedrss(void) {
#ifdef WITH_LIBCORE
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *sched_grp = lc_opt_get_grp(be_grp, "sched");
lc_opt_entry_t *rss_grp = lc_opt_get_grp(sched_grp, "rss");
lc_opt_add_table(rss_grp, rss_option_table);
#endif
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_schedrss);
......
......@@ -34,21 +34,18 @@
#include "bemodule.h"
#include "be.h"
int be_coalesce_spill_slots = 1;
int be_do_remats = 1;
#ifdef WITH_LIBCORE
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
#include <libcore/lc_timing.h>
int be_coalesce_spill_slots = 1;
int be_do_remats = 1;
static const lc_opt_table_entry_t be_spill_options[] = {
LC_OPT_ENT_BOOL ("coalesce_slots", "coalesce the spill slots", &be_coalesce_spill_slots),
LC_OPT_ENT_BOOL ("remat", "try to rematerialize values instead of reloading", &be_do_remats),
LC_OPT_LAST
};
#endif /* WITH_LIBCORE */
static be_module_list_entry_t *spillers = NULL;
static be_spiller_t *selected_spiller = NULL;
......@@ -70,14 +67,12 @@ void be_do_spill(be_irg_t *birg, const arch_register_class_t* cls)
void be_init_spilloptions(void)
{
#ifdef WITH_LIBCORE
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *spill_grp = lc_opt_get_grp(be_grp, "spill");
lc_opt_add_table(spill_grp, be_spill_options);
be_add_module_list_opt(spill_grp, "spiller", "spill algorithm",
&spillers, (void**) &selected_spiller);
#endif /* WITH_LIBCORE */
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spilloptions);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment