- /* Determine the maximum costs this unit can cause: all_nodes_cost */
- for(i=1; i<unit->node_count; ++i) {
- unit->sort_key = MAX(unit->sort_key, unit->costs[i]);
- unit->all_nodes_costs += unit->costs[i];
- }
-
- /* Determine the minimal costs this unit will cause: min_nodes_costs */
- unit->min_nodes_costs += unit->all_nodes_costs - ou_max_ind_set_costs(unit);
+ /* Src == Tgt of a 2-addr-code instruction */
+ if (is_2addr_code(get_arch_env(co), irn, &req)) {
+ int pos = req.data.pos;
+ ir_node *other = get_irn_n(irn, pos);
+ if (!nodes_interfere(co->chordal_env, irn, other)) {
+ unit->nodes = xmalloc(2 * sizeof(*unit->nodes));
+ unit->costs = xmalloc(2 * sizeof(*unit->costs));
+ unit->node_count = 2;
+ unit->nodes[0] = irn;
+ unit->nodes[1] = other;
+ unit->costs[1] = co->get_costs(irn, other, pos);
+ }
+ } else
+ assert(0 && "This is not an optimizable node!");