#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>
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 },
LC_OPT_ENT_ENUM_INT ("algo", "the block scheduling algorithm", &algo_var),
LC_OPT_LAST
};
+#endif /* WITH_LIBCORE */
/*
* ____ _
*/
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");
}
#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"
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 },
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,
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);
}
#include "config.h"
#endif
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-
#include <stdlib.h>
#include <limits.h>
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 },
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);
#include "config.h"
#endif
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-
#include <stdlib.h>
#include <limits.h>
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 },
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);
#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
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 },
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);
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);
#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"
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 },
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);
#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))
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 },
LC_OPT_ENT_ENUM_PTR("select", "node selector", &sched_select_var),
LC_OPT_LAST
};
+#endif /* WITH_LIBCORE */
/**
* All scheduling info needed per node.
* 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");
}
#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"
/* 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 },
#endif /* WITH_ILP */
LC_OPT_LAST
};
+#endif /* WITH_LIBCORE */
static be_module_list_entry_t *isa_ifs = NULL;
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. */
}
}
-void be_init_ra(void)
-{
+void be_init_ra(void) {
+#ifdef WITH_LIBCORE
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",
®ister_allocators, (void**) &selected_allocator);
+#endif
}
BE_REGISTER_MODULE_CONSTRUCTOR(init_be_ra);
#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))
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 },
LC_OPT_ENT_ENUM_MASK("dump", "dump phases", &dump_var),
LC_OPT_LAST
};
+#endif /* WITH_LIBCORE */
/******************************************************************************
* _ _ __ _ _
* 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);
#include "bemodule.h"
#include "be.h"
-#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;
+#ifdef WITH_LIBCORE
+#include <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+#include <libcore/lc_timing.h>
+
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;
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);