-
/**
* More experiments on coalescing.
* @author Sebastian Hack
* @date 25.07.2006
*/
-
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
#endif
-#ifdef WITH_LIBCORE
#include <libcore/lc_opts.h>
#include <libcore/lc_opts_enum.h>
-#endif /* WITH_LIBCORE */
#include <stdlib.h>
#include <limits.h>
#include "debug.h"
#include "bitfiddle.h"
#include "bitset.h"
+#include "raw_bitset.h"
#include "irphase_t.h"
#include "irgraph_t.h"
#include "irprintf.h"
#include "irtools.h"
+#include "bemodule.h"
#include "beabi.h"
#include "benode_t.h"
#include "becopyopt.h"
static unsigned dump_flags = 0;
static int dbg_level = 0;
-#ifdef WITH_LIBCORE
static const lc_opt_enum_mask_items_t dump_items[] = {
{ "before", DUMP_BEFORE },
{ "after", DUMP_AFTER },
{ NULL }
};
-void be_co3_register_options(lc_opt_entry_t *grp)
+void be_init_copyheur3(void)
{
- lc_opt_entry_t *co3_grp = lc_opt_get_grp(grp, "co3");
+ 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);
static void set_admissible_regs(be_java_coal_t *coal, copy_opt_t *co, ir_node *irn, int t_idx, int *col_map)
{
- unsigned i;
- arch_register_req_t req;
- unsigned n_regs = co->cls->n_regs;
+ const arch_register_req_t *req;
+
+ req = arch_get_register_req(co->aenv, irn, BE_OUT_POS(0));
// ir_printf("%+F\n", irn);
- arch_get_register_req(co->aenv, &req, irn, BE_OUT_POS(0));
- if(arch_register_req_is(&req, limited)) {
- bitset_t *adm = bitset_alloca(n_regs);
- req.limited(req.limited_env, adm);
- for(i = 0; i < n_regs; ++i)
- if(!bitset_is_set(adm, i) && col_map[i] >= 0) {
- // printf("\tforbidding color: %d\n", i);
+ if(arch_register_req_is(req, limited)) {
+ unsigned i;
+ unsigned n_regs = co->cls->n_regs;
+
+ for(i = 0; i < n_regs; ++i) {
+ if(!rbitset_is_set(req->limited, i) && col_map[i] >= 0) {
be_java_coal_forbid_color(coal, t_idx, col_map[i]);
}
+ }
}
}