int color; /**< target color */
set *conflicts; /**< contains conflict_t's. All internal conflicts */
int mis_size; /**< number of nodes in the mis. */
int color; /**< target color */
set *conflicts; /**< contains conflict_t's. All internal conflicts */
int mis_size; /**< number of nodes in the mis. */
* @param irn The node to set the color for
* @param col The color to set
* @param trigger The irn that caused the wish to change the color of the irn
* @param irn The node to set the color for
* @param col The color to set
* @param trigger The irn that caused the wish to change the color of the irn
* CHANGE_IMPOSSIBLE iff conflicts with reg-constraintsis occured.
* Else the first conflicting ir_node encountered is returned.
*
* CHANGE_IMPOSSIBLE iff conflicts with reg-constraintsis occured.
* Else the first conflicting ir_node encountered is returned.
*
ret_imposs:
DBG((dbg, LEVEL_3, "\t %n impossible\n", irn));
obstack_free(&confl_ob, NULL);
ret_imposs:
DBG((dbg, LEVEL_3, "\t %n impossible\n", irn));
obstack_free(&confl_ob, NULL);
ret_confl:
DBG((dbg, LEVEL_3, "\t %n conflicting\n", irn));
ret_confl:
DBG((dbg, LEVEL_3, "\t %n conflicting\n", irn));
qn->color = color;
qn->mis = malloc(ou->node_count * sizeof(*qn->mis));
qn->conflicts = new_set(set_cmp_conflict_t, SLOTS_CONFLICTS);
qn->color = color;
qn->mis = malloc(ou->node_count * sizeof(*qn->mis));
qn->conflicts = new_set(set_cmp_conflict_t, SLOTS_CONFLICTS);
* ordered by field 'size' (the size of the mis) in decreasing order.
*/
static INLINE void ou_insert_qnode(unit_t *ou, qnode_t *qn) {
* ordered by field 'size' (the size of the mis) in decreasing order.
*/
static INLINE void ou_insert_qnode(unit_t *ou, qnode_t *qn) {
DBG((dbg, LEVEL_1, "\tOptimizing unit:\n"));
for (i=0; i<ou->node_count; ++i)
DBG((dbg, LEVEL_1, "\tOptimizing unit:\n"));
for (i=0; i<ou->node_count; ++i)
- for (i=0; i<MAX_COLORS; ++i)
- if (is_possible_color(ou->nodes[0], i))
- ou_insert_qnode(ou, new_qnode(ou, i));
+ ou->co->isa->get_allocatable_regs(ou->nodes[0], ou->co->cls, pos_regs);
+ bitset_foreach(pos_regs, i)
+ ou_insert_qnode(ou, new_qnode(ou, i));
DBG((dbg, LEVEL_1, "\t Best color: %d Copies: %d/%d\n", curr->color, ou->interf+ou->node_count-curr->mis_size, ou->interf+ou->node_count-1));
/* globally pin root and eventually others */
pset_insert_ptr(pinned_global, ou->nodes[0]);
DBG((dbg, LEVEL_1, "\t Best color: %d Copies: %d/%d\n", curr->color, ou->interf+ou->node_count-curr->mis_size, ou->interf+ou->node_count-1));
/* globally pin root and eventually others */
pset_insert_ptr(pinned_global, ou->nodes[0]);
for (ns = set_first(curr->changed_nodes); ns; ns = set_next(curr->changed_nodes)) {
/* NO_COLOR is possible, if we had an undo */
if (ns->new_color != NO_COLOR) {
for (ns = set_first(curr->changed_nodes); ns; ns = set_next(curr->changed_nodes)) {
/* NO_COLOR is possible, if we had an undo */
if (ns->new_color != NO_COLOR) {
unit_t *curr;
dbg = firm_dbg_register("ir.be.copyoptheur");
firm_dbg_set_mask(dbg, DEBUG_LVL);
unit_t *curr;
dbg = firm_dbg_register("ir.be.copyoptheur");
firm_dbg_set_mask(dbg, DEBUG_LVL);
list_for_each_entry(unit_t, curr, &co->units, units)
list_for_each_entry(unit_t, curr, &co->units, units)