- /* setup the queue of blocks. */
- obstack_init(&q);
- obstack_ptr_grow(&q, irn_bl);
- in = 1;
- out = 0;
-
- /* process the queue. The code below checks for every block dominated
- * by the irns one, and in which the irn is live, if there are
- * conflicting nodes */
- while (out < in) {
- ir_node *curr_bl, *sub_bl;
- int i, max;
-
- curr_bl = ((ir_node **)obstack_base(&q))[out++];
-
- /* Add to the result all nodes in the block, which have
- * the target color and interfere with the irn */
- for (i = 0, max = get_irn_n_outs(curr_bl); i < max; ++i) {
- ir_node *n = get_irn_out(curr_bl, i);
- DBG((dbg, LEVEL_4, "Checking %+F defined in same block\n", n));
- if (arch_irn_has_reg_class(arch_env, n, arch_pos_make_out(0), cls)
- && n != trigger && qnode_get_new_color(qn, n) == col
- && nodes_interfere(chordal_env, irn, n)) {
- DBG((dbg, LEVEL_4, "\t %+F\ttroubles\n", n));
- obstack_ptr_grow(&confl_ob, n);
+ /*
+ * Try to color all conflicting nodes 'curr'
+ * with the color of the irn itself.
+ */
+ be_ifg_foreach_neighbour(ifg, iter, irn, curr) {
+ DBG((dbg, LEVEL_3, "\t Confl %+F(%d)\n", curr, qnode_get_new_color(qn, curr)));
+ if (qnode_get_new_color(qn, curr) == col && curr != trigger) {
+ sub_res = qnode_color_irn(qn, curr, irn_col, irn);
+ if (sub_res != CHANGE_SAVE) {
+ be_ifg_neighbours_break(ifg, iter);
+ return sub_res;