*/
#include "config.h"
+#include "be_t.h"
#include "bitset.h"
+#include "error.h"
#include "raw_bitset.h"
#include "pdeq.h"
{
const arch_register_req_t *req = arch_get_irn_register_req(node);
// For larger than 1 variables, support only aligned constraints
- assert(((!(req->type & arch_register_req_type_aligned)
- && req->width == 1)
- || (req->type & arch_register_req_type_aligned))
- && "Unaligned large (width > 1) variables not supported");
- return (req->type & arch_register_req_type_aligned) && req->width > 1;
+ assert((arch_register_req_is(req, aligned) || req->width == 1) && "Unaligned large (width > 1) variables not supported");
+ return arch_register_req_is(req, aligned) && req->width > 1;
}
static void make_color_var_name(char *buf, size_t buf_size,
unsigned n_regs = arch_register_class_n_regs(ienv->co->cls);
const unsigned *allocatable_colors = lenv->allocatable_colors;
nodes_iter_t iter;
- unsigned *colors;
ir_node *irn;
char buf[32];
- rbitset_alloca(colors, n_regs);
-
+ unsigned *const colors = rbitset_alloca(n_regs);
be_ifg_foreach_node(ifg, &iter, irn) {
const arch_register_req_t *req;
unsigned col;
static void build_affinity_cstr(ilp_env_t *ienv)
{
unsigned n_colors = arch_register_class_n_regs(ienv->co->cls);
- unit_t *curr;
/* for all optimization units */
list_for_each_entry(unit_t, curr, &ienv->co->units, units) {
}
}
-#define pset_foreach(pset, irn) for (irn=(ir_node*)pset_first(pset); irn; irn=(ir_node*)pset_next(pset))
+#define pset_foreach(pset, irn) foreach_pset((pset), ir_node, (irn))
/**
* Search for an interference clique and an external node
/* search for a candidate to extend the clique */
for (i=0; i<n_nodes; ++i) {
ir_node *cand = nodes[i];
- ir_node *member;
bool is_cand;
/* if its already in the clique try the next */
/* now the clique is maximal. Finally add the constraint */
{
- ir_node *member;
- int var_idx;
- int cst_idx;
- char buf[32];
+ int var_idx;
+ int cst_idx;
+ char buf[32];
cst_idx = lpp_add_cst(ienv->lp, NULL, lpp_greater_equal, pset_count(clique)-1);
*/
static int co_solve_ilp2(copy_opt_t *co)
{
- unsigned *allocatable_colors;
unsigned n_regs = arch_register_class_n_regs(co->cls);
lpp_sol_state_t sol_state;
ilp_env_t *ienv;
my.last_x_var = -1;
FIRM_DBG_REGISTER(dbg, "firm.be.coilp2");
- rbitset_alloca(allocatable_colors, n_regs);
+ unsigned *const allocatable_colors = rbitset_alloca(n_regs);
be_set_allocatable_regs(co->irg, co->cls, allocatable_colors);
my.allocatable_colors = allocatable_colors;